Integration of Stripe in a react-native app.
-
Clone down the repository
-
Install the dependencies on the client-side
npm install
in the client directory
-
Start all the microservices by running the following command in server directory
docker-compose up
With this command,
docker
will also install all the required dependencies in the API gateway and in each microservice, which are all individually served in a docker container. -
Start the app
react-native run-android
react-native run-ios
- You can create a Stripe account in case you don't have any.
- If you already have one, you need to provide your
Publishable key
andSecret key
in the project. You can find these in the Dashboard page of your Stripe account. - After you find the
Secret
andPublishable
keys, you need to do the following: In server directory, create an.env
file and provide the following value:STRIPE_SECRET_KEY=*YOU_SECRET_KEY_HERE*
. - In config.js file located in the client directory, replace the
STRIPE_PUBLISHABLE_KEY
value of the JSON with your own publishable key value. - In the same config.js file, change the
IP_ADDRESS
value with your machine's IP address.
Your config.js file in the client directory should look like this:
If you run into issues starting the app, please refer to the React Native docs. It's most likely a problem with your environment.