How to make paypal auto charge my customer on a pay per use pricing plan?

nimc
Contributor
Contributor

My web has a pricing of pay-per-use. Let's say my web process a file for example resizing image. When my customer sign up they get 100 coins for free. Each time my customer resize image and sell it it will cost 1 coin. but all of this happens automatically after someone purchases image.

My question is I would like to charge them automatically for example after the coins of my customer drop below 10 then charge automatically 15 coins ($15) --- $1 per coin (My customer should be able to choose how much coins he/she wants to recharge) I'm not sure but I think paypal doesn't provide this feature to new customer anymore?

https://developer.paypal.com/api/nvp-soap/paypal-payments-pro/integration-guide/reference-transactio...

What choices do I have? I really need this auto recharge feature.

Login to Me Too
1 REPLY 1

angelleye
Advisor
Advisor

The simple answer of what you need is "reference transactions".  This allows you to trigger a payment of any amount at any time on behalf of your buyer.  Unfortunately, how exactly you do this has a lot of variables.

 

If you're using PayPal Pro then RT's come with it by default.  You could use the DoReferenceTransaction API to create those payments, and your system would trigger that call when necessary to top-up an account's coins.

 

If you're using Classic Express Checkout then you need to have a Billing Agreement approved for the buyer in order to process future RT's.  This requires extra approval by PayPal to get enabled on your account before you can do it.  You would tie the CreateBillingAgreement call into your Express Checkout flow in order to obtain a Billing Agreement ID for the buyer.  This is the value you would then pass into DoReferenceTransaction for the future payments.  This can be difficult to get approved, but I have a guide here you can follow for specific steps to (hopefully) get it enabled.

 

All of that said, PayPal Pro and Classic Express have been replaced by the new PayPal Complete Payments stack.  It would be recommend to use this going forward, especially if you're starting with a fresh integration and you don't already have Pro and/or Classic EC in place.

 

When using the new API's you'll add the Vault to your transactions, and this is what creates the billing agreement.  Again, you'll need to get this approved at your App level for this to work, and then you would add the `vault` paraemter to your payment request to create the agreement as shown in the SDK docs.

 

So you would create your app at developer.paypal.com, request the Vault approval for your app, and then use the vault to create billing agreements for your buyers so you can process the reference transactions in the future.

 

Hope that helps!

 

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.