StripeInvalidRequestError:无法捕获此PaymentIntent,因为它的状态为requires_ payment_method

问题描述 投票:0回答:1

我正在集成条带终端,并且遵循以下步骤:

步骤1:

stripe.paymentIntents.create({
    currency: 'usd',
    payment_method_types: ['card_present'],
    capture_method: 'manual',
    amount: 1000,
})

Response : success with status 'requires_payment_method'

第2步:

stripe.terminal.readers.processPaymentIntent({
    'reader_id',
    'payment_intent'
})

Response : success with status 'in_progress'

步骤3:

stripe.terminal.readers.retrieve({'reader_id'});

Response : success with status 'in_progress'

步骤4:

stripe.paymentIntents.retrieve({'payment_intent'});

Response : success with status 'requires_payment_method'

步骤5:

stripe.paymentIntents.capture('{payment_intent}')

Response : error with status 'requires_payment_method'

Error : 'This PaymentIntent could not be captured because it has a status of requires_payment_method. Only a PaymentIntent with one of the following statuses may be captured: requires_capture.',

以下文档链接:https://stripe.com/docs/terminal/ payments/collect- payment

node.js terminal stripe-payments
1个回答
0
投票

您使用的是模拟阅读器吗?如果是,在第 2 步检索后,您需要使用 stripe.terminal.Reader.TestHelpers.present_ payment_method 。然后继续执行其余步骤。

© www.soinside.com 2019 - 2024. All rights reserved.