#benstjohn - terminal payments and php client server interaction
1 messages · Page 1 of 1 (latest)
I think you'd mostly track this server side and do some kind of polling on your client
or an equivalent of a socket session from your client to server so your server can notify the client
Does the client end up getting the stripe id, or only your internal ID?
so I can pass pretty much anything necessary from the API to the mobile side and the PHP client side
we have a "session" ID for each process that we use to track an individual payment process - and use that ID as a unique endpoint to poll
so you hit /paymentSession/123/newIntent and it creates the intent
mobile will poll /paymentSession/123/poll
then if there IS an existing intent to fulfill it will fulfill it.
Ideally, we just directly pass the success to the PHP client side, but it's not looking like that's possible
So would we just need to set up our own system for polling that specific endpoint? @left violet or can we have the PHP listen directly to taht intentID
Right, so any of that can work, its entirely up to you based on your needs
Yep, i'd say so
but i'll mention again if you do have the payment intent id client side you could check its status directly from the client: https://stripe.com/docs/js/payment_intents/retrieve_payment_intent
However, moderating this server-side with webhooks and structured polling is likely better
And what would be the best reference for me on the iOS side of things to essentially retrieve that payment intent ID and then tell the M2 reader to process a payment for THAT intent?
So we could set up a singular webhook (no ID) and then have it just process all events accordingly?
I think so, your server would decide where info goes from there
If you create the payment intent on the server, you at least need to send the client_secret back to the client to work with the Terminal SDK. on the reader:
I thought we can't send that around?
Should I just send the payment ID and the retrieve the client_scret on the mobile side with the intent ID?
Well you need to send it to the client to use for that payment
No, that client secret is not present on the Stripe.js retrieve, due to the sensitivity
you need to return that from your server