Skip to content

Commit 24e73ec

Browse files
committed
Add env.example, LICENSE, and updated README
1 parent 674b781 commit 24e73ec

3 files changed

Lines changed: 65 additions & 10 deletions

File tree

‎.env.example‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_PAYSTACK_PUBLIC_KEY=

‎LICENSE.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 PaystackOSS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
# Getting Started with Paystack and React
22

3-
This is the code for the app written in the Getting Started with Paystack and React App.
3+
This repository includes an sample application that shows how to integrate Paystack payments to your React apps.
44

5-
## Getting Started
5+
The sample app is a simple checkout form to purchase an item and check out using the [Paystack Popup](https://paystack.com/docs/payments/accept-payments/#popup) checkout. It uses [iamraphson's](https://github.com/iamraphson) [react-paystack](https://github.com/iamraphson/react-paystack) library.
66

7-
### Demo
8-
View a live demo of the app [here](https://google.com)
7+
The library offers 3 integration methods:
8+
- [Using hooks](https://github.com/iamraphson/react-paystack#1-using-the-paystack-hook)
9+
- [Using a `<PaystackButton/>` component](https://github.com/iamraphson/react-paystack#2-using-the-paystack-button)
10+
- [Using the Context API](https://github.com/iamraphson/react-paystack#3-using-the-paystack-consumer)
11+
12+
This sample uses the `<PaystackButton/>` component, but you can swap it out for any of the other methods. All 3 methods will bear the same results
13+
14+
15+
## Demo
16+
17+
View a live demo of the app [here](https://react-paystack-guide.netlify.app/)
18+
19+
## Get Started
20+
21+
1. Clone this repo:
22+
```git clone https://github.com/PaystackOSS/sample-react.git```
23+
24+
2. Navigate to the root directory and install dependencies
25+
```yarn install```
26+
27+
## Usage
28+
29+
1. Rename the `.env.example` file to `.env` and add your Paystack public key:
30+
31+
```REACT_APP_PAYSTACK_PUBLIC_KEY=pk_domain_xxxxxx```
32+
33+
2. Start the application
34+
35+
```yarn start```
36+
37+
3. Visit http://localhost:3000 in your browser, if React doesn't automatically open it for you. You should now see your checkout form, and be able to make a purchase.
38+
39+
**Note**: This is a simple client-side integration, that uses a callback to perform post-payment logic. For a more stable, robust solution, you should use webhooks to listen for transaction success and perform any post-payment logic on your server.
40+
41+
42+
## Contributing
43+
If you notice any issues with this app, please [open an issue](https://github.com/PaystackOSS/sample-react/issues/new). PRs are also more than welcome, so feel free to [submit a PR](https://github.com/PaystackOSS/sample-react/compare) to fix an issue, or add a new feature!
44+
45+
## License
46+
47+
This repository is made available under the MIT license. Read [LICENSE.md](https://google.com) for more information.
948

10-
### Development
11-
To run locally, clone/download the repo, then `cd` into the app folder and run
12-
```
13-
yarn install
14-
yarn start
15-
```

0 commit comments

Comments
 (0)