1

My site works fine, no problems, in live Paypal mode using real money and real paypal accounts, so I know my listeners work, but despite trying every option (and there are so many) I've found, I can't get the sandbox to work at all, to thoroughly test as needed. For instance, I'd like to test echecks and lots of other options I'm not familiar with live.

For the sandbox, We are told to change the posting address to sandbox.paypal.com .... but even this is a bit vague in the Paypal documentation, although I assume and have changed it in all of my submitted website form, my IPN handler and my return page for the PDT handling.

Then we are told, again somewhat vaguely, to create development accounts. I've done that, a buyer and a seller, both verified.

Then we are told, elsewhere, maybe, that it's necessary to "login" to your development account as you test your page in the Sandbox, although I'm still not clear if this is absolutely necesssary and which incidentally is again vague, because it's possible to use your normal business login and get to the development page through Paypal Developer site, without logging in specifically to one of your created sandbox accounts (which is a separate login.) But I've mainly assumed you need to be in a specific Sandbox created account, with the separate login from your normal Paypal one, but maybe it's just the development page with my normal paypal login that's required? None seem to work anyway.

So then you have the issue (if it is an issue - I just don't know) - if you DO have to login in to a created Sandbox account as you test sending your form to sandbox.paypal, which one? The one you pay with when the paypal payment page comes up on your site, the one that is set up as a seller account, the one which is referenced as your "business" in your input form? Are there any requirements for all this. Then, which account needs to be on my form as my "business" - my real or my test seller, which account do I login to on the Sandbox as I test and which account do I buy with, because if I buy from my sandbox buying account, it will change my paypal session if I've used the selling account or my real account to login to the sandbox.

I don't even know if any of these login issues are issues - they only seem like issues because I can't get the sandbox to work and I've tried each combination multiple times.

I've also seen that you maybe need to have input type="hidden" name="test_ipn" value="1" in your submitted form, so again, it's meant testing each possibility with and without that.

Then someone says it only works on certain ports e.g. 80 or 443, and not others, so you test each login combination, with the test_ipn option, with the port options ... still nothing with the Sandbox.

So, does anybody know - are there any rules which are required to be followed other than changing the posting addresses (I assume all of them - your form and your handlers) to https://www.sandbox.paypal.com/cgi-bin/webscr ... etc.

I'm thinking of rules about needing to log in to a Sandbox account, so which account, if any, you should login into on the Sandbox as you test your form (it seems obvious it should be the seller account but that creates a conflict when I then login as a buyer on my paypal form), which one you buy from and which one is declared as your business on the form, bearing in mind that one may overwrite the session of the other (and using all the same hasn't worked for me.) Are there specific ports required? Do we have to use the test_ipn field in the form or are there any other requirements I've overlooked which Paypal doesn't properly explain, because it's just about driving me crazy and the Paypal documentation really isn't fit for purpose.

1 Answers1

0

The first step to testing in the sandbox is indeed to create your developer account at http://developer.paypal.com, and then create actual sandbox accounts within that; at least one buyer and one seller account.

Once you've created your seller account you can login to that account and setup IPN within the profile just like you would a live account, or you can use the notify parameter in buttons or API calls to trigger it just like live as well. The only thing notify doesn't work with is recurring payments. For those you would have to set up IPN in the profile on both sandbox and live seller accounts.

If you're testing Standard Payments buttons, and you're using hosted buttons, then you'll need to create separate buttons for the sandbox seller account from within the sandbox account directly just like you did on your live account. If you're not using hosted buttons then you can just use the same button/checkout code, but change the PayPal URL to sandbox.paypal.com like you outlined.

Basically, you'll treat your sandbox seller account exactly like you treat your live seller account, and you need to configure it all the same way. Then to do a complete test you'll go through the checkout process and login to pay using your sandbox buyer account.

You don't have to do anything with test_ipn parameters except for check for it. When you get an IPN from the sandbox servers it will include test_ipn=1 simply so your application can decipher whether or not the IPN is a real one or a sandbox one.

As for login, it used to be that you did have to be signed in to developer.paypal.com in order for sandbox transactions to work (which was a pain in the ass), but that is not the case anymore. Now you can simply go straight to http://sandbox.paypal.com and login with any sandbox account you've created whether you're logged into the developer site or not.

Hope that helps some.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • 1
    Thanks very much for your time and answer - but can't get it to work. Am I correct to think that IPN handler database code should execute in sandbox testing mode (or the simulator) or is it merely a test of whether your header responds and messages can be sent back and forth? The more I read the documentation, the less clear it becomes. If it worked - it would seem clear, when it doesn't, and you want precision from the documentation, you realise it is full of false trails, ambiguities and unexplained situations. – Charles Hamilton Aug 17 '14 at 21:23
  • Your IPN script should function exactly the same way in the sandbox and live. You should see database updates, email notifications, or whatever you've got going on in the IPN script. If you're not seeing that then the first step is to ensure the IPN's are indeed getting sent. Check the IPN History in the PayPal sandbox account. It will show you whether they're being sent and what response code your server is returning back to PayPal's server. – Drew Angell Aug 18 '14 at 00:06