question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

None of my physical device or emulator/simulator is accepting `isGooglePaySupported`

See original GitHub issue

I’ve tried in 3 different android real device and iPhone 11 and none have accepted the support. Is it correct? tested on expo and bare react native CLI

import { StripeProvider, useGooglePay } from "@stripe/stripe-react-native";

function PaymentScreen() {
   const { isGooglePaySupported } = useGooglePay();
   if (!(await isGooglePaySupported({ testEnv: true }))) {
        Alert.alert("Google Pay is not supported.");
        return;
        
         const { error } = await initGooglePay({
            testEnv: true,
            merchantName: "anything",
            countryCode: "US",
            billingAddressConfig: {
              format: "FULL",
              isPhoneNumberRequired: true,
              isRequired: false,
            },
            existingPaymentMethodRequired: false,
            isEmailRequired: true,
          });

    if (error) {
      console.log(error.code, error.message);
      return;
    }
  }
  ...
}

function App() {
  return (
    <StripeProvider publishableKey="pk_test_xxx"  ...>
      <PaymentScreen />
    </StripeProvider>
  );
}

If I comment the conditional code the initGooglePay throws this error

[TypeError: _NativeStripeSdk.default.initGooglePay is not a function. (In '_NativeStripeSdk.default.initGooglePay(params)', '_NativeStripeSdk.default.initGooglePay' is undefined)]

otherwise isApplePaySupported its ok!

Which phones accept google payment?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
charliecruzan-stripecommented, Jun 10, 2022

We are relying on stripe-android’s GooglePayPaymentMethodLauncher and returning the result of that, so I think that either there is missing app setup, or missing device setup for Google Pay.

If this only happens in production, it could be that one of these steps is unfinished

0reactions
charliecruzan-stripecommented, Jun 22, 2022

@gabrielew I’m going to close this since we’re simply passing this result along, I don’t believe it’s an issue with stripe-react-native

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix problems with contactless payments - Google Pay Help
Step 1: Check your contactless payment set up · ​Under “NFC,” tap Contactless payments and then Payment default. · Make sure "Google Pay"...
Read more >
Testing on Emulators vs Simulators vs Real Devices
Testing on mobile devices is key! Read this article to identify the difference between Emulators vs Simulators vs Real Devices.
Read more >
updating Google play services in Emulator - android
Try to navigate to settings--> apps in your emulator and then find Google Play Services. Check the version number and use it in...
Read more >
What is Google Wallet, and how do you use it? - Pocket-lint
However, to pay in stores using Google Pay, your phone must support NFC (near-field communication) and HCE (host card emulation).
Read more >
Google Pay FAQ - Aerospace Federal Credit Union
Google Pay relies on a form of NFC called Host Card Emulation (HCE). This technology does not require access to a secure element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found