#.jovanm_
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
Hello! What do you mean by "graph of a custom payment flow"?
I saw a graph before in stripe documentation (or probably I'm just imagining it) where it demonstrated the lifecycle of a custom payment flow.
From initialize stripe with public key -> elements.create() -> confirmPayment -> successful page.
Are you thinking of this? https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-create-intent
👍
So, I have a question
As of now, I am passing a metadata and update the payment intent before I passed the clientSecret to confirmPayment() . So that, I could see this metadata in webhook.payment.succeeded.
In my display payment status, I retrieved the payment intent using the client secret.
Will I able to see this metadata in Display Payment Status?
You're retrieving the Payment Intent client-side with a publishable key right?
Yep that's right.
metadata isn't something we return when a Payment Intent is retrieved with a publishable key so you wouldn't get it back
You'd need to retrieve it with your secret key
Isn't retrieving using secret key too risky in client-side?
Question No.2
In webhook.payment.succeeded, I usually do my business logic here including creating users in our system and etc.
The thing is I wanted to retrieve the newly created users (executed in webhook.payment.succeeded) in Display Payment Status state.
Will the business logic inside the webhook.payment.succeeded will be able to finished before the Display Payment Status state?
Will I able to retrieve the newly created users? Or there's a 50/50 chance that I could retrieve that data due to the asynchronous nature of webhook?
Yeah you 100% should NOT be using your secret key client-side. You'd need to make a call to your own server, which in turn would retrieve the PI for you with the secret key
The thing is I wanted to retrieve the newly created users (executed in webhook.payment.succeeded) in Display Payment Status state.
Will the business logic inside the webhook.payment.succeeded will be able to finished before the Display Payment Status state?
No, you don't really have a freat way of guaranteeing that one will finish before the other - you'd need to build your integration in a way that can handle either the webhook event OR the "display payment status" being reached first
Okay thanks.
Can you give me the link where I can see the return of this? stripe.retrievePaymentIntent(clientSecret)
My apologies here, I haven't slept for 24 hours now so my mind is quite messy to navigate through the docs.
When you look at our API reference for Payment Intent (https://stripe.com/docs/api/payment_intents/object) any attribute that has "RETRIEVABLE WITH PUBLISHABLE KEY" next to it is one that you'd get back from a client-side retrieve
and no worries!
Really what I'd suggest is that you try all this out in test mode and you can see exactly what you'd get back
Ah, currently asking here to verify something since our Stripe is live now LOL.
I haven't setup a dev server yet T.T
Well, this is not my fault since my manager launched the product hastily and wanted me to add some additional features.
Yeah I totally understand
Thanks for your help here. I'll ask once again if I have something in mind.