1000 = USD 10.00):{
"accountId": "acc-example",
"paymentInstrumentId": "payment-instrument-example",
"amount": 1000,
"type": "pull",
"channel": "online",
"method": "card"
}id. If the status is awaiting_authentication and authentication.type is stripe_three_d_secure, continue to Step 3. Otherwise, handle the returned status as described in Step 4.{
"id": "transaction-example",
"status": "awaiting_authentication",
"authentication": {
"type": "stripe_three_d_secure",
"clientSecret": "pi_example_secret_example",
"publishableKey": "pk_test_example",
"stripeConnectedAccountId": "acct_example"
}
}npm install @stripe/stripe-jsconst { authentication } = transaction
const { loadStripe } = await import('@stripe/stripe-js/pure')
const stripe = await loadStripe(authentication.publishableKey, {
stripeAccount: authentication.stripeConnectedAccountId,
locale: 'en',
})
if (!stripe) {
throw new Error('Unable to load Stripe')
}
const { error } = await stripe.handleNextAction({
clientSecret: authentication.clientSecret,
})
if (error) {
throw new Error(error.message || 'Payment authentication failed')
}id from Step 2:succeeded: Complete the order.pending: Wait and query again.awaiting_authentication: Authentication has not completed or the result has not yet synchronized. If Stripe already reports success, wait and query again.failed: Display failureMessage or failureCode, when provided.