所有非本次会话的支付将被拒绝,网络拒绝代码为59

前端开发 2026-07-09

我有一个流程,无法通过无交互扣款完成全额扣款,银行会因 Failure code: card_declinednetwork_decline_code: 59 而拒绝。

  1. 客户通过结账购买商品。结账链接会包含 payment_intent_data.setup_future_usage: off_session
  2. 支付确认后我触发事件 payment_intent.succeeded,并据此在我方保存 customer_id and payment_method,以便在 X 天后修改全额支付。
  3. X 天后,创建一个 payment_intent,其中包含 full_amount,并在收到 payment_intent.succeededoff_session: true , confirm: true 之后保存相同的 payment_method and customer_id

但我的所有扣款都因上述失败代码和network_decline_code而被拒绝。

下面你可以找到我用于结账和无交互扣款意图的代码。

// Checkout
await stripeClient.checkout.sessions.create({
        success_url:successUrl,
        mode:'payment',
        line_items:line_items,
        payment_method_types:['card'],
        customer_creation:'always',
        payment_intent_data:{
            setup_future_usage:'off_session',
            metadata:{
                phase:"checkout_initial",
            },
        },
        allow_promotion_codes:true,
        currency:currency,
        billing_address_collection:'required',
        shipping_address_collection:{
            allowed_countries:['US']
        },
        phone_number_collection:{
            enabled:true,
        },
        invoice_creation:{
            enabled:true
        }
    })






// payment intent
 await stripeClient.paymentIntents.create({
    amount: amountPending,
    currency: currency,
    customer: stripeCustomerId,
    payment_method: stripePaymentMethodId,
    off_session: true,
    confirm: true,
    metadata: {
        phase: 'full_charge'
    }
});

解决方案

network_decline_code 59 表示银行将扣款判定为意外情况,通常是因为无交互扣款的金额超过在结账时原始授权的金额。

需要修复两点:

1.将支付方式显式绑定到客户账户。payment_intent.succeeded 保存的ID并不能保证已绑定。请使用 stripe.paymentMethods.retrieve(id) 进行核验,并检查 customer 字段。

2.切换到 setup 模式的结账。 在支付意向上使用 setup_future_usage: off_session 对银行而言是模糊的。专用的设置模式结账可以明确表示保存卡信息的意图,从而降低后续无交互扣款被标记的概率。

await stripeClient.checkout.sessions.create({
    mode: 'setup',  // instead of 'payment'
    ...
})

随后再对保存的支付方式单独扣取全额金额。

站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章