We are trying to implement Free trials with PayPal subscriptions.
Currently we don't offer any trials, so PayPal sends a transaction notification every month for a particular subscription and we renew the license (basically add 30 more days to it and wait for the next transaction info after 30 days).
Now we are trying to offer 7-day free trials. So my question is, will it work like monthly, without-trial, subscriptions? Will PayPal notify our IPN on the 8th for a monthly payment. If it does, then we add 30 days. Currently we just add 7 days and wait for the monthly payment notification (to keep it in sync with our current logic). We don't handle cancellation notifications, just to make it clear. If the the user cancels on, say, 18th day, he can enjoy the subscription till 30th days. But it won't renew since we won't receive a payment notification to add 30 more days.
I saw a similar question IPN Question, but that doesn't answer our specific problem.
How to test
'How to test' is answered by the PayPal IPN Sandbox.
will it work like monthly, without-trial, subscriptions? Will PayPal notify our IPN on the 8th for a monthly payment.
You will get two messages: subscr_signup and subscr_payment, in either order, as soon as he subscribes, and you will get further subscr_payment messages: at the start of the 2nd trial period if any, and then at each payment. If there are free trial periods, the mc_amount fields in the corresponding subscr_payment messages will be zero. As always, you need to check everything against your own records of what the subscription plan is.
You can actually done that in Recurring Payment with Express Checkout where it describe and explained here.
First you can call SetExpressCheckout and setup as below parameter;
VERSION = 204.0
METHOD = SetExpressCheckout
RETURNURL = http://testingPP.com/index.php?action=ECreturn
CANCELURL = http://testingPP.com/index.php?action=ECcancel
AMT = 0.01
L_BILLINGTYPE0=RecurringPayments
L_BILLINGAGREEMENTDESCRIPTION0=FitnessMembership
Secondly, after the buyer has agree and accept the term, you can then call CreateRecurringProfile API
VERSION = 204.0
METHOD = CreateRecurringPaymentsProfile
TOKEN = EC-4AE27806US9336331
SUBSCRIBERNAME = Global Test Tool
PROFILESTARTDATE = 2018-11-17T00:00:00Z
PROFILEREFERENCE = FitnessMembership
DESC = FitnessMembership
BILLINGPERIOD = Month
BILLINGFREQUENCY = 12
AMT = 10.01
TRIALBILLINGPERIOD = Week
TRIALBILLINGFREQUENCY = 1
TRIALTOTALBILLINGCYCLES = 1
TRIALAMT = 0.00
As you can see, I set the TRIALBILLINGPERIOD to Week which is only happen once but the regular profile will be charged Monthly for every 12 months for 10.01.
Related
I am using the PayPal REST API in the sandbox. I have set a recurring payment from my customer account to my business account yesterday. Everything was successful, the setup fee was charged. The next payment is due today, at 8 am. 3 Hours have now passed and the payment did not go through.
Even if I request the agreement details now, I have "next_billing_date": "2018-11-06T08:00:00Z", (my timezone is GMT, this is not a timezone issue), with "cycles_completed": "0".
I was unable to find mention anywhere of any possible delay. Is there an issue with my setup, or is the time bit of the date just for the sake of being ISO 8601 and the charges happen sometime on the specified day ?
The payment will actually get charged within 24 hours. Had 3 payments with "next_billing_date": "2018-11-06T10:00:00Z" and all came in in a random order at random times throughout the day.
I am using PAYPAL recurring payments for subscriptions and it is working well in case :
When user subscribes then INIT AMT, BILLING AMT, BILLING PERIOD has been set.
$request['CURRENCYCODE'] = ''USD;
$request['AMT'] = $amount;
$request['INITAMT'] = $amount;
$request['BILLINGPERIOD'] = $billingPeriod; // Month
$request['BILLINGFREQUENCY'] = $billingFrequency; // 1
$request['PROFILESTARTDATE'] = date('Y-m-d\Th:m:s', strtotime('+' . $billingFrequency ." ". $billingPeriod));
User would be charged with INIT AMT and then after the specific period (I have set INIT because I need TRANSACTION_ID. Paypal is only deducting the amount after specific period, not instantly on profile creation). But This case is OK.
For eg : User subscribes on on 4th/june with amount $10, with recurring period 'Month'. Then User will be charged on 4th/july
Now concern is :
I want to make a profile of user but not to deduct INIT AMT on profile creation, just want to deduct the recurring billing amount instantly when User creates a profile.
Instance : User subscribe on 4th/june and I want to charge after XX days(eg: if 10 days then on 14th/june).
I am not aware of such variable (if any) that paypal have to fulfill my requirement.
Paypal tigers please update me. Glad if anyone could help.
You can't process an INITAMT as an Authorization so that wouldn't be an easy solution. If you're passing INITAMT it will always be billed right away and you can't have a Recurring Profile charge right away.
The Recurring Profiles are billed in groups during the day so there isn't a guarantee that it will be charged right away.
You can use Instant Payment Notification (IPN) to get an update with the transaction ID when the Profile is charged. That may help you out. You can remove the INITAMT variable and value and wait for the IPN post to update your records.
How can I get the next payment date from the IPN notification from Paypal. Is there a parameter there relevant? I found "next_payment_date" but it's not clear.
Right now, I'm just calculating it myself.
Calculating it yourself is good, because PayPal some times skips sending an IPN. It doesn't happen often, I've done tens of thousands of transactions and I've only seen this less than 5 times.
PayPal should send a subscr_eot when the subscription stops.
If you're on the standard payment, you'll never see next_payment_date
https://www.x.com/developers/paypal/forums/ipn/pdt/nextpaymentdate-will-not-show
Also, if you accept echeques (payments via bank account), the payment won't always happen on that date, some times a week or more afterwards.
I'm working on a site that does non-recurring subscriptions, currently testing it on Paypal Sandbox. Let's say duration is 1 week (t3 = W, p3 = 1). I didn't include src and srt variables in the form. From what little information I have read related to this, a non-recurring subscription counts as a one-off and immediately expires the subscription. I want it to still lapse the duration and subscr_eot be called one week later. The application is run on Java/JSP.
This sounds like it needs to be handled on your side, not on PayPal's.
You receive a payment for your services, and attach an expiration date to that user in your database. He's only allowed to log into your site before his account expires.
So, I now devided the fee into two parts: eg, the one year fee is $10, than I charge $9.95 as the one year trial amount a1, and $0.05 as a non-recurring daily fee (a3) for only one day.
Seems that does it... at least the EOT is not immediately send...
Just have to explain your customers that this awkward payment plan is because of a Paypal peculiarity...
We are using paypal recurring payments programmatically using the Express Checkout APIs.
Based on the docs, it seems that the profile can take up to 24 hours to activate. I'm trying to figure out how to setup the billing start date such that it charges on the day that the profile activates, rather than forcing it to wait up to 24 hours.
Based on the API docs, it seems that I need to pass in the start date at the time of profile creation, which has forced me to do (today + 1 day) to force the 24 hour delay. But then if the profile activates right away and I get an IPN message, i still have to force the customer to wait for that 24 hour period...which doesn't seem very nice.
Although i can do an initamt for an upfront payment, I'm trying to avoid doing it b/c i think that would make me reduce the renewal period (e.g. if it's a 6 month subscription, i would charge 1 month upfront and do a 5 month recurring.), which would be confusing for the consumer.
I'm hoping someone can help me with this.
Docs.
Just wanted to follow-up on this. I spoke with PayPal today to clarify the issue.
They recommended using an initial payment to charge right away and then reducing the subscription term by 1 interval. So if you have a six month payment, then do a 1 month charge immediately, then do a 5 month recurring. Seems sort or ridiculous and partially confusing for the consumer.
They also confirmed that the initial recurring profile step may be delayed up to a day b/c it is run as batches.
Put that together with the fact that the system skips February for end of month payments (they adjust to the first of the month), and you've got yourself a lot of fun times ahead.
Ya it's best to do an initial payment and then subtract one from your interval or put your start interval 1 unit into the future.
Also note that if the initial payment if unable to be charged the API call will fail where as without the initial payment the API call can go through (success response) but when the payment gets charged (up to 24hrs later), it has the chanced to not be successful.
ie. credit card is good so it approves the recurring billing but when it attempts to charge, for some reason it gets rejected.
Make sure you have IPN listeners for recurring_payment_skipped to take account for that.
Simply charge for 6 month instantly and set the recurring payments to start after 6 months from the moment of initial payment.