Skip to content

RambokDev/stripe-tap-to-pay-react-native

Repository files navigation

Contributors LinkedIn


Logo

Stripe Tap to pay React Native

PoC that demonstrates the usage of Tap to Pay provided by Stripe React native SDK.


video.mp4

Getting Started

This is an example of how you can use the Tap to Pay provided by Stripe SDK with React Native and Expo.

Prerequisites

First, install npm on your computer.

npm install npm@latest -g

Installation

Follow this different steps in order to reproduce the demonstration

  1. Clone the repository
    git clone https://github.com/RambokDev/stripe-tap-to-pay-react-native.git
  2. Install NPM packages
    npm install
  3. Enter your API url in app.config.js
    apiUrl: process.env.API_URL ?? 'https://your-api-url/'

(back to top)

Usage

1. Pre-build

npx expo prebuild

2. Run your app

 npx expo run:android

If an error occurred, you may add 'local.properties' file in android folder with the following code :

 sdk.dir = /xxxxx/userxxxx/Library/Android/sdk

or you can set an environment variable :

 export ANDROID_HOME=/xxxxx/userxxxx/Library/Android/sdk

3. Build your app :

With expo services

 eas build -p android --profile preview  

Locally

 eas build -p android --profile preview --local 

Example of app.config.js


module.exports = ({config}) => {
    return {
        ...config,
        extra: {
            apiUrl: process.env.API_URL ?? 'https://www.api-example.com/',
            eas: {
                projectId: "xxxxxxx"
            },
            runtimeVersion: {
                policy: "sdkVersion"
            },

        }
    }
}

(back to top)

About

This is a POC that is using tap to pay technology, provided by stripe SDK for react native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors