我在 Braintree 担任开发人员。如果您的服务器和客户端代码是integrated properly,则客户端上的verify3DS() 方法返回的nonce 应该与最初在您的服务器上生成的不同。
服务器端:使用支付方式的令牌在您的服务器上生成支付方式随机数。
// Generate a nonce for the payment method on your server
var result = gateway.PaymentMethodNonce.Create("PaymentMethodToken");
var nonce = result.Target.Nonce;
注意:我正在努力在我们的documentation 中包含这样的代码 sn-ps,以防止将来对如何在服务器上生成 nonce 产生混淆。
客户端:使用来自服务器的 nonce 验证卡。然后使用客户端的 nonce 来完成交易。
var paymentMethodNonce = 'nonce_from_server';
client.verify3DS({
amount: 500,
creditCard: paymentMethodNonce
}, function (error, response) {
if (!error) {
// 3D Secure finished.
// Use nonce in response to create transaction. This should be different from the nonce created on your server.
// console.log(response.nonce);
} else {
// Handle errors
}
});
关于您关于责任转移的问题,3D-Secure 协议可以将欺诈责任从您作为商家转移到发卡机构depending on which parties participate in 3D-Secure。
回调中的响应对象包含有关责任是否转移或给定付款方式是否可能转移责任的详细信息。
client.verify3DS({
amount: 500,
creditCard: paymentMethodNonce
}, function (error, response) {
if (!error) {
// Response will also include liability shift details for you to use
// console.log(response.verificationDetails);
} else {
// Handle errors
}
});
我建议重新访问what to do with the liability shift response values 上的文档。希望对您有所帮助!