Node.js的PayPal模块

时间:2012-04-22 12:56:40

标签: node.js paypal payment-gateway

我需要在我的Node.js项目中实现一些使用PayPal的功能。支持PayPal的Node.js的可用库是什么?

谢谢,

4 个答案:

答案 0 :(得分:3)

James Carr的

This article(以及follow-up)是一个非常好的讨论。它使用了他的npm模块paynode

编辑:链接的文章已经消失(感谢提示,@ UpTheCreek)。但模块本身仍然存在,并且documentation

答案 1 :(得分:2)

现在可用的是PayPal用于REST API的Node.js SDK,非常简单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);
  }
})

答案 2 :(得分:0)

在查找Node.js模块时,请查看官方modules wiki page

我只能找到一个Paypal模块,Paypal IPN module只能验证IPN消息。

如果您需要更多的东西,您可能需要自己构建它。

答案 3 :(得分:-1)

我记得在进行类似的项目工作时,在浏览网页进行故障排除时,我偶然发现了一个对我有用的帖子。我尝试找到那个帖子,我认为它是this。希望这对你有用,我记得这对我来说是令人沮丧的项目之一。 迪娜