#Whip-PaymentIntent

1 messages · Page 1 of 1 (latest)

bitter nexus
#

Hi @sage trout can you share with me the PaymentIntent ID?

sage trout
#

pi_3KhVg4JyuisDiUpl0Gf42qGu Look at the logs, it's now successful as I used another card on it but you'll find the error in the timeline

bitter nexus
#

When your card gets declined in the first payment attempt, the PaymentIntent status will become requires_payment_method and that's why you are getting error message saying missing a payment method.

#

You can use last_payment_error hash to get the payment error message. In this case it's Your card was declined.

sage trout
#

Why does the php library throw an invalid exception on this? Shouldn't it be a card exception?

bitter nexus
#

It's invalid because the request (i..e, confirming a PaymentIntent when its status is requires_payment_method) is invalid.

sage trout
#

Can I somehow test the scenario that the card fails once, but on retry the same card succeeds?

bitter nexus
#

It's a possible use case but I can't find a test card to simulate it.

sage trout
#

Alright

bitter nexus
#

Hi @sage trout can you elaborate more on the default paymentMethod on customer?

sage trout
#

Well I followed this guide (https://stripe.com/docs/payments/save-and-reuse) to setup an intent. It all works but the card that I used is not set as default (event when its the only one on the customer). Can I add a property somewhere in this process that not only attaches the payment method to the customer but also sets it as the default?

Learn how to save card details and charge your customers later.

bitter nexus
#

You can specify the invoice_settings.default_payment_method to set up a default payment for subscriptions and invoices.

However, there's no way to set a default payment_method for one-time payment, you always need to specify the customer and the payment_method in the PaymentIntent creation API.

sage trout
#

This is the setupintent api. I want to basically know if there's a way to set invoice_settings.default_payment_method on the customer without an extra call.

bitter nexus
#

I'm afraid not, you need to make one API call to set the invoice_settings.default_payment_method

sage trout
#

ok. thanks for your support