paypal-notifications
v1.0.4
Published
PayPal client for IPN and PDT notifications
Downloads
15
Maintainers
Readme
PayPal Notifications
PayPal client for IPN (Instant Payment Notification) and PDT (Payment Data Transfer) notifications.
Installation
Get package:
npm i paypal-notifications -S
Import it in your code:
const Paypal = require('paypal-notifications')
Setup
Instant Payment Notification
TODO
Payment Data Transfer
- Go to Website Payment Preferences
- Set the Return URL
- Turn the Payment Data Transfer on
- Get the Identity Token
- 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'])
})