#bboystatix
1 messages · Page 1 of 1 (latest)
Can you share the subscription IDs (sub_xxx)?
here's the customer id cus_OvVONFETyGrC5o
sub_1O83ZwImFOsfVEtUMjFZjsgM
sub_1O83YaImFOsfVEtUBFugkkFy
Thanks for sharing! The subscription creation was made by your server:
- sub_1O83ZwImFOsfVEtUMjFZjsgM: https://dashboard.stripe.com/logs/req_7qvaj5CXowTkzq
- sub_1O83YaImFOsfVEtUBFugkkFy: https://dashboard.stripe.com/logs/req_SFuiyTSSUQIp9R
Your system shouldn't create a new Subscription (that will create new payment intent under the hood). It should re-used the re-used the payment intent from the first created subscription.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Why did the other payment intent get accepted after adding card though
is it stripe behaviour?
i wanted to leave the older sub as incomplete while creating the new sub
and personally im not able to reproduce this issue locally even after following what the customer did
in the backend i create sub in this way
subscriptionParams := &stripe.SubscriptionParams{
Customer: stripe.String(customerID),
Items: priceItems,
PaymentBehavior: stripe.String("default_incomplete"),
CollectionMethod: stripe.String(string(stripe.SubscriptionCollectionMethodChargeAutomatically)),
BillingCycleAnchor: stripe.Int64(getBillingAnchorDate().Unix()),
}
i know that i can reuse payment intent but i think my approach is also fine
Your system set the saved payment method in invoice_settings.default_payment_method on the customer which will be applied to all subscriptions without setting its own default_payment_method: https://dashboard.stripe.com/logs/req_iT4YKknyZNMQgN So yes, this is the expected behaviour.
If you wish to only apply the payment method on a specific subscription, the payment method shouldn't set to invoice default on customer. It should be saved to subscription's default_payment_method instead: https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Re-using the payment intent/subscription is still the recommended approach
Yes my logic is set such that customer adds card and then i make a subsequent request to make that card default payment method
and only after that we create subscription
hmm so ur saying that would auto-charge the failed payment intent?
im wondering why im not able to reproduce this locally tbh
locally the behaviour i saw was that the incomplete sub remained as incomplete
hmm so ur saying that would auto-charge the failed payment intent?
Yes! When a subscription is created andinvoice_settings.default_payment_methodis set, it will be charged automatically. If the subscription isn't in use, you should cancel the subscription and void the invoice
This is me doing the same thing locally
cus_OnBy2dOcpLBrBl
sub_1O8InyImFOsfVEtUVYefPBDB
sub_1O8InUImFOsfVEtUsjX6hAvp
So what about the above case in local, one of my subs remains as incomplete
will it be charged after a delay or something?
It's not charged because additional action is required on the saved payment method: https://dashboard.stripe.com/test/invoices/in_1O8InUImFOsfVEtUr20Xcolg
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
interesting...
how can i simulate my customer's case with an appropriate card
they usually successfully set up card and fail on the payment due to insufficient funds
due to which they then add a diff card which works and thus they sub successfully
oh wait a sec but the payment method i added afterwards was 424242424, which is a card that should definitely succeed
The retry of invoice payment doesn't happen immediately and it will take some time
It's currently set to smart retries for 4 times: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
hmmm still no change
maybe on test environment there's no smart retry? or the schedule is different?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
There's no preset retry schedule, so the actual retries could happen anytime in the next week
Just call the /pay endpoint on the invoice directly
i knew about smart retries, just never knew they also applied to incomplete subs
thought it was only for already created subs,. subsequent recurring charges
do the docs explain this?
Hmm, they don't AFAIK
hmm then i wonder what would be the cause behind this customer's double sub
Not sure what invoice payment retires have to do with double subscriptions. Looks like your integration just created 2 subscriptions for some reason:
sub_1O83ZwImFOsfVEtUMjFZjsgM: https://dashboard.stripe.com/logs/req_7qvaj5CXowTkzqsub_1O83YaImFOsfVEtUBFugkkFy: https://dashboard.stripe.com/logs/req_SFuiyTSSUQIp9R
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Hmm please look above in the convo for context
Can you summarise please
Basically customer adds card successfully -> subscribes -> fails due to insufficient funds -> edits card -> subscribes again -> success
some things to note are
- during add card i use setup intents, and after success i set it as their default card
Not sure what is unexpected there
- everytime u press sub it would create a new sub via backend. that shouldnt be an issue cuz the first sub which failed is incomplete
the expected result should be that the second time pressing subscribe the user creates a subscription successfully while the previous one remains incomplete
As stated by my colleague, if you update invoice_settings[default_payment_method] and then create a new subscription will will use that new PM to automatically confirm the invoice/payment. The old, incomplete sub is impacted (and we don't retry initial sub payments)
hmmm i see
so the old open invoice belonging to the incomplete sub
payment gets attempted on that automatically
correct?
Maybe I was wrong and we do retry that and that what paid it
If you want to test this, you're better off using a test clock
Actually, I don't think it was autom ativally paid. Looks like it was paid via the HIP: https://dashboard.stripe.com/logs/req_nCVg1pIvsE0zhg
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So somebody opened the URL for the invocie and input new card details to pay that invoice
Hmmm…
So yeah I'm 99% sure we don't retry initial invoice for a subscription like that one, just subsequent recurring ones
Yeah I feel that way too honestly, as for the invoice url I’ll need to investigate this
i cant access this log
Ah, weird. Well it indicates that the invoice was paid by the hosted invoice surface (the URL all invoices have generated for them)
So I'd guess we sent that link to the user via email after the initial payment failed (if you have that setting enabled) and then paid it via that web URL
Nothing to do with retries or the 2nd subscription you created
cus_Mr1dUnpwSCmtxe
cus_NfJBpYFNkiYUji
cus_OUvJXQvw6L9H7z
cus_OkFWMSkH74mAD4
cus_OvVONFETyGrC5o
is it the case for these users as well?
Can you share some specific sub_xxx IDs? And is what the case exactly?
basically these customers also have the dual subs issue
Hi! I'm taking over this thread.