Paypal Recurring api for find next recurring payment occure
Asked Answered
N

2

3

i has been implemented paypal recurring subscription plan in php and paypal recurring also charge via paypal as per recurring periods. but my system didnt find out next recurring was charged or not so how could i know next recurring payment has been charged using paypal api.

i want to help for to upgrade next expire date after next recurring payment changed.

Numinous answered 1/2, 2014 at 6:4 Comment(0)
F
2

As I understood, you want to see if the user paid or not and change expiration date according to that.

The solution is Webhooks. In your PayPal Application section click on add webhook and choose PAYMENT.SALE.COMPLETED and enter the URL that you want to listen to this event where PayPal will send a post request to this URL when you get a new payment completed. In the page that corresponds to the URL you entered, you have to do the followings:

  1. Verify that the call is from PayPal, not from another source (in case you are using PHP you can check this: PHP verify Paypal webhook signature)
  2. Parse the data sent from PayPal by reading the body content, not the POST data
  3. Verify that the event is what you need, in this case PAYMENT.SALE.COMPLETED
  4. Verify the amount you received and the currency
  5. Make sure that you have not processed this transaction before and this is too important
  6. If everything is valid, you can save the transaction and do whatever you want, in your case extending the expiry date.
Fortier answered 18/10, 2021 at 7:46 Comment(0)
F
0

If I understand you correctly, you need to configure Instant Payment Notification (IPN). PayPal's server will POST transaction data to a listener script you have on your server so you can process things accordingly. It happens in real-time.

When working with recurring payments you'll get an IPN when a profile is created, canceled, or suspended, and you'll also get notifications when payments for profiles are completed, failed, etc. You can update your system or send out email notifications accordingly based on the IPN data you get.

Formative answered 1/2, 2014 at 6:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.