This purpose of this app is to create subscriptions for the customers using the Stripe Api . This app comprises of two parts--front-end and back-end . The front-end part is developed using react-native and the back-end part is developed using python-flask
The backend developer has to perform some basic operations in the Stripe dashboard which are as follows:
- Create an account in the Stripe.
- Create new Customers , Products and Subscription Plans.
For this app, the backend code has been written using Python-flask framework . The purpose of the backend is to serve as a bridge between Front-end and the Stripe API . The following are the operations performed by the back-end framework:
- List the customers created in the Stripe Dashboard to the front end.
- List the plans that are created in the Stripe Dashboard.
- Create Subscription for the Parameters(Customer-id,Plan(s),Payment method) send from the front-end.
All the API transactions are done using JSON.
The front-end for this app has been developed using react-native framework . It makes use of fetch() to make API Calls to the Python-Flask Server . The following tasks are performed by the front-end :
- Listing the Customers using ListView Component from the JSON.
- Listing the Plans from JSON.
- Displaying available billing-methods.
- Creating Subscription for the Customer selected.
Any obvious errors have to be handled in the front-end part.
Download the .zip of the project using the link and extract the files from the zip in any desired folder.
To set Python development environment, Refer readme.md of https://github.com/sandyavs/GroupTask1/blob/master/README.md
- Using command prompt change the current directory to the project directory/Python_files . For instance , if the current directory is C, then
cd C:/Stripe-Subscription_Payment-master/Python_files
- Copy the keys from keys.txt file in the Command prompt.
- Run the server using the following command :
python app.py
NOTE : Change the last line of app.py to app.run(debug=True,host='0.0.0.0') to make API calls from android device.
- Inside the Project Directory, Run
npm install
- Wait for the installation process to complete.
- Then run
npm start
to run the app. - Scan the QR Code using Expo App.
NOTE : Change the serverURL in App.js and ManageSubscription.js to the Local URL shown in gitBash by expo WITHOUT CHANGING THE DEFAULT PORT(5000).