Paypal recrurring payments - paypal

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.

Related

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.
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.

paypal recurring payment - how to create recurring profile without expresscheckout?

I need to create one agreement with user where user need to pay amount for example "75$" (it will dynamic) . User create recurring profile with one time in the future.
Do you mean the amount of charge will be differ on each cycle? If that is the case, you might need to use Billing Agreement with Reference Transaction.
No specific amount on each charge, no expiry date and also you can charge your buyer in future without having them login to their PayPal account.
Read here.

Paypal recurring extra charges on first time subscribe

I want to add extra charge when user subscribe with recurring button first time,
Work flow is look like :
Like my plan is 10$ per month and registration fee is 5$, so the work flow is when user click on subscription button first time 15$ charge for first month 10$ is monthly fee and 5$ is for registration charge. any one suggest me what i need to do for make this happen??
Thanks :)
Please set the trial amount as the registration fee($5) so that the buyer would be charged $5 once he signs up for the recurring payment and then he would undergo the regular billing pattern of $10.

How do I handle non-recurring Paypal subscriptions? Subscription expires immediately

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...

Get Transactions associated with a Recurring Payment Profile in Paypal

I have gone through nearly all the question related to Recurring Payment using Paypal and have not found a solution to my problem.
We are implementing a system that is subscription based on a monthly basis (fixed amount). We do not want to store CC details for security reasons, hence we are trying to use Website Payments Pro from Paypal.
Once a user agrees to recurring payments, we are creating a RecurringPaymentProfile for that user and are storing the returned Profile_Id for the user.
Now we need to get information about all the transactions related to this Recurring Profile_Id. This information is available when we login to the Paypal account but this needs to be automated so that the application is aware of all the payments and also of the current subscription of the user.
We have found two methods (possibly) to implement this.
1. IPN (Instant Payment Notification, for this we will have to create a service to listen to notifications, which seems to be cumbersome and is more informational than we require)
2. TransactionSearch (but this returns transactions for the Paypal account and not Profile_Id)
Since we just want to know the transaction history associated with the Recurring Profile and whether this months payment was successful (implying the user is active member), what is the best method to implement this ?
Thanks,
You're looking for the GetRecurringPaymentsProfileDetails API Operation. This operation will allow you to view a majority of the details associated with a recurring payment profile using a valid PROFILEID.
Relevant detail fields you may be interested in:
LASTPAYMENTDATE
The date of the last successful payment received for
this profile, in YYYY-MM-DD format.
LASTPAYMENTAMT
The amount of the last successful payment received for this profile.
FAILEDPAYMENTCOUNT
The total number of failed billing cycles for this profile.
NEXTBILLINGDATE
The next scheduled billing date, in YYYY-MM-DD format.
NUMCYCYLESCOMPLETED
The number of billing cycles completed in the
current active subscription period. A billing cycle is considered
completed when payment is collected or after retry attempts to collect
payment for the current billing cycle have failed.