1.0.4 • Published 7 years ago

paypal-notifications v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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'])
})
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago