I’m integrating Stripe Google Pay in ReactNative app, when i’m declaring usePlatformPay in my code so getting error like undefined is not a function

I am using version “@Stripe/Stripe-react-native”: “0.18.1” but I am not getting any props for that platform.

import React, {useEffect, useState } from 'react';

import { StripeProvider, usePlatformPay } from '@stripe/stripe-react-native';

export default function GooglePayGateway() { const { isPlatformPaySupported } = usePlatformPay();

useEffect(() =\> { (async function () { if (!(await isPlatformPaySupported({ googlePay: {testEnv: true} }))) { alert('Google Pay is not supported.'); return; } })(); }, \[\]);

return ( \<StripeProvider publishableKey={'\*\*\*\*\*\*'} merchantIdentifier="merchant.identifier" // required for Apple Pay urlScheme="your-url-scheme" // required for 3D Secure and bank redirects \\\> \</StripeProvider\> ); }

Can you help me in setting up Google Pay with stripe?

  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a minimal reproducible example.

    – 
    Bot

Leave a Comment