Saladmoon9 Posted February 22, 2023 Share Posted February 22, 2023 I am developing a custom payment method that calls to a payment gateway to make payment. There is a field that I pass to the payment gateway so that the payment gateway knows where to send the response. I've noticed other payment methods such as Paypal and Sage/Opayo also have such a field and they set the field with the following value respectively, Paypal: 'return_url' => tep_href_link("callback/webhooks.payment.{$this->code}", 'action=return', 'SSL', true, false), Sage/Opayo: 'NotificationURL' => tep_href_link('callback/sage-server', 'check=SERVER&' . tep_session_name() . '=' . tep_session_id() . $partlyPaid, 'SSL', false), I also notice that Sage/Opayo is doing the response handling in the exact same method (before_process()) where they call to the their payment gateway. What url should I put if I would like to achieve the same result? Quote Link to comment Share on other sites More sharing options...
Webitbz Posted September 29, 2023 Share Posted September 29, 2023 For a webhook or payment notification you use the call_webhooks function in your payment gateway code and the URL is constructed as your example from paypal (like https://www.mystore.dev/mystore/callback/webhooks.payment.mygateway ). For redirection methods you would add a success/fail/cancel URLs that you can point to https://www.mystore.dev/mystore/checkout/process and handle the response in the before_process and after_process functions in your payment gateway code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.