Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

paypal verifying first payment or initamt was billed in recurring payment

I want my users to be able to subscribe to a recurring payment (using the express checkout api) The first payment needs to be billed immediately that the user subscribes, and I need to know that they have been successfully billed before granting them access.

Is there a straight forward way to do this?

I've tried, creating a recurring payment profile with an INITAMT set, however, it's not clear that the user is being billed (when using the sandbox), and there is no txn_id (or the equivalent) being returned to suggest that billing has been done. I do get an IPN confirmation however that comes "some time" after creating the profile, which makes it difficult to offer a great user experience.

I've tried adding a one time payment, authenticating that with DoExpressCheckoutPayment, then setting up the recurring profile if the one-off payment works, however the Authentication also fails and at this points I've given up (although there may still be some legs in this approach).

Anyway, I thought I'd ask the experts here. Is there a simple way to setup a recurring payment, one payment per month, first payment billed now() and have the first payment confirmed via the API without having to wait an unknown amount of time for an IPN confirmation message?

like image 218
mark Avatar asked Nov 26 '12 15:11

mark


1 Answers

This can be done as you require, I've tested it and it works. The key is that you need to process both a standard digital goods payment as well as a recurring payment using the same Express Checkout flow, i.e. The user will be asked to pay a once-off, as well as approve a subscription. You would want to set the s

  1. Follow the instructions for setting up the payment: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec-basicDigGoodsPayment-curl-etc/

  2. Add the fields specified for recurring payment: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec-recurringPaymentProfile-curl-etc/

  3. Process 'DoExpressCheckoutPayment' and if successful, 'CreateRecurringPaymentsProfile' with a start date of your first 'renewal' date.

You should now have both transaction id for the one-off payment, as well as a profile id for the recurring payment.

like image 134
skieter Avatar answered Sep 23 '22 05:09

skieter