简体   繁体   English

适用于Node.js的PayPal模块

[英]PayPal modules for Node.js

I need to implement some functionality which uses PayPal in my Node.js project. 我需要实现一些在Node.js项目中使用PayPal的功能。 What is the available libraries for Node.js that supports PayPal? 支持PayPal的Node.js的可用库是什么?

Thanks, 谢谢,

This article (and the follow-up ) by James Carr is a pretty good discussion. James Carr的这篇文章 (及其后续 文章 )是一个很好的讨论。 It makes use of his npm module, paynode . 它利用了他的npm模块paynode

EDIT: The linked articles have disappeared (thanks for the tip-off, @UpTheCreek). 编辑:链接的文章已消失(感谢提示,@ 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 可现在是PayPal的Node.js的SDK为REST API的,非常容易在这里

 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 . 寻找Node.js模块时,请务必查看官方模块Wiki页面

I could only find one Paypal module, the Paypal IPN module which can only verify IPN messages. 我只能找到一个Paypal模块,即只能验证IPN消息的Paypal IPN模块

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 迪娜

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM