Paypal charge via recrurring payment? - php

In my online store i'm going to manage subscription for the products. Every product can be subscribed for some period of time, weekly, biweekly, monthly, semiannually. I'm going to use PayPal PayFlow Pro and PayPal Website Payments Pro gateways to recieve payments.
The issue is here how to manage getting recurring payments through this payment gateways? Any php code or smth else?
Here I'm including how this process works:
1. Customer adds reqiored products in his shopping cart.
2. In the cart there is a selectbox per every product for subscription.(options: just this one time, dayly, weekly...)
3. Customer checks out from the site paying with Credit/Debit card or PayPal account.
Question: How to charge automatically charge the fee for subscription in the selected period?

Why would you use Website Payments Pro and Payflow Pro? They're essentially the same (although Payflow Pro requires you to sign up for a merchant account, whereas Website Payments Pro doesn't).
What you need to do is:
Sign up for PayPal Website Payments Pro (US, UK and Canada only).
Once approved, sign up for Direct Recurring Payments
Once approved, start integrating with PayPal via the DoDirectPayment API (one-off payments) and CreateRecurringPaymentsProfile (recurring payments).
DoDirectPayments lets you add in card details via the CREDITCARDTYPE, ACCT, EXPDATE and CVV2 parameters. This lets you charge buyers for one-off payments.
If you wish to set up recurring payments, you would use the CreateRecurringPaymentsProfile API instead.
This also lets you specify card details as detailed above, but in addition will let you specify terms for a recurring term on which the payment must recur.
For example; an example API call for CreateRecurringPaymentsProfile would look as follows:
USER=Your API username
PWD=Your API password
SIGNATURE=Your API signature
VERSION=84.0
METHOD=CreateRecurringPaymentsProfile
DESC=Monthly recurring payment for MyStore Ltd
BILLINGPERIOD=Month
BILLINGFREQUENCY=12
TOTALBILLINGCYCLES=0
AMT=9.99
TRIALBILLINGPERIOD=Day
TRIALBILLINGFREQUENCY=7
TRIALTOTALBILLINGCYCLES=1
TRIALAMT=0.99
CURRENCYCODE=GBP
CREDITCARDTYPE=Visa
ACCT=4556699176680030
EXPDATE=122012
CVV2=000
EMAIL=buyer#buyeremail.tld
STREET=12 Street
CITY=Beverly Hills
STATE=CA
ZIP=90210
COUNTRYCODE=US
This will set up a recurring payment profile which PayPal will bill for 9.99 GBP monthly, with a 7 day trial period of 0.99 GBP and run indefinitely. Once the API call is run, it will return a PROFILEID in response and the buyer will be charged 0.99 GBP. He will be charged 9.99 GBP after 7 days.
You must store this PROFILEID on your end, as this is the unique identifier which refers to this profile.
If you wish to test CreateRecurringPaymentsProfile, sign up at https://developer.paypal.com/ and create a preconfigured US, Website Payments Pro test account, and ask PayPal MTS over at https://www.paypal.com/mts to activate CreateRecurringPaymentsProfile for your test account (be sure to include the API username, but not any other API credentials).

Related

Is it possible to make Paypal payment after 29 days of of capturing buyer credentials

My requirement is Buyer will authorize payment through credit card or express checkout via Paypal. Initially balance will not get deducted. after 29 days balance automatically deducted if he not canceled the transaction.
I have Two payment option one is Paypal express checkout and another is Paypal pro credit card processing.
Currently Instant payment using both payment options is working fine in my system. I just want to delay the payment for 30 days. Please someone help me if it is possible.
You need to use this - Billing plans

Paypal standard or Payments Pro

