#emeryc - Payment Confirmation
1 messages ยท Page 1 of 1 (latest)
Hi ๐
I'm a little confused by the payment flow you are describing. Could you reword it in a set of steps?
Sorry, still getting my first cup of โ
hahaha no worries!
F.Y.I we are using StripeElements.
Our backend uses .Net Frameworks, our front is in AngularJs
Here are the steps (I'll explain our problem in the next message):
-
We start by sending the PaymentMethodId from the FrontEnd to our BackEnd
-
It goes in our code where we create the PaymentIntentCreateOptions while using the PaymentMethodId
-
In our PaymentIntentCreateOptions, we set the 'ConfirmationMethod' to "manual" and the 'Confirm' to "true" then we proceed to create the PaymentIntent
-
If there's required actions, it goes back to the FrontEnd and then goes back to the Backend with the PaymentIntentId. If there's none, it continues.
-
We then confirm the paymentIntent.
Here is a snippet of our backend code:
So back to our question,
is there a way to confirm the payment later without capturing anything so in the case that it fail for any reason it will just stay "pending" but will not be billed to the customer or anything?
Hmmm...this kind of sounds like a separate auth and capture flow. Have you reviewed that process?
https://stripe.com/docs/payments/capture-later
so in the case that it fail for any reason
What type of failure are you concerned about here?
Hi @rare panther im jumping in i am a collegue of Emeryc
We are not worried about anything at the stripe level but more on our side.
We did review that flow but in the example there is a partial amount of the total being captured.
You can simply choose to capture the entire amount
We would like instead to capture nothing but still create the payment intent and then confirm it later for the full amount
And you can stagger when you auth and when you capture
So if something in our processing flow fail in between there will be anything captured
That is entirely up to your code flow and when you call the .capture() method
So you could auth the card, process things on your end, then call the capture method
Well i think then i missunderstand the flow since it was taken only a partial amount. So we can do
1Create payment intent
2 do our process
3 capture everything
If i get it right
Yup. When I was testing this payment flow during my onboarding I created a bunch of auth'd payment intents and then came back to a list of them and tested manual capturing of funds. It worked even multiple days after the initial payment intent creation
Great!
Last question
Let's say that during step 2 something fail
And we leave the payment intent like that
Will it be automatically dismiss after a certain time
Do we have to handle that? What are the proper way of handling "pending" payment intent
AFAIK it won't dismiss but you may need to re-authorize the payment depending on how old the auth is (that's a bank/issuer decision). The best way to handle this is to check on the pending by querying the Payment Intent API looking for status of requires_capture
https://stripe.com/docs/api/payment_intents/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks!
Happy to help ๐
I am not sure i understand well the difference between confirmation_method and capture_method.
The confirmation_method mean that the payment method use to create the payment intent is the right one
Credit card vs any other type?
Capture_method is only to capture the fund later?
Confirmation method is used to ensure server-side finalization of payments. Here's a good walk-through for that
https://stripe.com/docs/payments/accept-a-payment-synchronously
That capture method applies to the workflow I shared earlier for separating charge authorization and funds capture
So we use either one or the other?
Im really confused about there meaning and the proper use
Okay at a high level, what do you want to accomplish?
Not billed the client if something failed after we process the payment to stripe
Lets say we do some validation
After if it's fine we initiate the payment with stripe
After that we log everything we need in our databse
Send email
Once all of this is done we confirm/capture
The total amount
Otherwise the paymentintent stay "pending" and we handle it somehow with what you suggest query for required capture
Okay so that seems to me to best match with the workflow outlined in the separate auth and capture workflow I first shared.
Ok so these two flow with confirm/capture principles are not working together they are different in meaning and depend on the type of flow we need
You might have other workflows where it would make sense to use the server-side confirmation but that's still up to you and how you want your application to behave. Here's the flow:
https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet
Yes they are different, not simultaneous approaches. You can blend the two together if you want to make your life more complicated but I'm not sure why you would.
If you are still unsure how to approach this, I would review both approaches from a "blank slate" standpoint and diagram how each flow would fit into your applications desired behavior. Then you can evaluate what gets you closer to the outcome you want for your customers.