Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This project is an Express application that implements integration with the PayPal API for payment processing. It provides two routes: one for creating a new PayPal order and another for capturing an existing order.

Prerequisites

Before running the application, make sure you have the following prerequisites:

  • Node.js installed on your machine.
  • Environment variable configuration:
    • PORT: Port on which the application will run.
    • PAYPAL_API: Base URL of the PayPal API.
    • HOST: Domain name or URL of your application.
    • CLIENT: PayPal API client.
    • SECRET: PayPal API secret key.

Usage

npm install
npm run dev

Once the application is up and running, you can access the following routes:

  • GET /create-order: Creates a new PayPal order and returns the order data in JSON format.
  • GET /capture-order?token=<order-token>: Captures an existing PayPal order using the provided order token as a query parameter.
  • GET /cancel-payment: Cancels the payment and redirects to the home page.

About

This project is an Express application that implements integration with the PayPal API for payment processing. It provides two routes: one for creating a new PayPal order and another for capturing an existing order.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages