Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Handling asynchronous callbacks from Payment Gateway


fimkap

Recommended Posts

I'm writing my own payment module for OSCommerce. We use asynchronous callbacks from our payment gateway. It means that I need to create the order while handling such a callback. I understand that I should use checkout_process.php for that. But the problem is that there's no session context since the callback is asynchronous. So tep_session_is_registered will fail. From the code of other payment modules it looks like mostly they are based on the existing session context.

So what's the best strategy in that case? 

In fact, the idea is that we have all the necessary information returned in the data with the callback. So in theory I can create a new order out of the session context, but I don't want to rewrite the already existing logic and it has a lot of dependencies. On the other hand, I can try to restore the session from the database (create a kind of dummy session with the necessary context to call checkout_process.php), but that doesn't seem easy at the moment. Nor does it seem the right thing to do.

Maybe some plugins use the same pattern?

Thanks

Edited by fimkap
typo
Link to comment
Share on other sites

multisafepay creates the order first with an awaiting payment status and then updates to payment received and sends the order confirmation email

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

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...