Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal modules for Node.js

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,

like image 820
Feras Odeh Avatar asked Apr 22 '12 12:04

Feras Odeh


2 Answers

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.

like image 85
Phil Booth Avatar answered Sep 20 '22 15:09

Phil Booth


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);
  }
})
like image 40
Hasan Al-Natour Avatar answered Sep 18 '22 15:09

Hasan Al-Natour