#lunarexhale_code

1 messages ¡ Page 1 of 1 (latest)

dusk shellBOT
flat snowBOT
#

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.

dusk shellBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239980342455042188

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

full sandal
#

There are 2 different ways to confirm a Payment Intent. The one you found is for server-side confirmation calls, whereas the one I posted is for client-side confirmation calls. The client-side one is the one you want if you're passing in an Elements instance

glossy escarp
#

yes, but in the docs for the client side method, it says the following for the confirmParams parameter: "Parameters that will be passed on to the Stripe API. Refer to the Payment Intents API for a full list of parameters."

#

that seems to suggest that it supports all the params of the rest api

#

so i'm not entirely sure if that actually is the case, or if only the ones defined in the typescript type definitions are supported

full sandal
#

Where do you see that verbiage?

full sandal
#

I think the intent was to mention that the parameters included in the client-side Stripe JS docs are also documented further in the server-side docs. Not all the options in the server-side docs are allowed in the client-side method. If you look at individual parameters in the client-side docs, you'll see references to the same specific parameters in the server-side docs. Those are the ones that are usable.

That being said, yeah. The verbiage is really confusing

glossy escarp
#

ah okay, gotcha

#

does that mean there isn't a way to use manual capture_method with stripe js?

#

my initial intent was to basically set capture_method to manual when confirming the payment intent from the client side, and then manually capture the funds on the backend later

full sandal
#

Right, you could still do that, but you would need to create the payment Intent ahead of time and pass in capture_method: "manual" during creation.

#

Then pass that Payment Intent into the Payment Element and call stripe.confirmPayment()

glossy escarp
#

ahhh okay, i totally missed that param in the creation api docs

#

do you have a general rule of thumb for when to capture manually vs automatically? or is that pretty difficult to say without a specific example?

#

as a separate but related question

full sandal
#

Manual capture is more configurable, but requires more work/code from you. Automatic capture is easier to use and more instantaneous, but less configurable

glossy escarp
#

Gotcha, that's helpful. Sorry, one final question - when capturing funds, if that returns a success, can it be assumed that the payment method has been charged at that point, or would we need to listen for a webhook event?

glossy escarp
full sandal
#

But yes, you would also want to check the return value from stripe.confirmPayment() to see what the outcome was and potentially perform additional actions from there

glossy escarp
#

okay, and once that call succeeds, would it then be safe to assume that the charge went through?

#

i guess assuming next_action was null?

#

specifically, in our case, we're accepting cc and ach payments only

dusk shellBOT
full sandal
#

I would read through the quickstart guide here about recommended handling on-submit and during post-payment if you haven't already: https://docs.stripe.com/payments/quickstart#submit-event

Pay special attention to step 4:

Stripe recommends handling the payment_intent.succeeded, payment_intent.processing, and payment_intent.payment_failed events.

Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes, and malicious clients could manipulate the response. Setting up your integration to listen for asynchronous events is what enables you to accept different types of payment methods with a single integration.

glossy escarp
#

okay, thanks

#

you've been very helpful