Radial API for NodeJS
A NodeJS wrapper for the Radial Payments & Fraud REST APIs.
Install via npm:
npm install --save node-radial
API Setup
Require the module and call configure()
:
var radial = require('node-radial').configure({
storeCode: '',
apiKey: '',
uriBaseDomain: ''
});
Optional Setup Parameters
apiVersion
- API version as a numeric string defaults to '1.0'
PayPal Processing
PayPal SetExpress
The first API in PayPal checkout flow. See the following reference for details.
https://docs.ptf.radial.com/Content/Topics/payments/paypal-set-express.htm
var lineItems = [{
name: 'Cool Product',
quantity: 2,
amount: 9.99
}];
radial.paypal.setExpress({
orderId: '12345',
returnUrl: '',
cancelUrl: '',
localeCode: 'en_US',
currencyCode: 'USD',
addressOverride: 0, // optional
noShippingAddressDisplay: 1, // optional
shipToName: 'John Doe', // optional
shippingAddress: { // optional
line1: '',
line2: '',
line3: '',
line4: '',
city: '',
mainDivision: '',
countryCode: '',
postalCode: ''
},
shippingTotal: 2.00,
taxTotal: 1.23,
lineItems: lineItems,
installment: false, // optional
recurring: false // optional
}, function(err, response) {
/*
response = {
responseCode: 'Success',
orderId: '12345',
token: 'EC-5YE59312K56892714'
};
*/
});
PayPal GetExpress
The second API in PayPal checkout flow. See the following reference for details.
https://docs.ptf.radial.com/Content/Topics/payments/paypal-get-express.htm
radial.paypal.getExpress({
orderId: '12345',
token: 'EC-5YE59312K56892714',
currencyCode: 'USD'
}, function(err, response) {
/*
response = {
responseCode: 'Success',
orderId: '12345',
payerId: '',
payerEmail: '',
payerStatus: '',
payerName: {
honorific: '',
firstName: '',
middleName: '',
lastName: ''
},
payerCountry: '',
payerPhone: '',
billingAddress: {
line1: '',
line2: '',
line3: '',
line4: '',
city: '',
mainDivision: '',
countryCode: '',
postalCode: ''
},
shippingAddress: {
line1: '',
line2: '',
line3: '',
line4: '',
city: '',
mainDivision: '',
countryCode: '',
postalCode: ''
},
shipToName: ''
}
*/
});
CHANGELOG
- 0.1.1: Add PayPal getExpress endpoint.
- 0.1.0: Initial release. Only PayPal setExpress is available so far.