Skip to content

freeman-industries/react-native-payments-example-ios

Repository files navigation

react-native-payments-example-ios

Clone this to try using react-native-payments on iOS.

Setup

npm install

cd ios
pod install


npm run ios

It works! What now?

Add it to your app!

Check out the full documentation at https://github.com/naoufal/react-native-payments.

Most people add Stripe / Braintree tokenization as a next step.

Stripe

Just add this block to your config object:

const config = [
	{
		supportedMethods: ['apple-pay'],
		data: {
			merchantIdentifier: 'merchant.com.react-native-payments.naoufal',
			supportedNetworks: ['visa', 'mastercard'],
			countryCode: 'US',
			currencyCode: 'USD',
+			paymentMethodTokenizationParameters: {
+				parameters: {
+					gateway: 'stripe',
+					'stripe:publishableKey': 'pk_test_asdfghjkl_qwertyuiop'
+				}
+			}
		}
	}
];

Braintree

Just add this block to your config object:

const config = [
	{
		supportedMethods: ['apple-pay'],
		data: {
			merchantIdentifier: 'merchant.com.react-native-payments.naoufal',
			supportedNetworks: ['visa', 'mastercard'],
			countryCode: 'US',
			currencyCode: 'USD',
+			paymentMethodTokenizationParameters: {
+				parameters: {
+					gateway: 'braintree',
+					'braintree:tokenizationKey': 'sandbox_asdfghjkl_qwertyuiop'
+				}
+			}
		}
	}
];

Raw Apple Pay Token

If you leave out both of the above, you'll instead get an Apple Pay token.

About

Clone this to try using react-native-payments on iOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published