Skip to content
This repository has been archived by the owner on Oct 27, 2018. It is now read-only.

xthezealot/paypal-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayPal Notifications

PayPal client for IPN (Instant Payment Notification) and PDT (Payment Data Transfer) notifications.

Installation

  1. Get package:

    npm i paypal-notifications -S
  2. Import it in your code:

    const Paypal = require('paypal-notifications')

Setup

Instant Payment Notification

TODO

Payment Data Transfer

  1. Go to Website Payment Preferences
  2. Set the Return URL
  3. Turn the Payment Data Transfer on
  4. Get the Identity Token
  5. Save

See the PayPal documentation for more details.

Usage

Make a client with the environment (true for live, false for sandbox) and your token.

const paypalToken = 'G-ddvHQfRB2wqzrHCgdkbx0uXEcgKTcWbG2GjlI581zbPbGxKekGXgyVwU0'
const paypalClient = new Paypal(false, paypalToken)

Instant Payment Notification

TODO

Payment Data Transfer

Use the pdt method to retrive a transaction by its ID.
The callback receives an eventual error and, if all goes well, the whole transaction object.

paypalClient.pdt('EPC66XON1D4EE27M9', (err, tx) => {
  if (err) throw err
  console.log(tx['payer_email'])
})

About

PayPal client for IPN and PDT notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published