#.jovanm_

1 messages · Page 1 of 1 (latest)

north flintBOT
#

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.

gusty blaze
#

Hello! What do you mean by "graph of a custom payment flow"?

karmic sigil
#

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.

gusty blaze
karmic sigil
#

Noice

#

Thank you! You found it.

gusty blaze
#

👍

karmic sigil
#

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?

gusty blaze
#

You're retrieving the Payment Intent client-side with a publishable key right?

karmic sigil
#

Yep that's right.

gusty blaze
#

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

karmic sigil
#

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?

gusty blaze
#

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

karmic sigil
#

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.

gusty blaze
#

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

karmic sigil
#

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.

gusty blaze
#

Yeah I totally understand

karmic sigil
#

Thanks for your help here. I'll ask once again if I have something in mind.