Разрешение отклонения платежа при двухфакторной аутентификации - PullRequest
0 голосов
/ 29 апреля 2020

В соответствии с их платежами по карте без банковской аутентификации выполняются c, я знаю, что для приема одноразовых платежей мы можем отклонить карты, требующие двухфакторной аутентификации, включив свойство error_on_requires_action.

Что я хочу?

Та же функция для периодической оплаты подписки? В их подписках с карточными платежами не указывается c, как включить отклонение карты для двухфакторной аутентификации.

карточные платежи без банковской аутентификации:

let intent = await stripe.paymentIntents.create({
      amount: 1099,
      currency: 'usd',
      payment_method: request.body.payment_method_id,

      // A PaymentIntent can be confirmed some time after creation,
      // but here we want to confirm (collect payment) immediately.
      confirm: true,

      // If the payment requires any follow-up actions from the
      // customer, like two-factor authentication, Stripe will error
      // and you will need to prompt them for a new payment method.
      error_on_requires_action: true
    });

Подписки с карточными платежами:

const customer = await stripe.customers.create({
  payment_method: intent.payment_method,
  email: 'jenny.rosen@example.com',
  invoice_settings: {
    default_payment_method: intent.payment_method,
  },
});

const subscription = await stripe.subscriptions.create({
  customer: customer.id,
  items: [{ plan: "plan_FSDjyHWis0QVwl" }],
  expand: ["latest_invoice.payment_intent"]
});
...