process-order
v0.0.3
Published
Process orders using express for PayPal etc. easily. More coming soon.
Downloads
5
Maintainers
Readme
process-order
Process orders using express for PayPal etc. easily. More coming soon.
Status: In Progress
Config:
var config = {
endpoint: {
url: "<your project link goes here>",
api: "process"
},
keyLength: 16,
decimals: 2,
expressPort: 3000,
paypal: {
"mode": "sandbox", //sandbox or live
"client_id": "<client_id>",
"client_secret": "<secret_key>"
}
};
Usage:
var Order = require("process-order");
var app = new Order(config, express); // express is optional
var result = app.paypal({
items: [{
name: "AN-ITEM",
sku: "AN-ITEM",
price: 23,
quantity: 1
}],
currency: "USD",
return: function(request, response, id) {
response.send("processed: " + id);
},
cancel: function(request, response) {
response.send("cenceled");
}
});
result.then(function(link) {
console.log("authorization link: " + link);
}).catch(function(error) {
console.log(error);
});