#champagnebazzi

1 messages · Page 1 of 1 (latest)

azure condorBOT
topaz monolith
#

Hi there!

#

the webhook receives an unknown payment method id in the “setup-intent.success” event
What do you mean by this? Can you share an event ID (evt_xxx) where you see this issue?

void furnace
#

I'm listening locally to the webhook, this is the event id: evt_1NSGrlAx5FDrMBkPReQOSfc3

And this is the error when I try to set the customer's default method when the event above is triggered: The customer does not have a payment method with the ID pm_1NS...... The payment method must be attached to the customer.

The method with that id does also not exists in the customer's methods.
@topaz monolith

topaz monolith
void furnace
#

req_eSRtwJz3OdpQ7m

topaz monolith
#

Thanks! Give me a few minutes to look into this.

void furnace
#

Thanks you! This is the setup intent request:
req_iZ9YX9dLk7y9I5. you can see I attached the same customer id @topaz monolith

topaz monolith
void furnace
#

I see, I was already thinking it might be a delayed event trigger and/or it was still handling the authorisizing of the ideal *or the event fired to soon

topaz monolith
#

And if you try again now, is it working or you still see the same error?

void furnace
#

A new setup intent? or connecting the method?

#

I just tried it again and I see that a new sepa debit method gets added to the customer when completing the setup intent. However that id is completely different that the one from the error

azure condorBOT
void furnace
#

That is why it can't find the correct method, because the id is wrong, also on the authorization page of ideal, I see the object with the id of the error and in the customer's methods I see a new method with a different id

*Cant find the method to set as default, because it doesn't exist with that id

peak shadow
#

Hey! Taking over for my colleague. Let me catch up.

void furnace
#

Thanks

peak shadow
#

Sorry I'm not sure understand the exact/remaining issue here, can you please summaire the latest follow up question ?

void furnace
#

When a customer selects ideal instead of creditcard in the setup intent. I gets added to the customer. However the webhook receives an event (setup_intent.succeeded) with a different payment method id (that does not exist in the customer). In that event I'm trying to set the default payment (which is required right? to setup my subscriptions) but because that id does not exists, it throws an error. When doing creditcard it's working correctly.
@peak shadow

peak shadow
#

but because that id does not exists,
Could you please share the eventId ?

void furnace
#

evt_1NSHJzAx5FDrMBkPAtPgVqil

peak shadow
#

Thanks for sharing, the PaymentMethod Id is pm_1NSHJvAx5FDrMBkPsvDX2AoI

void furnace
#

Yes but it does not exist in the customer

#

It adds one when setting up. But that id is different

void furnace
#

I don't understand it completely. So when the 'setup_intent.succeeded' triggers, what should I do?

peak shadow
#

When saving Ideal payment methods. It generated a sepa_direct payment method, that you need to use it for future usage/payment

#

Once you got the SetupIntent succeeded event,

void furnace
#

Oh wow thanks, it's working, using that and getting it from 'setupIntent.latest_attempt.payment_method_details.ideal.generated_sepa_debit'

peak shadow
#

yes exactly!

void furnace
#

Now imaging I want to support all local methods

#

I need to check every type of method to get the correct method id in that event? For sofort, ideal, bancotact, etc

peak shadow
#

yes. Because some payment methods requires additional action in order to get the target/final PaymentMethod id to use.

void furnace
#

mmm, would you recommend to use custom checkout methods instead that uses creditcard, ideal as separate options and separate stripe elements (like radio buttons), and show the correct method based on countrySpecs? And limit my self to a fixed amount of methods?

peak shadow
#

I'm not I understand your question correcly. You should be using Stripe Elements which will display relevant PaymentMethods to the customer.

#

You shouldn't do manual controls/check on that...

void furnace
#

Oke oke thanks. Do I need to delete the customer's other methods when he updates his payment method? And it should be default right for subscription to work? And what if there is no trial and customer needs to pay now to activate the subscription. Do I need to use confirmPayment instead of confirmSetup?
@peak shadow

peak shadow
#

Do I need to delete the customer's other methods when he updates his payment method?
You can keep them
And it should be default right for subscription to work?
You can specify which PaymentMethod will be used for the Subscription
And what if there is no trial and customer needs to pay now to activate the subscription. Do I need to use confirmPayment instead of confirmSetup?
Correct you need to use confirmPaymentbecause you'll get a PaymentIntent Id.

void furnace
#

Oke thanks @peak shadow!