#KenKen
1 messages · Page 1 of 1 (latest)
Yes, but how does it affect webhook? You still listen to either checkout.session.completed or payment_intent.succeeded depends on the flow
I would like to keep the customer checkout page open until they've completed the payment. From what i've understood, i need to check if there's an incoming request for the payment_intent.succeded event to move on / complete the transaction correct?
Probably similar to PayNow method where the stripe js would simply display and close popup modal.
I would recommend separating the webhook receiving logic and your checkout page. Webhook was built to be fully async with your Checkout flow.
When your customer finished paying in GrabPay website they will be redirect back to your return_url and you can keep a simple page there, querying the PaymentIntent status again to display, but the logic to fulfill your order should be done via webhook, separately and async
I see. Does separating webhook and checkout page means that both logic will be processed in different session?
For example, customer checks out and purchase order. The order will be in pending for payment status while waiting for webhook to fulfill order using payment_intent.succeded event?
Yeah
Currently how my system works is that in checkout process we pass all the order data along with the payment ID to be validated.
i suppose this won't work with the current method because of the redirect?
Hmm not sure what that means. What Payment ID and how do you validate?
PaymentIntentID. In backend, we would retrieve the intent data to check whether there are charges to indicate that the payment is valid and completed (last i checked it was in ['charges']['data']).
We would also check whether the charge paid field is true as well
The timing you perform that check/validate matters, I guess. You could check the PaymentIntent status instead of looking to charges, but yeah this should only to display something to user. You should still actually fulfill the order once you receive webhook event asyncly
I see okay i'll take a look again on the order fulfillment in the docs. One reason i'm trying to process this mostly on backend is to handle the logic sent from mobile side. I've noticed both PayNow and GrabPay are not implemented there yet correct?
Good luck! And sorry didn't follow the last question again. Which part is not implemented? https://stripe.com/docs/payments/paynow/accept-a-payment?platform=web#fulfill-order and https://stripe.com/docs/payments/grabpay/accept-a-payment?platform=web&ui=API#fulfillment are documents for handling webhook per PayNow/GrabPay
Sorry i mean is there a way to complete GrabPay/PayNow payment in Android / iOS other than opening webview?
Ah yes correct
Okay thanks for the info! 👍