Skip to content

A sample app showing how to use the Tipsi-Stripe library for handling payments in React Native with a Lumen PHP backend.

Notifications You must be signed in to change notification settings

anchetaWern/RNPay

Repository files navigation

RNPay

A sample app showing how to use the Tipsi-Stripe library for handling payments in React Native with a Lumen PHP backend.

You can read the tutorial at: Accepting payments in React Native

Prerequisites

Getting Started

  1. Clone the repo:
git clone https://github.com/anchetaWern/RNPay.git
  1. Install the dependencies:
cd RNPay
yarn install
react-native eject
react-native link
  1. Create a new Lumen project:
composer create-project --prefer-dist laravel/lumen RNPayBackend
  1. Copy the files from the server/RNPayBackend directory to the newly generated RNPayBackend folder.

  2. Create the rnpay database with a MySQL database manager of your choice.

  3. Update the .env file with the database config and Stripe secret key:

DB_USERNAME=YOUR_DB_USER
DB_PASSWORD=YOUR_DB_PASSWORD
STRIPE_SECRET_KEY=YOUR_STRIPE_SECRET_KEY
  1. Run the migration:
php artisan migrate
  1. Expose the server with ngrok:
ngrok http -host-header=rewrite rnpay.test:80
  1. Go inside the RNPay directory and update the .env file with your Stripe publishable key:
STRIPE_PUBLISHABLE_KEY=YOUR_STRIPE_PUBLISHABLE_KEY
  1. Update the src/helpers/pay.js file with your ngrok URL:
const endpoint = 'https://YOUR_NGROK_URL/charge';
  1. Run the app:
react-native run-android

Built With

Donation

If this project helped you reduce time to develop, please consider buying me a cup of coffee :)

Buy Me A Coffee

About

A sample app showing how to use the Tipsi-Stripe library for handling payments in React Native with a Lumen PHP backend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published