Create chargeable stripe tokens using Apple and Google Pay.
This plugin will give you easy access to the Apple and Google Pay payment sheets. And provide one-time source tokens that are used to create a Stripe Charge.
Setup
Both (Required)
To begin one will need a Stripe project, from there collect a publishable key.
iOS (Required)
On the Apple Developer portal, one will need to create a merchant identifier. Then connect that identifier to the Stripe project.
From the Stripe dashboard, create a signing certificate to share with Apple, then upload the signed certificate to Stripe.
Lastly, open the apps' iOS module. Add the newly created identifier to the project's signing capabilities.
Android (Optional)
On the Google Play console, add the merchant identifier to the app capabilites. This makes the merchant known to Google Pay. With it, users will not see a warning saying this app is an unidentified merchant.
Functions
Set Publishable Key
Prior to calling native pay, set the publishable key.
On iOS the payment sheet spins and ends with a check or X depending on the result passed in. During the spinning, query an endpoint for a charge using the token. This function does not affect Android.
// call charge endpoint w/ tokenconst wasCharged = awaitAppAPI.charge(token, amount);
// then show success or failureStripeNative.confirmPayment(wasCharged);