I need to implement some functionality which uses PayPal in my Node.js project. What is the available libraries for Node.js that supports PayPal?
Thanks,
This article (and the follow-up) by James Carr is a pretty good discussion. It makes use of his npm module, paynode.
EDIT: The linked articles have disappeared (thanks for the tip-off, @UpTheCreek). But the module itself is still there and has documentation.
Available Now is PayPal's Node.js SDK for REST APIs , Very Easy Here
var paypal_sdk = require('paypal-rest-sdk');
paypal_sdk.configure({
'host': 'api.sandbox.paypal.com',
'port': '',
'client_id': '<Client ID>',
'client_secret': '<Client Secret ID>'
});
var card_data = {
"type": "visa",
"number": "4417119669820331",
"expire_month": "11",
"expire_year": "2018",
"cvv2": "123",
"first_name": "Joe",
"last_name": "Shopper"
};
paypal_sdk.credit_card.create(card_data, function(error, credit_card){
if (error) {
console.log(error);
throw error;
} else {
console.log("Create Credit-Card Response");
console.log(credit_card);
}
})
When looking for Node.js modules always check out the official modules wiki page.
I could only find one Paypal module, the Paypal IPN module which can only verify IPN messages.
If you need anything more than that you will probably have to build it yourself.
I recall working on similar project and when browsing the web for troubleshooting ideas, I stumbled upon a thread that was useful for me at the time. I tried locating that thread, I think it's this. Hope this works out for you, I remember it was one of those frustrating projects for me. Dina