#asharksfishbowl-Subscription
1 messages · Page 1 of 1 (latest)
Um that's the expected behavior of Subscription creation API. When the card is decline, Subscription stays in a state can you can re-collect for a differrent Payment Method to make it eventually successful
You can customize that behavior by https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
set it to: error_if_incomplete
sweet thank you, im going to try that now
In the favor of SCA I recommend to leave the current behavior instead. It would help you recover from a SCA requirement in case. More info on the link above
like this? const subscription = await stripe.subscriptions.create({
customer,
items: [{ price: selectedPrice, quantity }],
billing_cycle_anchor: Math.ceil(nextMonth / 1000),
error_if_incomplete: true
});
No, like you are orginially doing. Once you have a decline, bring customer back online and re-collect another PaymentMethod.
Once they provide a new PaymentMethod, you are good with a Subscription become active
well, this is the main problem I am trying to solve. When a user registers they select a subscription. It both creates the customer and subscription but when the card is declined they can still log into the app. Is there a way I can change my login to check if it is valid before login? I am in nodejs backend with angular frontend
In that case, how about creating a SetupIntent first to collect Payment Information? Once you have a successful SetupIntent, you can use the PaymentMethod inside to create a Subscription server-side
what is a SetupIntent
In step 7, instead of creating a new PaymentIntent, you use the PaymentMethod Id directly to supply to a Subscription
hmmm it's not the payment that is the issue, it's more they can access the site with an inactive subscription. I basically need a way to prevent access without a valid subscription
In this flow, when a SetupIntent is confirmed successfully (before even you create a Subscription), it means the card is valid and I think that's good enough?