#damdeez - Stripe React - Android

1 messages ยท Page 1 of 1 (latest)

proper mango
#

Hi ๐Ÿ‘‹
Let me look into this for a little bit

bright perch
#

Great, thanks!

proper mango
#

just to help me clarify, are we talking about React Native?

bright perch
#

Not React Native but just React on Web

proper mango
#

๐Ÿ‘

#

Would you be able to share the code you are using to instantiate the PaymentRequestButtonElement?

bright perch
#

I could send snippets

#

The entire thing is spread over multiple files

#

But basically we first create a paymentRequest

#
      const pr = stripe.paymentRequest({
        country: 'US',
        currency: currency,
        total: {
          label: selectedOption.title,
          amount: centsValue,
        },
        requestPayerName: true,
        requestPayerEmail: true,
      });

      void pr.canMakePayment().then((result) => {
        if (result) {
          const typeOfWallet: string = result.applePay
            ? 'applePay'
            : result.googlePay
            ? 'googlePay'
            : 'microsoftPay';
          setWalletType(typeOfWallet);
          setPaymentRequest(pr);
        }
      });```
#

And then we just send it to the child component which has the PaymentRequestButtonElement <PaymentRequestButtonElement options={{ paymentRequest }} onClick={handleMobileWalletButtonClick} />

#

handleMobileWalletButtonClick is just a function we do analytics with

#

Other than this Android Pay issue, the button functions fine for us on our web views as well as non webviews

proper mango
#

Hey sorry for the long wait. There's been some history going back on this.

bright perch
#

NP, appreciate your help

lusty elbow
#

@bright perch I'm hopping in! Give me a minute to catch up

#

From my understanding, yes, this is a limitation of Android webviews that they don't support Google Pay. The expectation is that if you have a user that needs to go through a google pay flow on a mobile device you should direct them to an app w/ a native google pay integration, or the chrome browser

bright perch
#

Thank you, appreciate your help.