Ankur Lathwal
Ankur Lathwal

Reputation: 725

How to test PayPal free trial subscriptions with IPN?

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.

Upvotes: 0

Views: 857

Answers (2)

Athrun Zara
Athrun Zara

Reputation: 873

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.

enter image description here

Upvotes: -1

user207421
user207421

Reputation: 310985

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.

Upvotes: 1

Related Questions