Hey there. After reading docs about stripe, it loo...
# orm-help
w
Hey there. After reading docs about stripe, it looks like the best way to stay PCI compliant is to make all the logic directly from the front-end part of your app (react-native in my case), without ever communicating with your backend. Can anyone confirm that?
l
Confirmed. Let Stripe web hook your backend with a token
w
And how would I listen to that hook from a graphql server 😐 ?
l
It’s going to post a rest response back, so you’ll need to open up a route
w
Yeah.. it just feels weird to add
express
as a dependency to handle such a little thing. I might consider using a lambda, but then I’d have to make another step to communicate back with my graph-api
l
Are you using Yoga?
w
Yep!
l
Then Express is already a dependency. You can open up a route from Yoga, but I'm not looking at my implementation or the docs. There's a way to get ahold of the Express
app
instance
w
Alright, I'll see how to tackle this. Thanks a lot man!
l
... duh, that's where it came from πŸ™‚ Changing that to a
get
with the web hook's endpoint should do it
w
Thanks again πŸ™
πŸ‘ 1
l
Also, something to keep an eye out for.. Stripe may have the ability to give the token to a client, the client passes you the token, and your server can validate the token (oAuth style) which could also work
w
I don't see how that could work with 3D Secure payments as the charge is done asynchronously?
l
... thinking about it further, that might be the way to do it because that client token doesn't need to be secure or validated because it's signed to your server secret and will only be authorized with your server secret.
3D secure I don't know about
w
It's one of many security protections, where your bank sends you a code via text message and the payment is done only once that code is validated
l
I'm talking out of my ass here (... as per usual πŸ™‚ ), but I know Stripe's big goal is to merge all of these different payment methods into one API. It wouldn't surprise me if the token passing worked the same regardless of method.
... thinking out loud, you must be right for a multi factor auth transaction. The only way to do that would be a long lived client connection, but you can't depend on that, so a server web hook makes more sense πŸ™‚
w
Great great great πŸŽ‰πŸ™
πŸ˜‚ 1