【发布时间】:2020-08-30 16:31:32
【问题描述】:
我正在尝试在结帐过程中完成 3D 安全身份验证的实施,但是由于 3DS 身份验证需要使用 iframe 将用户重定向到银行 URL 以批准付款的模式弹出窗口,因为没有所有卡都需要 3DS 身份验证,我的问题是如果卡需要,我如何从后端触发模式弹出窗口?
结帐示例
const checkout = async () => {
var status = await foo();
var next = await nextAction();
if(status === 'succeeded') {
// ...more code here...
newSale.save()
.then(() => {
//payment is processed
// ...code and redirect here...
})
.catch(err => console.log(err));
} else if(status === 'awaiting_next_action'){
console.log('3D Secure Authentication required');
console.log(next);
// I need to trigger the modal from the front-end here if needed...
} else if(paymentIntentStatus === 'awaiting_payment_method') {
console.log('The PaymentIntent encountered a processing error. ');
}
}
如上图所示,该 3DS Auth 模式只需要在需要时弹出,否则不得显示。
【问题讨论】:
标签: javascript html css node.js