This repository contains code for integrating Paystack payment gateway into your application.
-
Clone this repository to your local machine:
git clone https://github.com/kobiowuquadri/paystack_integration
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory of the project and add the following variables:PORT=your_port_number MONGODB_URL=your_mongodburl PAYSTACK_BASE_URL=<Paystack API base URL> PAYSTACK_SECRET_KEY=<Your Paystack Secret Key>
-
Run the application:
npm run dev
To initiate a payment, make a POST
request to the /make-payment
endpoint with the following JSON payload:
{
"email": "customer@example.com",
"amount": 5000,
"fullName": "Quadri Kobiowu"
}
The server will respond with a JSON object containing the payment details, including the payment URL.
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.