#Nadiya
1 messages · Page 1 of 1 (latest)
hello! can you share your logic?
sure
do i've to use off_session / something else which create the subscription immediately?
where is it infinitely looping at?
to be specific, which section of code is causing it to infinitely loop?
you'd want to step through each line of your code to understand why
the subscription create code is causing infinite loop i guess
it agains calls setup intent event, and this create the subscription again
can you paste the second SetupIntent id here?
seti_1Mh4JeLoPcxaifRirht1HRsX
can you try not passing in payment_settings.save_default_payment_method when creating the Subscription
sure, let me try that.
tbh, i've no idea what's that for. i found that from a guide, and i thought it adds the dafault pm from customer to subscription
it still loops
can you share the second SetupIntent id again for the new try?
seti_1Mh53CLoPcxaifRiUDc53NoD
hmmm, gimme a while to think what's the best way to go about this
what about these?
out of curiosity, if the user updates the PaymentMethod, that will likely trigger a setup_intent.succeeded event also. How were you planning to handle that since right now on you're always attempting to trigger subscription creation upon setup_intent.succeeded?
when i comment out subscription created, it's not creating setuop intent again
let me share you the event list of the same
oh i got you, sorry
i guess i've to share some metadata on very first setupIntent.
that works
then, i'll be checking with this metadata to decide whether to create subscription or not
yep, i think that will avoid the infinite loop during subscription creation also
cause creating the subscription with a trial also generates a SetupIntent
i see