PayPal, IPN, Testing..

I never did like the whole PayPal sandbox thingie. I usually end up doing a real transaction + refund. Because, you never know. Unless you have extensive logging and emailing capabilities in your back-end, as I these days do..

PayPal does have a cute tool you can use to test your IPN script0, here. I have started using this, creating a quick "ipn-test.php" copy of my ipn script, setting the use_sandbox to true and go..

It's basic, way more basic than you would expect from a company like PayPal. The first gripe is that it doesn't insert any of your user data (even though login is required to use it). Sounds like a job for greasemonkey, though seriously?

For example, you can get it to use (one of) your own email addresses as the payer, so your IPN script can send you stuff. But you need to enter that manually, every single time. Along with the item name, all the amounts (the most important of which, cannot be edited unless you enable all fields!). They have even disabled the auto-complete features so that your browser won't remember it!

The second gripe is that it's US-only. If you work with a currency not US Dollars, there is no option for your currency in the drop-down. At All. What is even more annoying is that if you edit it in-place, replacing "USD" (both occurrences) with your own currency code (e.g. "GBP"), it works fine.

So rather than some web-bod at PayPal taking five minutes to add the currency codes to the drop-down, thousands of international PayPal users have to individually edit it, for every single test, every single day, using whatever excuse for a code inspector their browser has to offer, though for developers one would hope that would be something substantial, anyway.

It's a disaster of a page that takes twenty times longer to use than required. It won't even remember your previous form inputs. Not really helping with the daily work-flow here, guys! Also..

An actual PayPal request..
[notify_version] => 3.8

A PayPal sandbox request..
[notify_version] => 2.4

They aren't working on it. But it does work.

Which is what I wanted to tell you. The PayPal IPN tester (sorry, "Simulator") is dreadful, but basically it's the only game in town. So don't let its apparent US-onlyness put you off using it, simply switch the currency code1. Yes, okay, for EVERY SINGLE TEST2, but still, a valid IPN request for your IPN listener to chew on.

It's either that or code your own sandbox.domain.com simulator in php. Hmm. Or perhaps code up a form page that sends your own POST request to the simulator front page. Hmmm..

for now..

;o)

references:
0. For those that do not know, the PayPal API has the capability to post a request to a script on your web site. It's called Instant Payment Notification, or IPN, for short. You can use this facility to process orders, issue instant software licenses, etc.. Of course, for security reasons, any half-sensible IPN listening script isn't going to be fooled into accepting requests from any old server, so you need to use PayPal's sandbox capabilities to test if your IPN script is doing what it is supposed to be doing. That or, as I used to, code VERY CAREFULLY.. and wait. smiley for :D

1. Once you get all the parameters correct, and edited, you can then simply refresh the page to resend the same IPN request.

2. You might want to bug PayPal about this.

 ©  2024 « corz.org » 24.3.28  

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!