Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A node.js module which allows for easy integration with PayPal's checkout flow APIs
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.jshintrc
README.md
package.json

README.md

node-paypalxo

Integrate with PayPal's Express Checkout payment flow.

Installation

npm install paypalxo

Usage

See PayPal's Express Checkout integration guide for each APIs required parameters.

var paypalxo = require('node-paypalxo');

// Your PayPal API credentials
paypalxo.user = USER;
paypalxo.pwd = PWD;
paypalxo.signature = SIGNATURE;
paypalxo.version = VERSION;


var params = {
    amt: '1.00',
    returnurl: 'http://example.com/success',
    cancelurl: 'http://example.com/cancel'
};

// STEP 1: Get an Express Checkout token from PayPal
paypalxo.ec.setExpressCheckout(params, function (err, data) {
    if (!err) {
        var token = data.TOKEN;

        // STEP 2: Send the user to the following URL to checkout on PayPal
        console.log(paypalxo.ec.getLoginURL(token));
    }
});


// STEP 3: Complete the transaction
paypalxo.ec.doExpressCheckoutPayment(params, function (err, data) {
    if (!err) {
        // This will output the transaction's details
        console.log(data);
    }
});

API

  • paypalxo.useSandbox
  • paypalxo.ec.setExpressCheckout(params, callback)
  • paypalxo.ec.getExpressCheckoutDetails(params, callback)
  • paypalxo.ec.doExpressCheckoutPayment(params, callback)
  • paypalxo.ec.createRecurringPaymentsProfile(params, callback)
  • paypalxo.ec.getLoginURL(token)
Something went wrong with that request. Please try again.