#nerder_error

1 messages ยท Page 1 of 1 (latest)

silver sleetBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1408486783712366653

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

rigid verge
#

It seems to me that this wasn't the case before (I might be wrong)

#

should I catch this case and handle it separately?

#

this is the relevant piece of code:

try {
//...other stuff...
stripeSub = await this.stripe.subscriptions.update(
        subscription.id,
        {
          expand: ['latest_invoice.payment_intent'],
          proration_behavior: prorationBehavior,
          items: [
            {
              id: subscription.itemId,
              price: newSubscriptionPlan.code,
            },
          ],
          payment_behavior: paymentBehavior,
        },
        {
          stripeAccount: gym.accountId.value,
        },
      );

      const clientSecret = extractClientSecretFromSubscription(stripeSub);

      return {
        //...otherFields,
        clientSecret
      };
} catch(e) {
  throw convertStripeErrorToPaymentSystemError(e as Error);
}
thorny fern
#

๐Ÿ‘‹ issuers will require 3DS verification at their discretion so you'll want to make sure you are prepared for that possibility. Their isn't really a way to predict when and where they will require it.

rigid verge
#

Yes, this I know, but my understanding was that the update will go ahead fine but then it was my responsability to check either in latest_invoice or pending_setup_intent for the relevant client_secret

#

now what it seems to be happening is that when the issuer requires 3DS, stripe.subscription.update launches an exception

#

with en error code subscription_payment_intent_requires_action

#

I'm not sure how this needs to be handled

thorny fern
#

Do you have a req_id I can review?

rigid verge
#

yes one sec

#

req_qfxCHwXmeBcbz4

#

I think I've spotted the problem :S

#

smells like this is caused by error_if_incomplete?

#

damn:

Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.

#

Ok I think this can be closed. Sorry to bother and thanks for the "rubber ducking"

thorny fern
#

No need to apologize and sorry for the delay, juggling a few threads. Glad we could help if only by providing a space to think out loud ๐Ÿ™‚