Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT solution for react google pay button #301

Open
devalensio opened this issue Sep 6, 2024 · 5 comments
Open

JWT solution for react google pay button #301

devalensio opened this issue Sep 6, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@devalensio
Copy link

devalensio commented Sep 6, 2024

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.

@devalensio devalensio added the enhancement New feature or request label Sep 6, 2024
@dmengelt
Copy link
Member

dmengelt commented Sep 9, 2024

@devalensio thanks for reporting this. you have a very good point 😉 we will look into it...

@dmengelt dmengelt self-assigned this Sep 9, 2024
@devalensio
Copy link
Author

Thanks for the response @dmengelt really looking forward to the feature, as of now, I'm considering using the Google Pay script and passing the data manually. However, I would prefer to use a React button library for our Google Pay integration.

@dmengelt
Copy link
Member

Yes. For now you would need to integrate using pay.js directly.

@devalensio
Copy link
Author

can I contribute to the project for this feature @dmengelt ?

@dmengelt
Copy link
Member

dmengelt commented Sep 11, 2024

@devalensio yes of course! A couple of thoughts:

  • Make sure to first update the Google Pay types to support authJwt and merchantOrigin
  • Please update all the different implementation is this repo (not only the React one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants