在 BlueSnap 中为回头客设置 3-D 安全

Setting up 3-D secure for returning shoppers in BlueSnap

我在使用 BlueSnap API(https://developers.bluesnap.com/docs/3-d-secure-for-api#section-3-d-secure-with-returning-shoppers) 为回头客实施 3D 安全流程时遇到问题。问题是设置回调似乎没有触发。

运行以下代码,只有“3DS: Start”和“3DS: BlueSnap initiated”会出现在日志中:

console.log("3DS: Start");

if (typeof (window as any).bluesnap !== "object") {
throw new Error("Bluesnap not initiated!");
}

console.log("3DS: BlueSnap initiated");

(window as any).bluesnap.threeDsPaymentsSetup(
threeDSPaymentsToken, // token retrieved using the JSON API
(resp: any) => {
console.log("3DS: Setup");
});

为什么从未调用回调?

这有点令人困惑,但是设置函数的回调不会在设置完成时被调用。点击提交,3DS流程完成后调用(用于return最终结果给你)。所以尝试继续流程并调用 bluesnap.threeDsPaymentsSubmitData() 然后检查回调是否被调用。