Skip to content

JWT solution for react google pay button #301

@devalensio

Description

@devalensio

Is your feature request related to a problem? Please describe.

Yes, the problem is that the current Google Pay Button implementation in React does not allow the use of the JWT solution provided by the Google Pay API for Web. This solution is crucial for platform partners who manage more than 100 web domains, as it allows the integration of Google Pay without registering individual web domains in the Google Pay & Wallet Console. Specifically, there is no support for passing the authJwt and merchantOrigin parameters in the merchantInfo object, which are necessary for using JWT.

Describe the solution you'd like

Please add support for authJwt and merchantOrigin in the merchantInfo object in the Google Pay Button for React. This would allow developers to use the JWT solution directly in their payment requests.

<GooglePayButton
  environment="TEST"
  paymentRequest={{
    apiVersion: 2,
    apiVersionMinor: 0,
    allowedPaymentMethods: [
      {
        type: 'CARD',
        parameters: {
          allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
          allowedCardNetworks: ['MASTERCARD', 'VISA'],
        },
        tokenizationSpecification: {
          type: 'PAYMENT_GATEWAY',
          parameters: {
            gateway: 'example',
            gatewayMerchantId: 'exampleGatewayMerchantId',
          },
        },
      },
    ],
    merchantInfo: {
      merchantId: '12345678901234567890',
      merchantName: 'Demo Merchant',
      // Add support for these fields:
      // authJwt: 'aaaaa.bbbbb.ccccc',
      // merchantOrigin: 'sub-merchant.com',
    },
    transactionInfo: {
      totalPriceStatus: 'FINAL',
      totalPriceLabel: 'Total',
      totalPrice: '100.00',
      currencyCode: 'USD',
      countryCode: 'US',
    },
  }}
  onLoadPaymentData={paymentRequest => {
    console.log('load payment data', paymentRequest);
  }}
/>

Describe alternatives you've considered A clear and concise description of any alternative solutions or features
you've considered.

Additional context Add any other context or screenshots about the feature request here.

Adding support for authJwt and merchantOrigin will significantly ease the integration process for platform partners using the JWT solution. This feature is particularly beneficial for developers who manage multiple sub-merchants under one platform, simplifying the onboarding process and reducing the need to register each domain separately.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions