Hello wekas,
Hope you are doing good.
Actually, I am also supposed to do the google pay integration in an ionic mobile application in react using capacitor. I have installed the capacitor-community/stripe plugin and then run sync using following commands:
npm install @capacitor-community/stripe
and run sync
And then I used āCapacitorStripeProviderā to initialize the plugin like so:
import { CapacitorStripeProvider } from ā@capacitor-community/stripe/dist/esm/react/providerā;
const App: React.FC = () => (
<CapacitorStripeProvider
publishableKey=āYour Publishable Keyā
fallback={
Loadingā¦
}
<IonApp>
...
</IonApp>
);
export default App;
And then, I followed the official docs of capacitor-community/stripe to implement the Google Pay functionality. I did everything mentioned there. Called different methods such as isGooglePayAvailable, createGooglePayAvailable and presentGooglePayAvailable.
There are several issues that Iām facing after running the code for GooglePay Integration.
1.) On certain android devices, Iām getting a message that says āNot implemented on deviceā being logged in the console window from the isGooglePayAvailable method even though I have Gpay app installed and logged in in my android device. On other devices, isGooglePayAvailable methods executes successfully and returns resolve: void response.
2.) Also, after having called presentGooglePay method, my android app crashes and I am returned to the home screen of my android device. Also, I am getting native Stripe.presentGooglePay being logged in the console window but Iām not able to see any āresult Stripe.presentGooglePayā in the console window.
Also, Iām getting an error in the logcat of Android Studio that says:
Caused by: java.lang.IllegalStateException: presentForPaymentIntent() may only be called when Google Pay is available on this device.
I know all of this must have been quite confusing and cryptic as well to comprehend. So, it would be better if you could provide me your contact details (an email id or anything as such would do), so that I could better make my points clear and screen share to show you the code that Iāve used and the errors that Iām getting.
Thanks,
Rahul