Tag: 贝宝

TypeError:使用PayPal时,undefined不是一个函数

我在使用这里提到的示例示例时遇到以下错误: https : //github.com/paypal/PayPal-node-SDK/blob/master/samples/subscription/billing_plans/create.js 。 return callback(null, billingPlan.id); ^ TypeError: undefined is not a function at /home/mukul/scrub/server/payments/paypal/paypal.controller.js:241:17 at IncomingMessage.<anonymous> (/home/mukul/scrub/node_modules/paypal-rest-sdk/lib/client.js:131:13) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11) 以下是我的代码: function createBillingPlan(planDesc, planAmount, planFrequency, planName, planCurrency, callback) { var billingPlanAttributes = { "description": planDesc, "merchant_preferences": { "auto_bill_amount": "yes", "cancel_url": CANCEL_URL, "initial_fail_amount_action": "continue", "max_fail_attempts": "1", "return_url": RETURN_URL […]

返回promise,而不是node.js中的res.json(data)

我做了一个发送请求到payment_url,这是触发第二个function块。 但是我不能在then方法中得到任何东西,因为我不知道如何将数据传递回parsing函数。 无声的呼叫 paypal.request.post(payment_url) .then(function(data) { resolve(data.paymentID); }) .catch(function(err) { reject(err); }); 服务器代码 paypal.payment.create(create_payment_json, function(error, payment) { if (error) { //throw error, return the promises too } else { // return promises but how? //if I simply do res.json(payment) it's not going to work. } });

使用paypal的战略护照:未能获得访问令牌

护照(Jared Hanson) 我如何使用贝宝与openID或OAuth? 我正在使用Passport-paypal-oauth策略( https://github.com/jaredhanson/passport-paypal-oauth ), 注意:我的路线以localhost:4000 / api / users开头 HTTP://本地主机:4000 / API /用户/登入/贝宝 HTTP://本地主机:4000 / API /用户/登入/贝宝/callback 我的PayPal终点: var passport_paypal = require('../middlewares/passport-paypal'); router.get('/signin/paypal', passport_paypal.authenticate('paypal-signin', { scope: 'openid profile email'})); router.get('/signin/paypal/callback', function(req, res, next){ passport_paypal.authenticate('paypal-signin', function(err, user, info){ // Handle cases //return res.status(xxx).json('.. }); 我的Paypal策略: var PaypalStrategy = require('passport-paypal-oauth').Strategy; passport.use('paypal-signin', new PaypalStrategy({ clientID : […]

使用Paypal Rest API和Node

我有一个问题,debugging我的贝宝与Node的集成,其余的API https://github.com/paypal/rest-api-sdk-nodejs 我创build了一个Paypal账户 我得到了应用程序的信用 我创build了一个应用程序并为用户设置了一个密码 我login到该用户的沙箱 我没有看到任何交易logging 代码片段如下: var config_opts = { 'host': 'api.sandbox.paypal.com', 'port': '', 'client_id': 'my id', 'client_secret': 'my secret' }; var create_payment_json = { "intent": "sale", "payer": { "payment_method": "paypal" }, "redirect_urls": { "return_url": "http://localhost:3000", "cancel_url": "http://localhost:3000" }, "transactions": [{ "amount": { "currency": "USD", "total": "10.00" }, "description": "This is the payment […]

贝宝如何在故障转移中工作

我正在为具有以下架构的客户工作: 后端 Java服务器 前端 代理(Node JS + Express应用程序) 我们向服务器发出的所有请求都需要经过代理(安全function)。 我们需要在我们的应用程序中集成Paypal API,所以我们为OK和KOcallback(比如/proxy/paymentOK和/proxy/paymentKO )创build了两个动作,它们调用我们的服务器并更新logging的状态。 现在是我们问题的时候了: 假设用户付款。 所以, /proxy/paymentOK宝将调用我们的OKcallback( /proxy/paymentOK )。 如果代理和服务器之间出现问题(例如,电源或networking故障),付款会发生什么情况? 付款将自动返回给客户? Paypal如何知道在拨打电话后一切正常? 在发送PayPal请求之前,我会坚持一些值,所以我有一个身份为PENDING_PAYMENT的logging的ID。 贝宝需要知道这个参数,因为无论付款接受还是拒绝,我必须更新logging与ACCEPTED或REFUSED状态。 我怎样才能把这个ID发送到贝宝,如何在贝宝做callback时得到它? 感谢大家!

401生产系统上使用节点SDK处理PayPal支付时的invalid_client

我有一个奇怪的情况继续,当我试图使用节点SDK在我的生产系统上进行付款时,总是遇到401 invalid_client错误。 凭据是100%正确的,模式属性设置为生活,这个configuration在本地主机上工作 – 我可以处理没有问题的付款。 所以沙箱在生产和本地主机上运行,​​只能在本地主机上运行。 当我在本地主机上模拟实时模式时,ENVvariables是完全相同的。 我从PayPal获得的debuggingID是bc930e48644c9。 有没有人知道这里发生了什么?

node.js paypal https请求

这里第一个问题,如果事实certificate是非常明显的道歉 我试图通过node.js调用贝宝自适应付款API,我得到一个580001无效的请求错误。 我可以用下面的消息和头文件通过curl做成功的调用,但不能通过节点。 任何帮助将非常感激。 var API_endpoint = "svcs.sandbox.paypal.com"; var API_user = ''; var API_pass = ''; var API_sig = ''; message='requestEnvelope.errorLanguage=en_US&actionType=PAY&senderEmail=test_1320882990_per@gmail.com&receiverList.receiver(0).email=test2_1320887729_biz@gmail.com& receiverList.receiver(0).amount=100.00&currencyCode=USD&cancelUrl=http://your_cancel_url& returnUrl=http://your_return_url' //var params = qs.parse(message); //params = qs.stringify(params); var req_options = { host: API_endpoint, method: 'POST', path: '/AdaptivePayments/Pay', headers: { 'Host': API_endpoint, 'Content-Type': 'application/x-www-form-urlencoded', //'Content-Type': 'text/namevalue', 'Content-Length': message.length, 'X-PAYPAL-REQUEST-DATA-FORMAT:':'NV', 'X-PAYPAL-RESPONSE-DATA-FORMAT':'NV', 'X-PAYPAL-SECURITY-USERID':API_user, 'X-PAYPAL-SECURITY-PASSWORD':API_pass, 'X-PAYPAL-SECURITY-SIGNATURE':API_sig, […]

贝宝快递结帐安全与静音阿贾克斯呼叫

PayPal的新结账让我感到不安全,用户无法在匿名方面触发虚假付款? 提供的代码看起来像这样 paypal.Button.render({ env: 'sandbox', client: { sandbox: 'AapGZeCaaDK_q_KPeG19DHnD_kd18vr6BxNe4P6uuhfTKPjIedtNEI9plyDgmzfyI-xGhbxjpv0k-Ha9', production: 'xxxxxxxxx' // u expose the key to client side? is this ok? }, payment: function() { var env = this.props.env; var client = this.props.client; return paypal.rest.payment.create(env, client, { transactions: [{ amount: { total: ($scope.number_of_uses * 9) + '.00' , currency: 'USD' }, item_list: { items: […]

什么是JSON支付贝宝定义的简单,最小的例子?

我正在寻找一个简单的JSON示例的捐赠的贝宝定义。 这似乎没有在贝宝文档中介绍。 它需要一个简单的参数来指定付款的具体date,以及每年在这个date重复使用的选项。 我已经尝试了以下,但它不允许付款date或重复。 需要添加什么? var create_payment_json = { "intent": "sale", "payer": { "payment_method": "paypal" }, "redirect_urls": { "return_url": "http://return.url", "cancel_url": "http://cancel.url" }, "transactions": [{ "item_list": { "items": [{ "name": "item", "sku": "item", "price": "1.00", "currency": "USD", "quantity": 1 }] }, "amount": { "currency": "USD", "total": "1.00" }, "description": "This is the payment description." }] […]

PayPal模块Node.js

我需要实现一些在我的Node.js项目中使用PayPal的function。 什么是支持贝宝的Node.js的可用库? 谢谢,