如何测试 google pay 3d 安全流程

问题描述 投票:0回答:1

目前我正在使用 Braintree 来集成 google pay。我已经完成了所需的所有代码更改。我已经加入google提供的测试卡组进行测试了
但我需要测试 3d 安全卡的流程。目前测试卡套装中的所有卡都不是 3D 安全的。我如何测试这个流程?当我尝试从 Braintree 或其他来源添加卡片时,它给我错误代码 OR-CCSEH-21。

尝试加入谷歌测试卡组。但它不包括任何具有 3d secure 的卡。

javascript payment-gateway braintree google-pay
1个回答
0
投票

如果您使用其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的示例。

© www.soinside.com 2019 - 2024. All rights reserved.