#sanderfish

1 messages · Page 1 of 1 (latest)

pure juncoBOT
digital herald
#

we create the subscriptin via stripe.subscriptions.create (nodejs sdk)

coral lodge
#

You should avoid creating duplicate subscripitons when payment fails.

digital herald
#

So I should attempt to re-use the previously created subscription ID?

coral lodge
digital herald
#

that's later stage I think — preferably we'd just cancel (fail) subscriptions if the card validation fails, instead of moving to "trialing" state

coral lodge
#

No I don't think that's the proper way of handling failed payments

digital herald
#

Hm.. problem is this is a public checkout form and we do want to allow customers to start multiple subscriptions.

Currently we create the subscription, the call confirmCardPayment, which throws an error:

We are unable to authenticate your payment method. Please choose a different payment method and try again.

coral lodge
digital herald
#

I believe the first 2 failed, then 3 went through. Then the customer purchased another subscription later (4)

  1. req_ZQERo2UsP3Av1q
  2. req_rE3U00uPmBTRUv
  3. req_xslAtpqkTG1aDd
  4. req_Y3wbR4ltwRobFy
#

but now all 4 subscriptions are in trialing state, and will be charged as a card was collected later

coral lodge
#

The response of first 2 requests are both 200.

#

And the invoice (in_1OZh8PEBIPmrEnxqQKK8qs7n) was paid successfully

digital herald
#

yes, the subscription creation goes through and the $0.00 invoice is "charged" as well. but no payment method is collected on the first 2 subscriptions

#

Basically the issue is here on the right column, last card

#

even though the setup fails, the subscription becomes 'trialing'

coral lodge
digital herald
#

We handle this already; we've been building subscription logic on top of Stripe for years. I'm specifically asking about handle subscriptions becoming 'trialing' even though the setup intent fails.

#

We do re-use the created subscription if user is still on session. But if the customer leaves and comes back later, they end up creating another subscription.

If the setup intent for that subscription goes through successfully, the card is stored at the customer level.

Which causes both subscriptions to be charged after trial ends.

coral lodge
#

Ok. I believe the doc has also provide details on how to handle this scenario, have you tried it?

digital herald
digital herald
#

Only the positive scenario is there. In my scenario, it continues to fail and the customer leaves

#

idk, it's weird, Stripe manages to block these subscriptions within Stripe Checkout, there no subscription is created when 3D secure fails

#

maybe the issue is we're creating the subscription first and then handling the payment/setup intent?