This repository includes a sample backend server for accepting a payment using Paystack Redirect and the official Paystack Node.js SDK. Follow the accompanying tutorial to learn how to use the server.
Note: No accompanying frontend is included in this sample, as the tutorial uses Postman to pass data to the server. In a future tutorial, we'll build a complete integration by adding a frontend to interact with this server.
- Clone this repo:
git clone https://github.com/PaystackOSS/sample-redirect.git
- Navigate to the root directory and install dependencies
cd sample-redirect
npm install
- Rename the
.env.example
file to.env
and add your Paystack secret key:
PAYSTACK_SECRET_KEY=sk_domain_xxxxxx
- Start the application
npm start
- The server should now be running on http://localhost:5000. View the accompanying tutorial to see how you can pass data to the server and initialize a transaction.
If you notice any issues with this app, please open an issue. PRs are also more than welcome, so feel free to submit a PR to fix an issue, or add a new feature!
This repository is made available under the MIT license. Read LICENSE.md for more information.