I'm currently using the standard cart function from paypal (using my own PHP to configure the data and price details) to create a shopping cart for services (based off this post: How to send multiple items to PayPal).
However, I need to show the full item price and the deposit amount, and only charge the user the deposit amount. Currently, I have the Deposit Amount set as the Item Price, but I think that will be confusing to users since it doesn't show the full item price. I need to show both the Item Price as the full amount of the product, and then have another label for Deposit Amount that is used as the amount that is charged.
For example, this is what I need to show:
**Service 1**
Item Price: $500
Deposit Amount: $200
___
**Amount Due Now: $200**
Balance Remaining: $300
___
I haven't seen a way to do this using the standard cart function, and was wondering if it's possible to customize these type of variables using Payments Pro.
You can use PayPal Payments Pro or Express Checkout.
Express Checkout allows you to set the call (from the PayPal Developer Documentation)
Call SetExpressCheckout to set up the transaction and define the URL to which the customer is returned after the customer authorizes payment.
Redirect the customer to PayPal for authorization of the payment.
Call GetExpressCheckoutDetails to obtain customer information, e.g. for customer review before payment. (returns to your website, and send the payment details to your cart)
Call DoExpressCheckoutPayment to complete the transaction.
In the return page you can present the final payment amount to the buyer, which will allow you to charge the deposit amount.
Here is the getting started Guide for Express Checkout, which has a complete picture of the typical Express Checkout Flow
Express Checkout Getting Started
You can use the Code Wizard to generate Express Checkout Code.
Integration Wizard
Express checkout also allows for recurring payments if you need to charge someone a deposit now, and then the rest of the payment at a later date. Here is the integration guide for Express Checkout Recurring Payments
Express Checkout Recurring Payments Developer Guide
If you would prefer to use PayPal Payments Pro Payflow edition you can create a custom cart that keeps your buyer's on your website and allows you to charge the card the deposit amount. PayPal Payments Pro Payflow Edition does have recurring payments as an option as well.
Here is the getting started overview for Payflow Pro
Payflow Pro Getting Started Overview
Here is the Payflow Pro Developer Guide

Payment systems with paypal with pre authorisation and incremental use of credit

I am developing a commerce app with php/mysql. My boss wants this:
user can buy "ad credits" on our website and he wants this to be a paypal pre authorisation
then the user can use ad bundles with various costs
this costs are taken from the ad credits and he wants this to be the actual decrement of user credits in paypal
Example: John buys an ad credits pack of 30$. He pre authorises this trasaction with his paypal account. Then he buys two banner spaces for the cost of 10$. So 10$ are taken from his paypal.
Is this possible? Paypal APIs?
There are a couple of ways you could handle this.
1) You could use Express Checkout to setup a billing agreement with the buyer and then use DoReferenceTransaction to process future payments using that billing agreement.
You can do the same thing with Payments Pro, too. In your original request you would just run an Authorization of 1.00 and then immediately void that authorization. You could then use that transaction ID you get back from the authorization to process future payments with DoReferenceTransaction.
2) You could setup a Preapproval Profile with the buyer using the Preapproval API. You would then use the Pay API to process payments in the future using the preapproval key you got back from that Preapproval API. This is all explained in detail in the Adaptive Payments documentation.

Several questions about paypal pro subscriptions flow

I have integrated standard paypal with one of sites and it works as follows: user selects which subscription to buy, he is redirected to paypal, paypal sends IPN response, I process it and then every X days PayPal sends a new IPN notifying site that user has been successfully charged for new subscription iteration. Now the problem is that user needs to have paypal account to sign up for such subscription.
The customer contacted PayPal and found out that it is possible to avoid having user to use their PayPal account to buy subscription when seller uses paypal pro account. Is it really so? Will I be able to gather user's card info, then send some request to PayPal API and have the subscription created. If yes, what will happen next? PayPal will be sending me IPN requests every X days notifying site that the card has been successfully charged?
Also, what is the general flow? Do I always have to gather card info and send it to paypal api or can I redirect user to paypal in a similar way as standard paypal functions?
Yes, this is possible. You would need to sign up for PayPal Website Payments Pro and Direct Payment Recurring Payments. You can then use the CreateRecurringPaymentsProfile API and specify the card details directly in a single API call.
This will create a recurring profile, which is billed every X days / months, depending on what you specified as the billing period in CreateRecurringPaymentsProfile.
Alternatively, you can also sign up for PayPal Premium Services (for the UK) or PayPal Enhanced Recurring Payments (for the US). This allows you to accept subscription payments from guest users, using the exact same integration you have at the moment, except a 'guest payment' section will be added to the PayPal checkout screen, so buyers won't be forced to create a PayPal account to sign up for your subscriptions any longer.
(Note: Enhanced Recurring Payments / Premium Services has other benefits as well, such as Installment Plans, but guest subscription payments is definitely the biggest benefit).

Braintree subscription for recurring payments

Let a customer has subscribed for a product for $10 monthly and his starting date is 11-May-2011 which ends on 10-June-2011, So my question was that after expiry of subscription on 11-June-2011 who will charge for recurring payment from customer. Braintree will charge the customer or we (merchant) have to send a request for that to Braintree.
If merchant have to charge then what is the process and it would be great if someone provides PHP code sample.
You can set up a subscription in Braintree which will charge your customers monthly. You need to set up the subscription plan manually (such as $10 per month) in your braintree admin control panel, but you use the API to sign up customers to the subscription plan you created, and do not need to have your app remind braintree to bill each month.
The Braintree API docs to setup subscriptions in PHP are at the following link:
http://www.braintreepayments.com/docs/php/subscriptions/overview

Categories