#soumya

1 messages · Page 1 of 1 (latest)

olive eagleBOT
cloud carbon
#

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

gray fox
#

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

cloud carbon
#

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?

gray fox
#

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_*'

cloud carbon
#

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.

gray fox
#

okay

#

pm_1NdvmaSCfQjwTWJ0SCJWmk5H cus_OQmvXXXjIex5eQ

#

"seti_1Ndvm1SCfQjwTWJ0I5nlw7Ed",

cloud carbon
#

Thank you for those IDs, checking in to this

gray fox
#

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

cloud carbon
#

So it sounds like some logic somewhere in your code is automatically unsetting this

gray fox
#

Okay

#

i hv one more query will duplicate subscriptions for same customer is allowed ?

cloud carbon
#

Yes, you can have many subscriptions on the same customer

olive eagleBOT
gray fox
#

No wht i meant is same subscription twice

#

can customer have

cloud carbon
#

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

gray fox
#

Does this apply to trail period as well?

cloud carbon
#

Yes

gray fox
#

I hv one more issue like setup intent succeeded is triggered after invoice.paid in case of trail period

hard condor
gray fox
#

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

hard condor
#

Look at the above link I sent

gray fox
#

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?

hard condor
#

Why do you need to listen for both? Couldn't you just rely on setup intent succeeded for the trial?

gray fox
#

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

hard condor
#

If you create a sub with a trial you won't get both setupintent and paymentintent at the same time

#

Just setupintent

gray fox
#

yes to get payment intent i hv to listen to invoice.paid event

#

for trail as well

#

sorry invoiceId

#

not payment intent

hard condor
#

I think I'm confused what the issue is here ultimately