Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for recurring payments #20

Open
4 tasks
codeinthehole opened this issue Apr 18, 2013 · 10 comments
Open
4 tasks

Add support for recurring payments #20

codeinthehole opened this issue Apr 18, 2013 · 10 comments

Comments

@codeinthehole
Copy link
Contributor

In PayPal Express, you can create recurring billing profiles, which is something we should support.

Tasks:

  • Extend the SetExpressCheckout call to allow recurring billing params
  • Create a gateway function for CreateRecurringPaymentsProfile
  • Create a gateway function for SetCustomerBillingAgreement.
  • Create a gateway function for ManageRecurringPaymentsProfileStatus
@eukreign
Copy link

Is there any updates on this feature? I'm trying to determine if I should try to implement it myself or wait for the official version.

@codeinthehole
Copy link
Contributor Author

I haven't really done any work on it other than a simple POC commit:
e239980

Someone else from Tangent is definitely working on this at the moment though as we have a client who needs subscription products that require recurring payments. However, I'm not sure how long it would take for that work to make it into this extension. @a-musing-moose - can you offer any further advice?

So my advice would probably be to fork the extension and implement the recurring logic yourself (so you're not waiting for us). I'd happily review your work and merge it if you submit a PR afterwards.

@a-musing-moose
Copy link

@eukreign As @codeinthehole says I have been working on a little on this over the past few days. I have a very basic working branch now: a-musing-moose@ad54d26

There are no real test or documentation for it yet I'm afraid and some pretty limiting restrictions.

What is does allow:

  • The creation of a single recurring payment for an item
  • An extensible method for determining if a product should have a recurring payment

Restrictions:

  • Your basket must contain a single item, with a quantity of 1. Nothing else.

The way paypal recurring payments work (at least in express checkout) is that a separate recurring payment needs to be set up for each product purchased. This is somewhat different to how normal payments are constructed. You also need to call CreateRecurringPaymentProfile for each of these payments. You also need to perform a DoExpressCheckoutPayment if there are any normal payments in the basket as well. i.e. you end up with multiple transactions at the end of the process.

So full support is a fairly complex proposal. For the project I am currently working on, and the time frame I have, this is not possible. Hence compromising on a limited implementation.

Within the project that is using the recurring payments I am extending the basket app to include additional logic. Namely, that whenever a product with a recurring profile is added to the basket. That basket is first cleared so that the recurring product is the only one in it. I am also added logic to only allow a quantity of 1.

If you are still interested in using the modification I have made thus far then I should also explain the PAYPAL_RECURRING_PREDICATE settings. This is the method by which we determine if a product has a recurring profile. It specifies the full path to a function. e.g.:

PAYPAL_RECURRING_PREDICATE = 'myapp.mymodule.get_recurring_profile'

This function is passed a product and returns either None if the product does not have a recurring profile. Or a dictionary in the following form for one that does:

{
    'billing_description': 'a description - $10 per month',
    'billing_frequency': 1,
    'billing_period': 'Month',
}  

Since you do not pass the actual amount to paypal until the CreateRecurringPaymentProfile call right at the end. It is recommended that the billing description contains not only the product description but all the cost, and recurring profile.

billing_period can be 'Day', 'Week', 'Month', 'SemiMonth', 'Year' and billing_frequency is an integer value. So the above example is every 1 month.

There is one additional part I have yet to implement. Which is IPN support. Instant Payment Notifications are sent out for recurring payments. One for the initial set and then one for every successful payment after that, or if the customer cancels the payment. That I'm afraid is still an exercise for the user.

Hit me up if you have any further question. Either here or on the mailing list.

@eukreign
Copy link

You guys are awesome, thank you for the explanation.

I am using PayPal Payments Advanced which requires tokens and CC input being hosted by them.

I'll make pull requests if I'm able to generalize my implementation.

One problem I've found with the hosted pages and tokens is that they do not support creating Recurring transactions.

I found a stackoverflow post which explains the problem and provides a possible solution: http://stackoverflow.com/questions/13629023/secure-tokens-for-paypal-recurring-payments

I will try to see if that solution could be generalized.

@SalahAdDin
Copy link

What happen with this?

@DanSmall
Copy link

Can I also ask if there are there any plans to implement this?

@nhondong
Copy link

Any updates on this Issue?

@SalahAdDin
Copy link

I guess it died.

Any updates on this Issue?

@pije76
Copy link

pije76 commented Sep 23, 2021

Please someone add subscription modul for oscar.

@j2l
Copy link

j2l commented Jan 17, 2024

Meanwhile, 11y, waiting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants