Hi all
I'm struggling with my implementation of a payment gateway.
-
After submitting an order, the customer is redirected to the external
payment page, where he enters payment details. At this point, order
submission has started, ie the basket is frozen.
-
When external payment completes, the payment systems calls a webhook,
where I should verify correct payment.
-
Also, shortly after payment completion, the customer is redirected back
to the shop, showing either a "your order is processed" (no webhook
called yet) or a "Thank you" page.
-
So far, I guess quite a standard procedure. My questions:
-
How can I identify the correct order/basket in the webhook call? I think
of providing the payment system my basket id, so I can then load the
correct basket (with the basket id, posted to the webhook url), and
proceed accordingly?
-
In the webhook, I cannot use the CheckoutSessions's build_submission
method, as the session will depend on the customers browser, which is
not there, when the payment system calls my webhook? How is this done
normally?
-
Ironically, I've answered a SO on this topic:
https://stackoverflow.com/questions/31373028/integrating-a-redirection-included-method-of-payment-in-django-oscar/71677456#71677456
Thanks for your time
Best
Ben
--
Ben Stähli
bnzk GmbH
+41 22 575 25 77
bnzk.ch
--