#sean_trustap - Payment Intent Error

1 messages · Page 1 of 1 (latest)

sick venture
#

HI 👋

clever dragon
#

Will do, thanks.

#

It's req_YIaysvBOwTSGwr

sick venture
#

Okay so the payment intent already has a currency

#

Why would you try to update a payment intent like this? It seems like you are basically creating an entirely new payment intent.

clever dragon
#

Yes, if the buyer wants to use an alternative payment method then we change the amount to account for the different payment method fees. Based on the Best Practices, it was our understanding that Stripe suggests to update the amount, rather than creating a new payment intent in this scenario, since it's still the PaymentIntent for the same "item". Are you suggesting that we actually create a new PaymentIntent instead, and cancel the old one?

sick venture
#

Hmmm... there may be issues with the change of currency (that isn't one of the use cases for the Best Practices doc). But I think the issue is with the order of operations that the API is performing

clever dragon
#

Sorry, just to clarify, the currency is the one field that we don't change, it's just the amount, and the allowed payment methods, that should be changing (we only allow one payment method type at a time)

sick venture
#

Okay right. The trouble is it is setting the allowed payment types to card without removing the currently attached payment method.

#

So you would need to include the fpx type in your list of allowed types

clever dragon
#

Is it possible to remove the PaymentMethod from the PaymentIntent? Any reference that I've seen to detaching payment methods only relates to Customers currently.

sick venture
#

You would need to replace the Payment Method. Or, I haven't tested this but have you tried passing either null or an empty string as the Payment Method to unset that field?

clever dragon
#

I was going to try that but it didn't look possible from the documentation, but I'd be happy to try now to confirm. Do you have a suggestion on how that can be attempted using curl? Perhaps using -d "payment_method=null or -d "payment_method= ?

#

Ah, payment_method= "worked", but it returned an error that payment_method can't be unset.

sick venture
#

Okay so that answers that. You'll need to replace the payment method

#

So in that case, if you want to allow the customer to use a card you'll need to allow both card and fpx payment method types for the update request

clever dragon
#

I see. In that case we'll likely need to cancel the PaymentIntent and create a new one, because the different payment methods will require different amounts. Thanks for your help!