#soumya
1 messages · Page 1 of 1 (latest)
SetupIntents won't set that default field automatically, your integration will need to make another API call specifically to update your Customer or Subscription's default paymetn method
but we will get the payment method added only through this event
we wont get the pm in invoice.paid evnt
we are listening to setupintent succeeded and updating customer defualt payemrnt methiod but this is done previous to calling subscription api
Gotcha, so when you create a trial subscription, do you know what part of this is failing? Is the setup intent succeeded event not triggering or is the update call failing?
setup intent succeded is trigering but the update customer is not happening even though in response of update customer shows this default_payment_method: 'pm_*'
Can you send me the ID of a customer that you saw this behavior on? (cus_1234)
And the SetupIntent (seti_1234) or PaymentMethod (pm_1234) as well if you can.
Thank you for those IDs, checking in to this
u can check this reqId req_QhK0VlF2rYD6Zj
am updating customer
but if i resend setup event succeded event again it updates customer card as defualt on dashboard i can see the defualt flag
The same shd happen at first time
Ah, so it looks like that call properly updated your customer's default payment method. Here is the customer.updated event showing that https://dashboard.stripe.com/test/events/evt_1NdvmdSCfQjwTWJ0WkUXINtS
But right after, your integration made another API call that unset the default payment method https://dashboard.stripe.com/test/logs/req_L8K1DYfyJmsA49
https://dashboard.stripe.com/test/events/evt_1NdvmeSCfQjwTWJ07CfKj93Z
So it sounds like some logic somewhere in your code is automatically unsetting this
Yes, you can have many subscriptions on the same customer
Yes, if you tell Stripe to create a subscription, we will create a subscription without checking to see if a subscription like that already exists on the Customer. If you want to avoid duplicates, your code will need to do a check like that itself
Does this apply to trail period as well?
Yes
I hv one more issue like setup intent succeeded is triggered after invoice.paid in case of trail period
Hi there. We don't guarantee the order of event delivery. See: https://stripe.com/docs/webhooks#even-ordering
Then how can we manage this
first setup intent succeeded shd be sent as pm is added succesfully then based on this am generating trail subscription
but y is thsi actually reversed
Basically after i get setup intent succeeded am initiating a trail subscription
and saving the pm added to customer
in invoice.paid i do not get the payment method added in this case how can i fetch the pm added?
Why do you need to listen for both? Couldn't you just rely on setup intent succeeded for the trial?
it doesnot have any details aby subscriptionId or priceId any other details
i ned to update subscription Id
is their a way i can get subscription Id using setup intentId?
and also the payment intent id
to get all these i hv to listen to both events
If you create a sub with a trial you won't get both setupintent and paymentintent at the same time
Just setupintent
yes to get payment intent i hv to listen to invoice.paid event
for trail as well
sorry invoiceId
not payment intent
I think I'm confused what the issue is here ultimately