I'm having issues implementing the 3D secure flow for returning customers using the BlueSnap API(https://developers.bluesnap.com/docs/3-d-secure-for-api#section-3-d-secure-with-returning-shoppers). The issue is that the setup-callback doesn't seem to trigger.
Running the following code, only "3DS: Start" and "3DS: BlueSnap initiated" will show up in the logs:
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");
});
Why is the callback never called?
It's a little confusing, but the callback of the setup function does not get called on setup complete. It is called after you click submit and the 3DS flow is completed (it is used to return the final result to you). So try to continue with the flow and call bluesnap.threeDsPaymentsSubmitData() and then check if the callback is called.