For monthly recurring payments, how long is a month defined to be? I need to be able to independently track subscription end dates on my web service and I'd like to be consistent with PayPal.
As said on PayPal's documentation:
How Subscriptions with Monthly Billing Cycles Work
For monthly billing cycles, recurring payments are collected on the
same day of the month. If the initial recurring payment falls on the
31st, PayPal eventually adjusts the billing cycle to the 1st of the
month. If the initial recurring payment falls on the 29th or 30th,
PayPal adjusts the billing cycle to the 1st of the month on the
following February.
When Monthly Recurring Payments Are Due and Collected on the 31st
The subscription terms are:
$25.99 USD a month; the subscriber signs up on Thursday, July 31. The
subscriber is billed as follows:
Thursday, July 31 = $25.99 USD Saturday, August 31 = $25.99 USD
Wednesday, October 1= $25.99 USD Saturday, November 1= $25.99 USD and
so on... Notice that no recurring monthly payment was collected in
September, but recurring payments were collected roughly every 30
days.
When Monthly Recurring Payments Are Due and Collected on the 30th
The subscription terms are:
$25.99 USD a month; the subscriber signs up on Tuesday, December 30.
The subscriber is billed as follows:
Tuesday, December 30 = $25.99 USD Friday, January 30 = $25.99 USD
Sunday, March 1= $25.99 USD Wednesday, April 1= $25.99USD and so on...
Notice that no recurring monthly payment was collected in February,
but recurring payments were collected roughly every 30 days.
Read more at https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/subscribe_buttons/
Related
Upon cancel, I want to know how much time is left on the subscription's current billing cycle.
This question -- paypal-ipn-get-subscription-end-date-recurring got answered with a scenario where, upon the end of the cancellation period, a paypal event is sent at the end date. In my case, however, I want to know in advanced how much time is remaining and record a future date (like a credit) and allow the user to use that up that time or give them an advance on their signing up again with another payment method (delay their next bill for example).
There is a final_payment_date under the deprecated billing agreements API: https://developer.paypal.com/docs/api/payments.billing-agreements/v1/ .. They say to use the subscription's API, but there is no end date available. It is possible to use the subscription API to set things up and still use this API.
Unfortunately, because I don't see a non-deprecated end-date anywhere I think I may need to dive into the implementation here:
https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/subscription-billing-cycles/?mark=cycle#
Paypal's Monthly example from the link above. "[...] signs up on Tuesday, December 30, the subscriber is billed as follows:"
Tuesday, December 30 = $25.99 USD
Friday, January 30 = $25.99 USD
Sunday, March 1= $25.99 USD
Wednesday, April 1= $25.99USD
I'm close, instead of ending up on March 1st, I end up on March 2nd:
> d=new Date('2017-12-30')
2017-12-30T00:00:00.000Z
> d.setMonth(d.getMonth() + 1); d
2018-01-30T00:00:00.000Z
> d.setMonth(d.getMonth() + 1); d
2018-03-02T00:00:00.000Z
> d.setMonth(d.getMonth() + 1); d
2018-04-02T00:00:00.000Z
In any event, looks like I need to save the subscription's first billing time and as long as the plan is still active and current on payments, I'll have to calculate when their next bill will be.
BILLING.SUBSCRIPTION.CREATED (webhook received)
Status ACTIVE resource id I-79CLVAS5XM95
As a point of reference, the BILLING.SUBSCRIPTION.CREATED create_time is 2020-06-05T19:45:08.868Z.
Save resource.id = I-79CLVAS5XM95
Also save a date here, will use it to calculate the billing cycle
resource.billing_info.next_billing_time = 2020-06-05T19:35:10Z
Or resource.start_time = 2020-06-05T07:00:00Z ?
Lookup resource.plan_id => https://api.sandbox.paypal.com/v1/billing/plans/P-1BC0896985601515LL3FNLCQ
Get billing_cycles.frequency.interval_unit = DAY|WEEK|MONTH and interval_count. For example, if the interval_unit is DAY with an interval_count of 2, the subscription is billed once every two days.
plan.billing_cycles
[{
pricing_scheme: {
version: 1,
fixed_price: { currency_code: 'USD', value: '0.01' },
create_time: '2020-05-24T20:14:02Z',
update_time: '2020-05-24T20:14:02Z'
},
frequency: { interval_unit: 'DAY', interval_count: 1 },
tenure_type: 'REGULAR',
sequence: 1,
total_cycles: 0
}]
This question -- paypal-ipn-get-subscription-end-date-recurring got answered with a scenario where, upon the end of the cancellation period, a paypal event is sent at the end date. In my case, however, I want to know in advanced how much time is remaining and record a future date
To know in advance, use resource.billing_info.next_billing_time, not the resource.start_time (checkout time)
The example you quoted above:
Tuesday, December 30 = $25.99 USD
Friday, January 30 = $25.99 USD
Sunday, March 1= $25.99 USD
Wednesday, April 1= $25.99USD
Is due to February's shortness. February doesn't have a 30th to charge on, so PayPal opts to push the subscription forward to March 1 to keep everything roughly 30 days apart. This is explained in the documentation you linked to.
If the start date is set to the 29th, 30th, or 31st, and the PAYPERIOD is set to MONT (monthly), what happens on (for example) Jan 31st? Is the next billing period set to Feb 28th (or 29th on a leap year)? Should I just bump all recurring payments starting on those 3 days to the 1st of the next month?
Paypal is returning this:
[next_payment_date] => 03:00:00 Mar 14, 2014 PDT
and this
[time_created] => 10:47:34 Mar 14, 2014 PDT.
The billing cycle is set to a month, why is Paypal returning the same date for the next_payment_date? It should be on April. Where could the problem be?
And have the first payment been taken ? When you create new profile first payment is set on the same day as start date is set. Mext month you should get when you will receive first recurring payment notification.
I want to implement recurring payment in PayPal with variable amount. I successfully implement recurring payment with constant amount. But i don't know how to implement the recurring payment with variable amount,
Very typical scenario would be Telephone Bill amount deduction by the service providers.
If my September month bill contains Rental : 20 Euros, usage : 15 Euros, then the deduction would be 35 euros
Next if my October month bill contains Rental : 20 Euros , usage : 25 Euros, then the deduction would be 45 Euros.
Next if my November month bill contains Rental : 20 Euros , usage : 50 Euros, then the deduction would be 70 Euros.
Considering the above scenarios, please advise how to handle it from both the sides..
Thanks in advance..
Riyaz
You might have to simply automate the PayPal payment from your end,
not automatically from PayPal's end. You can't have a subscription
that varies in price, so you'll have to do a single charge every
month, with the amount you specify. (As far as I know)
That also means that you'll have to manage the subscriptions on your
end (pretty easily doable), and there will be no way for the user to
un-subscribe from the PayPal side.
I got confused about some issues:
1: The one month duration of auto-renewable subscriptions is 30 days or does it depend on a natural month?
Because I can only test in sandbox mode,so the duration is just several minutes...
Maybe Apple just simply calculates it like this: 2013\01\15 -> 2013\02\15 -> 2013\03\15. If so,the second issue comes up
2: For example: I buy a monthly auto-renewable subscriptions at 2013\03\31 ,because 2013\04 only has 30 days, then what is the expires_date of my subscriptions? 2013\04\30 or 2013\05\01 or other date ?
It's adding 1 month, not 30 days. The number of days in 1 month varies. So purchasing a subscription on 3/31 would end on 4/30.
You can use NSDate, NSCalendar, and NSDateComponents to add a month to a date and see how long it will last. More info here: Modifying NSDate to represent 1 month from today
I can confirm this from my own app's data on both iOS and Android.
If someone purchases a monthly renewing subscription on, for example, the 15th of one month, then it will renew on the 15th of the next month, irrespective of how many days were in the month.
If someone purchases the subscription on the 31st of March, then it will renew on May 1st (because April has no 31st day, the renewal date will jump to the next available day in the calendar year - this also applies to February in a leap year, etc).
Given this, and assuming your app's primary income is from subscriptions, over time you should expect to see lower than average sales on the 31st of any given month because there won't be as many renewals. But it is no cause for concern as it is counteracted by the fact that you should expect to see higher than average sales on the 1st of any month that follows a long month anyway. Don't be dissapointed if you check your stats on the 31st of any month.