By Artem Lebsak on Sunday, 23 January 2022
Posted in Payment Gateways
Likes 0
Views 597
Votes 0
Hi,

I need to implement recurring payments in my custom payment gateway.

Here is the docs from the payment gateway how should I register and process recurring payments:

1. Make a parent payment by calling Init with additional parameters Recurrent=Y and CustomerKey.
2. Redirect the Buyer to PaymentUrl.
3. After the Buyer pays for the order, the parameter RebillId will be sent in the notification for the AUTHORIZED status.
4. After some time, to make a recurring payment, you need to call the Init method with a standard set of parameters.
5. Receive the PaymentId parameter in response to Init.
6. Call the Charge method with the RebillId parameter obtained in step 3 and the PaymentId parameter, obtained in step 5.

So as you can see to make step 4 I need some action from the PayPlans. Is there any plugin event for that?

For example when the plan is expiring and it is recurrent then PayPlans trigger some event and as the result I can make step 4-6 to make a recurring payment and prolong the plan.

Best regards,
Artem
Hey Artem,

Sorry for the delayed response.

For example when the plan is expiring and it is recurrent then PayPlans trigger some event and as the result I can make step 4-6 to make a recurring payment and prolong the plan.
Recurring payment from payplans will be triggered on corn job. To process the recurring payment you need to work on processPayment event. You can take reference from the existing stripe payment method integration code.
You can find this code on the below-mentioned file path.
root/plugins/payplans/stripe/app/stripe.php

Update us if you have any queries.
·
Monday, 24 January 2022 11:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Manisha,

Thank you for pointing me to the processPayment event.

Best regards,
Artem
·
Monday, 24 January 2022 20:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome.

Just for your information, I have locked and marked this thread as resolved to avoid confusion in the future. Please start a new thread if you have any other issues in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Monday, 24 January 2022 20:42
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post