目前我正在使用 Braintree 来集成 google pay。我已经完成了所需的所有代码更改。我已经加入google提供的测试卡组进行测试了
但我需要测试 3d 安全卡的流程。目前测试卡套装中的所有卡都不是 3D 安全的。我如何测试这个流程?当我尝试从 Braintree 或其他来源添加卡片时,它给我错误代码 OR-CCSEH-21。
尝试加入谷歌测试卡组。但它不包括任何具有 3d secure 的卡。
如果您使用其Drop-In 集成Braintree 会自动为非标记化 Google Pay 卡触发 3DS:
var button = document.querySelector('#submit-button');
braintree.dropin.create(
{
authorization: 'abcd1234', // <-- 1. needs a client token! (Tokenization keys can't be used)
threeDSecure: true, // <-- 2. enable 3DS
selector: '#dropin-container',
googlePay: {
googlePayVersion: 2,
merchantId: 'merchant-id-from-google',
transactionInfo: {
totalPriceStatus: 'FINAL',
totalPrice: '123.45',
currencyCode: 'EUR',
countryCode: 'DE',
},
allowedPaymentMethods: [
{
type: 'CARD',
parameters: {
billingAddressRequired: true,
billingAddressParameters: {
format: 'FULL',
},
},
},
],
button: {
buttonType: 'buy',
},
},
},
function (err, dropinInstance) {
function sendNonceToServer() {
dropinInstance.requestPaymentMethod(
{
threeDSecure: threeDSecureParameters, // <-- 3. pass your 3DS params
},
function (err, payload) {
if (err) {
// Handle errors
}
// Send payload.nonce to your server
}
);
}
button.addEventListener('click', sendNonceToServer);
dropinInstance.on('paymentMethodRequestable', function (event) {
if (event.paymentMethodIsSelected) {
// The customer has completed the flow and we are
// ready to submit the payment method nonce to the server.
sendNonceToServer();
}
});
}
);
您可以在此处
找到
threeDSecureParameters
的示例。