#champagnebazzi
1 messages · Page 1 of 1 (latest)
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?
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
Can you share the request ID (req_xxx) where you see that error? You can find it here https://dashboard.stripe.com/test/logs
req_eSRtwJz3OdpQ7m
Thanks! Give me a few minutes to look into this.
Thanks you! This is the setup intent request:
req_iZ9YX9dLk7y9I5. you can see I attached the same customer id @topaz monolith
The card was attached at 2023-07-10 09:58:45: https://dashboard.stripe.com/test/logs/req_lkkXxQlWy188KH
And then when you tried to use it on 2023-07-10 09:58:49, it failed: https://dashboard.stripe.com/test/logs/req_eSRtwJz3OdpQ7m
Humm...
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
And if you try again now, is it working or you still see the same error?
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
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
Hey! Taking over for my colleague. Let me catch up.
Thanks
Sorry I'm not sure understand the exact/remaining issue here, can you please summaire the latest follow up question ?
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
but because that id does not exists,
Could you please share the eventId ?
evt_1NSHJzAx5FDrMBkPAtPgVqil
Thanks for sharing, the PaymentMethod Id is pm_1NSHJvAx5FDrMBkPsvDX2AoI
Yes but it does not exist in the customer
It adds one when setting up. But that id is different
There is a generated sepa_payment pm_1NSHJyAx5FDrMBkPGhHncdyd
That is attached to the customer
I don't understand it completely. So when the 'setup_intent.succeeded' triggers, what should I do?
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,
you need to retreive the Sepa PaymentMethod Id generated, following this part of this guide:
https://stripe.com/docs/payments/ideal/set-up-payment?platform=web#charge-sepa-pm
Oh wow thanks, it's working, using that and getting it from 'setupIntent.latest_attempt.payment_method_details.ideal.generated_sepa_debit'
yes exactly!
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
yes. Because some payment methods requires additional action in order to get the target/final PaymentMethod id to use.
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?
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...
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
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 useconfirmPaymentbecause you'll get a PaymentIntent Id.
Oke thanks @peak shadow!