Custom recurring payment plugin

  • Daniel Duvald
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #130078 by Daniel Duvald
Custom recurring payment plugin was created by Daniel Duvald
Hi

I'm developing a custom payment plugin, based on the paypal plugin. The plugin still has the paypal code for recurring payments, but it's not registering as a payment plugin that supports recurring payments.

I've looked at your code on Github github.com/joomdonation/os_osm_redirect but it's has nothing about recurring payments.

Can you please tell me how I can support recurring payments with my custom payment gateway?
Is the current paypal recurring payment support not part of the plugin, but the component itself?

Thanks

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130081 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom recurring payment plugin
Hello Daniel

1. Currently, the value to indicate a payment plugin supports recurring payment is hardcoded in database. You will need to look at at #__osmembership_plugins table, find the record associated to that new plugin, change support_recurring_subscription field to 1 and the payment plugin will be ready for recurring payment

2. The next step is implement processRecurringPayment method inside the payment plugin to register the recurring payment with the payment gateway

Please go with these steps and let me know if you need more assist

Tuan

Please Log in or Create an account to join the conversation.

  • Daniel Duvald
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #130083 by Daniel Duvald
Replied by Daniel Duvald on topic Custom recurring payment plugin
Thank you - just the pointer I needed :-)

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130084 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom recurring payment plugin
Great. Good luck with the development

Tuan

Please Log in or Create an account to join the conversation.

  • Daniel Duvald
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago - 4 years 4 months ago #130105 by Daniel Duvald
Replied by Daniel Duvald on topic Custom recurring payment plugin
One question: Do I need a specific parameter in the gateway response, to call the verifyRecurringPayment function?

When testing a recurring subscription, this function doesn't seem to be called, so I think I'm missing something... ?

Thanks.

EDIT: Figured it out - had a wrong parameter in the callback url :-)
Last edit: 4 years 4 months ago by Daniel Duvald.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130117 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom recurring payment plugin
OK Daniel. I'm glad you figured it out

Tuan

Please Log in or Create an account to join the conversation.

  • Daniel Duvald
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #130194 by Daniel Duvald
Replied by Daniel Duvald on topic Custom recurring payment plugin
What function is called when a recurring subscription needs to be renewed and a payment request sent to the gateway?

Thanks

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130212 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom recurring payment plugin
When a recurring payment happens:

- The payment gateway will need to send a request to domain.com/index.php?option=com_osmember...ent_method=os_paypal

(replaces domain.com/ with your site domain and os_paypal with the name of the payment plugin)

- The payment plugin needs to implement verifyRecurringPayment method to handle it

You can look at the code in os_paypal payment plugin to understand the logic and handle the necessary change

Tuan

Please Log in or Create an account to join the conversation.

  • Daniel Duvald
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 4 months ago #130221 by Daniel Duvald
Replied by Daniel Duvald on topic Custom recurring payment plugin
It doesn't work like that, at least for danish payment gateways. When the first payment is made, a subscription id is sent from the gateway and stored in membership pro.

Now, whenever a recurring subscription has to be made, the website need to call the gateway with subscription id, amount etc.

So for any recurring payment, it's the website that takes first action and calls the gateway.

In other words, I'm looking for a function that is called by Membership Pro, when a payment is due, that I can implement in the plugin. Does it exist?

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #130222 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom recurring payment plugin
No, it does not exist. In all of payment gateways which support recurring payment, the payment plugin just registers the recurring payment with the payment gateway

Then the payment gateway process payment (for example, every month). Each time the payment gateway process payment, it will notify Membership Pro about the payment and then membership pro has to validate that payment, extends the recurring payment....

Tuan

Please Log in or Create an account to join the conversation.