#emeryc - Payment Confirmation

1 messages ยท Page 1 of 1 (latest)

rare panther
#

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 โ˜•

primal mango
#

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?

rare panther
#

so in the case that it fail for any reason
What type of failure are you concerned about here?

soft yoke
#

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.

rare panther
#

You can simply choose to capture the entire amount

soft yoke
#

We would like instead to capture nothing but still create the payment intent and then confirm it later for the full amount

rare panther
#

And you can stagger when you auth and when you capture

soft yoke
#

So if something in our processing flow fail in between there will be anything captured

rare panther
#

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

soft yoke
#

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

rare panther
#

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

soft yoke
#

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

rare panther
#

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

soft yoke
#

Thanks!

rare panther
#

Happy to help ๐Ÿ‘

soft yoke
#

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?

rare panther
#

That capture method applies to the workflow I shared earlier for separating charge authorization and funds capture

soft yoke
#

So we use either one or the other?

#

Im really confused about there meaning and the proper use

rare panther
#

Okay at a high level, what do you want to accomplish?

soft yoke
#

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

rare panther
#

Okay so that seems to me to best match with the workflow outlined in the separate auth and capture workflow I first shared.

soft yoke
#

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

rare panther
#

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.

soft yoke
#

Good we will work on this and i could send you a clear diagram of all the step we are doing

#

So you could confirm that it make sense

#

Thanks a lot