Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal recurring payment cancelled with remaining days

I've a subscription-based membership, however I encountered the following problem:

  1. User subscribed on May 1st 2012 with a monthly indefinite payment.
  2. IPN sent to server, activating subscription
  3. User cancelled on May 3rd 2012.
  4. IPN sent to server, subscription is cancelled and server cancelled the membership.

However as the user subscribed on May 1st 2012, he still has some days left if he were to cancel before one month. Any way to solve this? Does PayPal sends any IPN for this type of issue?

One solution I thought of is doing a cronjob every night to check if the month is up.

like image 346
ericlee Avatar asked May 18 '12 17:05

ericlee


People also ask

Does Cancelling automatic payments on PayPal work?

Once you've confirmed you want to cancel the payment, PayPal will process its cancellation. It's worth noting that this will usually cancel the subscription you were paying for if you have no other payment method, though it's best to close your account with the subscription too.

Can I cancel a pending payment on PayPal?

You can cancel any kind of PayPal transaction that is still pending. As long as the receiver has not accepted the money you sent, you can cancel the PayPal payment in your Activity menu. However, once the receiver accepts the payment, it will finalize immediately and you will no longer be able to cancel or reverse it.


2 Answers

When we implemented subscription services on our own website, we basically handle the events like this:

  • subscription confirmation - we mark the user's subscription on our server as "automatic renewal"
  • money received - we move the user's subscription expiry date based on the agreed term (monthly or yearly); using trial periods, this event only gets sent when the trial period finishes
  • subscription cancelation - we mark the user's subscription on our server as "manual renewal"
  • money refunded - we move the user's subscription expiry date back based on the agreed term.

Upon user sign in, we check whether the subscription has expired (which is easy if you store that in your db).

Basically, subscription events are separate from payment events. A subscription can be cancelled but that doesn't mean the payment gets refunded; that would be a separate event.

Btw, payment and subscription events can come in different order (e.g. payment can come first, followed by subscription notification); it's important to cater for that.

like image 109
Ja͢ck Avatar answered Oct 20 '22 20:10

Ja͢ck


When user subscribes, paypal will create a recurring payment profile, which means the user will have to pay monthly (yearly, daily depending on the profile) the sum, on the day he subscribed (ex. 1st May, 1st June, 1st July). When the user cancels, he cancels the payment profile, not the payment itself. So after that paypal will not ask for any other payment. If you want to give the user the days, which were left you have to store the information about the subscription.

You can store in a db the day he subscribed and the day he cancelled.From there you can tell how many days the user still has. Paypal sends IPN messages both on the creation of the recurring payment profile, on the payment itself and on the cancel as well.

You can find information on the IPN messages here: https://cms.paypal.com/cms_content/US/en_US/files/developer/IPNGuide.pdf

like image 36
zolipapa Avatar answered Oct 20 '22 20:10

zolipapa