Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to redirect back to OS Commerce from payment gateway after transaction has completed?


Saladmoon9

Recommended Posts

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?

Link to comment
Share on other sites

  • 7 months later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...