Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how i come to know if cancel subscription from Paypal site

I have integrated PayPal merchant account to the website , m doing it for a client People can sign up to the website after subscribing and hence paying thru PayPal .we have recurring payments. But if people unsubscribe from the site their access to the site is closed but my issue is if people don't click the unsubscribe on the site but just cancel the recurring payment from their own PayPal accounts how would I cancel their subscription on the site. Please suggest some PHP code or idea to cancel the subscription.

Thanks in Advance, vikas tyagi

like image 900
thecodedeveloper.com Avatar asked Feb 21 '12 06:02

thecodedeveloper.com


2 Answers

i got it a perfect solution of my question

In addition to email notification, PayPal can send you the transaction data (also called Instant Payment Notification) to a specific url. With Instant Payment Notification, PayPal sends payment notification messages with encrypted code to the specified URL for each payment you receive. Follow the instructions below to setup Instant Payment Notification.

  1. Go to the PayPal website and log in to your account.
  2. Click "Profile" at the top of the page.
  3. Click "Instant Payment Notification Preferences" in the Selling Preferences column.
  4. Click "Edit IPN Settings."
  5. Enter the notification URL and select "Receive IPN messages."
  6. Click "Save."

You can send customized emails from the Instant Payment Notification data. Please see http://paypaltech.com/SG2 for sample scripts.

we can customize sample script code according our need.

like image 92
thecodedeveloper.com Avatar answered Nov 13 '22 02:11

thecodedeveloper.com


Add the logic to your Paypal IPN handler, Paypal should send a notification to your server via IPN with that information.

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECRecurringPayments

Another idea could be queryiing paypal API and see if the subsscription is still active when the user logs in.

But im sure IPN handler is easier to implement

like image 44
zad Avatar answered Nov 13 '22 01:11

zad