Stripe's "cancel_at_period_end" equivalent in paypal? - paypal

I implement a subscription site in which the subscriptions plans are monthly.
I use IPN to handle subscription events.
Now, If a recurring payment failed, I will get the relevant event and will cancel the subscription in my side.
But, what should I do when a user cancels his subscription via my site, and he still has time left in his subscription, and I want to cancel the subscription only in the end of the subscription period?
What can I do if the user cancels his subscription via PayPal and still has time left in his subscription?
In stripe you simply set "cancel_at_period_end=true" and then it's the same scenario.

There is no equivalent, PayPal doesn't keep track of anything for you. You'll receive cancel events whenever a profile is cancelled.
If you want to keep track of paid-through periods, that logic is up to you.

Related

Paypal Webhook is created sufficient to imply activated

Paypal with active webhooks. We use a subscription plan.
When a customer
subscribes to the subscription plan PayPal's webhook sends us a BILLING.SUBSCRIPTION.CREATED. 

We do not get a BILLING.SUBSCRIPTION.ACTIVATED. Can I expect it being activated when it is
created or do I need to double check that?
(Side note, when trying to send an api request to activate it, an error message informs me that the subscription plan is not “suspended”. So that looks like it is already activated. Logging into PayPal also confirms it is activated.)

The documentation on it is a little vague.
Created means the user clicked the button to subscribe. It does not mean they entered any payment details, or finished subscribing.
If you are not receiving a BILLING.SUBSCRIPTION.ACTIVATED event but the subscription is active, perhaps you did not subscribe to that event?
In any case, the most useful event to listen for is PAYMENT.SALE.COMPLETED. This will occur for the first payment as well as every future payment on the schedule. You can build all your business logic with only PAYMENT.SALE.COMPLETED , using every receipt of this event to mark how long the subscription is valid for in your system (e.g. 1 month from receipt)

After the trial period which PayPal webhook event is fired?

I have implemented Paypal subscription with a seven-day free trial, then the payment is captured if the user did not cancel his subscription. which webhook event is fired in the normal case (payment done after trial period)?
All Subscription payments will result in the event PAYMENT.SALE.COMPLETED the moment the transaction completes.
Other than BILLING.SUBSCRIPTION.ACTIVATED for the case of trials starting without a payment, you can build all subscription logic based on listening for just PAYMENT.SALE.COMPLETED and making a note of when you expect the next one. Other billing subscription events aren't necessary nor useful to track.

PayPal Subscriptions - Tracking Refund

I'm not a developer, but a project manager. So please excuse my lack of proper language.
We are trying to figure out how to handle subscription refunds and then limit account access on the site.
Here's a scenario. Member signs up for an annual subscription to gain certain capabilities in the account. 3 months into it member decides to cancel and requests a refund. Normally, if no refund is issued, subscription is good until the end of the billing period, at which point account is deactivated.
In our case, if a refund is issued, account should be deactivated immediately. Question: is it possible to set this up as part of PayPal Subscriptions? Some type of call from PayPal to our system that will trigger account deactivation.
Thank you.
We recommend using IPN (Instant Payment Notifications) to be asynchronously notified of any events, in this case of those related to existing subscription/recurring payments.
https://developer.paypal.com/webapps/developer/docs/classic/ipn/gs_IPN/
If you enable IPN notifications you will receive a POST of PayPal in the following events (among others):
When a recurring profile is cancelled.
When a refund has been made to a previous completed transaction.
This way, you can set up your IPN script to keep the subscription “open” in your side for the remainder of the month even if the profile has been cancelled, or to deactivate it if the last month has been refunded.
For more information about IPN variables:
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/

Paypal subscription button. upgrade subscription amount

I am using paypal subscription button. if there is any method so that if user want to update his/her subscription amount after some time how could this achieve.
And how user can cancel his/her subscription ?
You can use a modify button to update the subscription. If want to cancel the subscription, you as the merchatn can cancel this or the buyer can cancel this as well. You can find more on using the modify and cancel features for subscriptions here. If your subsriptions start with I- instead of S-, you can also use the ManageRecurringPaymentsProfileStatus API to cancel the subscription as well.

How to Handle Cancelled Recurring Payments

I'm using Paypal to handle automated recurring payments for my website. Users pay to subscribe to my website so they can get periodic newsletters.
So let's say a customer cancels their membership a few months later. They do this by logging into Paypal and cancels future automated payments. How should I update my website to reflect this cancellation?
The first solution I'm thinking of is to schedule a cronjob that executes a script every midnight to update my database with information from Paypal.
The second solution is on newsletter mailout day, I execute a script to update my database with information from Paypal. The website will also execute the script every time a user "logs in" to my website.
Are there better ways to do this?
If I understand correctly, Paypal's servers will update yours automatically when the status of a subscription changes, if you have this configured. This is called IPN (Instant Payment Notification) and does indeed include cancellation notification. Here's the Paypal documentation for recurring (subscription) payments. Additionally you can poll their servers using their API for this information, so if you'd prefer to fetch it yourself, you can.