#benstjohn - terminal payments and php client server interaction

1 messages · Page 1 of 1 (latest)

autumn brookBOT
left violet
#

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?

fringe mantle
#

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

left violet
#

Right, so any of that can work, its entirely up to you based on your needs

#

Yep, i'd say so

#

However, moderating this server-side with webhooks and structured polling is likely better

fringe mantle
#

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?

fringe mantle
left violet
#

I think so, your server would decide where info goes from there

fringe mantle
#

gotcha

#

and in regards to the iOS question?

left violet
#

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:

fringe mantle
#

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?

left violet
#

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

fringe mantle
#

okay, so there isn't any harm in passing the secret?

#

what if I use the API on iOS to retrieve it with the ID?

#

stripe API

#

just want to make sure I'm not breaking the stripe rules and passing around the client secret. Especially if I can easily send the ID around

left violet
#

You should treat the client secret carefully, but its perfectly fine & expected to pass it to your client, that's what it's for

#

benstjohn - terminal payments and php client server interaction