Paypal recurring payment with billing renewal cycle

I am using laravel 4.2

. I am working on a project that provides video services. The requirement is to integrate the payment gateway PayPal

with recurring profile

.

Although I have worked hard to create recurring profile

with help PayPal classical API

, I almost achieved my goal. But I am unfortunately not aware that you cannot update the billing cycle dates in an already created recurring profile .

Now I feel helpless.

I have a project that provides video services to users. The basic idea is that when registering, the user selects a subscription plan and inserts credit card

information. Since this is a monthly subscription, payment must be made auto-renewed

every month.

In between, at some point, if the user has upgrades

a higher plan, then he will be charged

for the difference

new subscription amount and the current active subscription amount for the current month, and his billing cycle should be updated from today to next month.

For example, there are three types of subscription plans, as shown below:

Basic for $10/month, 
Economy  for $20/month and 
Premium for $30/month

      

If the user is subscribed to basic plan

on 1st May

for $10

, it billing cycle

will be set out 1st May to 1st June

and so on. Every month he will be charged for $ 10 automatically until he unsubscribes or stops repeating his profile.

Now in between 5th May

, it updates its plan to Economy (which provides more videos) with actual amount of $20

, it will charged for difference = $20-$10 = $10 for current month

(i.e. May

), its billing cycle

installed from 5th May to 5th June

now and it will charged $20 each month from 5th June automatically

.

The user should also be asked to insert credit card

information only once

when subscribing for the first time, after which, for any update or repetition, he should be not

asked to insert a credit card.

All these processes should only be done on my website, the user should not be redirected to the PayPal site.

Does anyone know how to achieve this?

+3


source to share


2 answers


Two parts of this: Paypal and billing logic.

Paypal allows users to pre-authorize companies to deduct arbitrary amounts from PayPal. Blizzard and MyUS.com are two examples of this. Users authorize once per $ 0.00, then sites can use that same authorization to charge any amount - look at using that instead. I'm not sure if the feature is off my head.

EDIT: It's called billing agreements (/ reference transactions).

In terms of billing logic, when you update a custom average cycle, do not change the cycle dates. If they sign up on January 1st, keep filling them out the first time in a month. Instead, if the user is updating, do this:

  • Update your billing profile on your site to charge a higher amount in the next billing cycle.
  • Immediately charge the user with a pro-rating to make up the difference.


In your example: I subscribe on May 1, 2015 for a service that costs $ 10 per month. May 5, 4 days in my subscription, I decided to upgrade to $ 20 per month. So now you are doing these 2 things. Set my profile to deduct $ 20 on June 1st 2015, then calculate the numbered amount to update:

There are 26 days left in this billing cycle, which is 83.8% of the cycle. Pay me $ 8.38 ($ 10 diff * 0.838) now to take full advantage of the next price level. If I update later this month, say on the 15th, I would be 50% in the loop. If I were to upgrade to 30th, there would be 1 day (3.2%) in the billing cycle and the pro rating would be $ 0.32.

If I went down again on February 5th, the opposite would be true. Modify my billing profile to credit me $ 10 on March 1st, then design a pro-rated discount. I was 4 days in a 28 day cycle, so I need to refund for the remainder of the cycle (24 days), which is 85.7%, so I immediately get a $ 8.57 credit to my account and only charged $ 1. 43 March 1.

If I had waited until Feb 27 to drop to $ 10 a month, there would be only 3.5% of the remaining cycle left and I would only get a $ 0.35 credit applied to my account.

+2


source


If I went down again on February 5th, the opposite would be true. Modify my billing profile to credit me $ 10 on March 1st, then design a pro-rated discount. I was 4 days in a 28 day cycle, so I need to refund for the remainder of the cycle (24 days), which is 85.7%, so I immediately get a $ 8.57 credit to my account and only charged $ 1. 43 March 1.



If I had waited until Feb 27 to drop to $ 10 a month, there would be only 3.5% of the remaining cycle left and I would only get a $ 0.35 credit applied to my account.

0


source







All Articles