Testing recurring payments in the Paypal sandbox
Asked Answered
B

2

7

I've read this post, and this one, and I didn't find my solution.

I'm trying to test the recurring payments using the Paypal Standard payment system. The problem is that the minumum frequency period for recurring payments is 1 day (1D). And this is a too long time to test correctly.

I read this article saying that if you setup the period to 1D in the sandbox, the call to the IPN is done each minute, but I was unable to make it work.

Do you know any way to have full control to test the recurring payments?

Bluet answered 20/6, 2013 at 11:8 Comment(0)
S
1

One day is the shortest timeframe you can set. You used to be able to test recurring payments that billed every minute, but this was disabled shortly after it was rolled out. What some merchants have done in the past if they did not want to wait the full day was to set up their own IPN simulator, similar to what is currently on the developer.paypal.com site. The difference is that they would set it up to pass over all the recurring payment details. Basically, it was just a form that posted over all of the variables that PayPal would have sent. Otherwise, you would have to wait the full day for the profiles to bill again.

Smacker answered 20/6, 2013 at 14:9 Comment(5)
Oh no! I cannot test it day by day!! It's a horrible thing.Umbrageous
I agree. That's a total disgrace! I'm talking to a paypal dev evangelist atm. He says you should be able to test in minutes, but maybe that hasn't been carried over. I'll report back with answers!!Inharmonic
Had a hunch. I edited the HTML of the IPN Simulator to include the additional fields (like recurring_payment_id). I then submitted the IPN Simulator form. It included the additional fields that I'd added to the IPN I received. They said there was no validation on the fields, so I guessed they wouldn't check WHAT fields either.Inharmonic
My problem is that I actually want to know what IPNs are sent in this or that case and what kind of fields they contain. IPN Simulator would have been a perfect tools for this, if it did provide a way to send all kind of IPNs. Or even better - actually simulate every case, like - subscription created - and Simulator sends subscr_signup, subscr_payment and subscr_eot (if not recurring) IPNs.Lubricous
@Lubricous Sadly they did not offer any additional answers from paypal at all on this. It's quite difficult to work with recurring payments on paypal! I recommend Stripe for new projects now, which is far far far easier to test! =]Inharmonic
I
3

As I commented in the accepted answer, it's possible to add fields by editing the HTML via firebug / chrome dev tools to add additional fields to the IPN sent by the IPN simulator. This way you can add the additional fields you require (like recurring_payment_id), which will be sent with the IPN to your specified URL. Once you've added your additional fields, copy the html so you can add it every time you want to use it. I'm considering writing a grease monkey extension (or something) that adds some javascript to the page, allowing for additional IPN types, like those needed for recurring payments.

Inharmonic answered 1/8, 2013 at 13:10 Comment(2)
Good find, but it's pretty disgraceful for a multi-national company that provides payments services as a core offering that this is the answer.Lyford
I wrote this little JS snippet to insert several hidden inputs into the page at once: var ipn_params = {'txn_type': 'recurring_payment_profile_created', 'recurring_payment_id': 'I-VYR2VN3XPVW4', 'next_payment_date': '03:00:00 Sep 12, 2013 PDT'};function insertInput(name, value){var para, hiddenInput, br; para = document.getElementById('ipn_details'); hiddenInput = document.createElement('input'); hiddenInput.type = 'hidden'; hiddenInput.name = name; hiddenInput.value = value; para.appendChild(hiddenInput);};Object.keys(ipn_params).forEach(function(key) {insertInput(key, ipn_params[key]);});Leralerch
S
1

One day is the shortest timeframe you can set. You used to be able to test recurring payments that billed every minute, but this was disabled shortly after it was rolled out. What some merchants have done in the past if they did not want to wait the full day was to set up their own IPN simulator, similar to what is currently on the developer.paypal.com site. The difference is that they would set it up to pass over all the recurring payment details. Basically, it was just a form that posted over all of the variables that PayPal would have sent. Otherwise, you would have to wait the full day for the profiles to bill again.

Smacker answered 20/6, 2013 at 14:9 Comment(5)
Oh no! I cannot test it day by day!! It's a horrible thing.Umbrageous
I agree. That's a total disgrace! I'm talking to a paypal dev evangelist atm. He says you should be able to test in minutes, but maybe that hasn't been carried over. I'll report back with answers!!Inharmonic
Had a hunch. I edited the HTML of the IPN Simulator to include the additional fields (like recurring_payment_id). I then submitted the IPN Simulator form. It included the additional fields that I'd added to the IPN I received. They said there was no validation on the fields, so I guessed they wouldn't check WHAT fields either.Inharmonic
My problem is that I actually want to know what IPNs are sent in this or that case and what kind of fields they contain. IPN Simulator would have been a perfect tools for this, if it did provide a way to send all kind of IPNs. Or even better - actually simulate every case, like - subscription created - and Simulator sends subscr_signup, subscr_payment and subscr_eot (if not recurring) IPNs.Lubricous
@Lubricous Sadly they did not offer any additional answers from paypal at all on this. It's quite difficult to work with recurring payments on paypal! I recommend Stripe for new projects now, which is far far far easier to test! =]Inharmonic

© 2022 - 2024 — McMap. All rights reserved.