Skip to content

A node.js module which allows for easy integration with PayPal's checkout flow APIs

Notifications You must be signed in to change notification settings

denisu/node-paypalxo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A node.js module which allows for easy integration with PayPal's checkout flow APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published