Giter Club home page Giter Club logo

rnpay's Introduction

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

rnpay's People

Contributors

anchetawern avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.