【问题标题】:Google Pay with Moneris in Angular在 Angular 中使用 Moneris 进行 Google Pay
【发布时间】:2020-11-30 18:11:13
【问题描述】:

我正在尝试使用 Moneris Gateway 实施 Google Pay。我正在使用 Google-Pay-button-Angular 但如何将 Moneris 与此连接? this link有教程但是不知道在哪里写脚本代码。

【问题讨论】:

    标签: angular google-pay


    【解决方案1】:

    如果你使用@google-pay/button-angular,那么你应该在tokenizationSpecification中指定Moneris gateway properties

    例子:

    tokenizationSpecification: {
      type: 'PAYMENT_GATEWAY',
      parameters: {
        gateway: 'moneris',
        gatewayMerchantId: '<moneris merchant id>'
      }
    }
    

    更完整的例子:

    <google-pay-button
      environment="TEST"
      buttonType="buy"
      buttonColor="black"
      [paymentRequest]="{
        apiVersion: 2,
        apiVersionMinor: 0,
        allowedPaymentMethods: [
          {
            type: 'CARD',
            parameters: {
              allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
              allowedCardNetworks: ['AMEX', 'VISA', 'MASTERCARD']
            },
            tokenizationSpecification: {
              type: 'PAYMENT_GATEWAY',
              parameters: {
                gateway: 'moneris',
                gatewayMerchantId: '<moneris merchant id>'
              }
            }
          }
        ],
        merchantInfo: {
          merchantId: '12345678901234567890',
          merchantName: 'Demo Merchant'
        },
        transactionInfo: {
          totalPriceStatus: 'FINAL',
          totalPriceLabel: 'Total',
          totalPrice: '100.00',
          currencyCode: 'USD',
          countryCode: 'US'
        }
      }"
      (loadpaymentdata)="onLoadPaymentData($event)"
    ></google-pay-button>
    
    // handle the event
    onLoadPaymentData(event) {
      // call your backend server to process the payment including details from event.detail
    }
    

    【讨论】:

    • 感谢您的帮助。上面的链接中不需要 MonerisGooglePay 功能吗?
    • 这些是不同的集成。如果您使用的是 Moneris API(即https://esqa.moneris.com/googlepay/googlepay-api.js),那么您应该参考他们的文档。上面的答案是@google-pay/button-angular
    • 我正在关注这个 (developer.moneris.com/Documentation/NA/E-Commerce%20Solutions/…) 文档。在 Angular 上实现是否正确?如果是,在哪里添加步骤 2,3 和 4?
    • 如果您遵循 Moneris 指南,那么您不应该使用 Angular 组件,因为我认为它负责为您创建按钮。第 2 步和第 3 步将进入您页面的 HTML。第 4 步将进入您的 JS 文件或 script 标记。
    • 如果我使用Angular组件,那么我不需要添加moneris脚本和web-merchant-key?
    猜你喜欢
    • 2011-04-25
    • 1970-01-01
    • 2019-08-23
    • 2018-06-25
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    • 2020-05-05
    • 1970-01-01
    相关资源
    最近更新 更多