Welcome to the Payment API! This project demonstrates how to integrate PayPal API for online payments. Below are some useful links and information.
- Features
- Technologies Used
- Pre-Requisites
- Installation
- PayPal API Integration
- Setup PayPal Sandbox Account
- Usage
- Troubleshooting
- Legal
- Author
- Contributing
- License
- Initiate PayPal payments securely.
- Handle payment success and cancellation scenarios.
- Simple frontend interface for payment initiation.
- Node.js
- Express.js
- PayPal REST SDK
- HTML
- CSS
- JavaScript
Before getting started, ensure you have the following:
- PayPal Sandbox Account (for testing purposes)
- Node.js installed on your machine
- Basic understanding of JavaScript and HTTP concepts
Follow these steps to install and run the project locally:
- Clone the repository to your local machine.
- Install dependencies using
npm install
. - Configure PayPal credentials in the
.env
file: - Start the server using
npm start
. - Open your browser and visit http://localhost:3000.
This project uses PayPal's REST API to facilitate payment transactions securely.
To obtain PayPal sandbox credentials:
- Visit PayPal Developer.
- Log in with your PayPal account or create a new one.
- Navigate to My Apps & Credentials and create a new sandbox app.
- Obtain
CLIENT_ID
andCLIENT_SECRET
from the sandbox app dashboard. - Use these credentials in your
.env
file as shown in the Installation section.
- Click "Pay with PayPal" on the webpage to initiate a payment.
- Log in to your PayPal sandbox account when prompted.
- After payment approval or cancellation, you'll be redirected to appropriate pages.
- Ensure your PayPal sandbox credentials are correctly configured.
- Check server logs (
console.log
) for any errors or issues during payment initiation. - Review PayPal's API documentation for troubleshooting specific errors.
Bhumika Bhatt
Feel free to contribute by submitting issues or pull requests. If you have any suggestions or improvements, let us know!
This project is licensed under the MIT License - see the License file for details.
By using PayPal's services, you agree to abide by PayPal's Developer Agreement.