Tag: braintree

Nodejs与braintreestream?

我正在尝试构build一个交易的API路线,我想从braintree服务器获取交易详情。 我的应用程序已设置,以便braintree customerId()与我的应用程序用户的ID相同。 所以下面我searchlogin的特定用户的所有交易。 含义req.user.id将始终等于位于braintree服务器上的customerId() 。 app.get('/project', function(req, res) { if(req.user) { // Finds all transactions for a particular customer var stream = gateway.transaction.search(function (search) { search.customerId().is(req.user.id); }); console.log(stream); //res.send(stream); } }); 我想返回细节,但stream如下所示。 那么显然这让我觉得有一种处理节点stream的方法呢? 我已经看到readable-stream东西,我不知道这是我需要处理这个stream对象。 我的问题是如何处理stream对象返回事务的细节? { _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, […]

Braintree与csrf webhooks不工作

我用braintree付款,一切正常。 我的代码如下所示: app.post("/create_customer", function (req, res) { var customerRequest = { firstName: req.body.first_name, lastName: req.body.last_name, creditCard: { number: req.body.number, cvv: req.body.cvv, expirationMonth: req.body.month, expirationYear: req.body.year, billingAddress: { postalCode: req.body.postal_code } } }; gateway.customer.create(customerRequest, function (err, result) { console.log(result); if (result.success) { res.send( "<h1>Customer created with name: " + result.customer.firstName + " " + result.customer.lastName + […]

在Braintree MarketPlace如何从submerchant账户中退款?

我必须从一个潜在的帐户braintree市场退款,但似乎只有两种方式来退款,即从主商人帐户或两者(潜入和主商户)帐户。 是否有可能退款只有淹没帐户?

如何启用paypal在电子书中运行的brainstree?

我在nodejs中运行braintree支付系统,这个快速的应用程序正在通过桌面电子运行。 通过标准信用卡支付工作正常,但是当贝宝button被点击时,它只是失速。 看下面的图片。 当你点击取消贝宝login没有任何反应。 以下是braintree支付的html格式 <script src="https://js.braintreegateway.com/js/braintree-2.30.0.min.js"></script> <script> // We generated a client token for you so you can test out this code // immediately. In a production-ready integration, you will need to // generate a client token on your server (see section below). var clientToken = document.getElementById('token').value; braintree.setup(clientToken, "dropin", { container: "payment-form" }); </script> […]

如何使用Braintree从webhook获取客户的ID?

如何从Braintree的webhook通知中获得客户的ID? 例如,我可以执行以下操作来获取ID: gateway.webhookNotification.parse(sampleNotification.bt_signature, sampleNotification.bt_payload, (err, webhookNotification) => { let customerId = webhookNotification.subject.subscription.transactions[0].customer.id; }); 但是这要求用户至less有一个事务。 如果没有任何交易(例如新用户),我如何获得客户ID? 这是loggingwebhookNotification时的响应: WebhookNotification { timestamp: '2017-04-30T11:01:33Z', kind: 'subscription_charged_unsuccessfully', subject: { subscription: { id: 'jywgnr', transactions: [], addOns: [], discounts: [] } }, subscription: Subscription { id: 'jywgnr', transactions: [], addOns: [], discounts: [] } }

如何使用braintree返回的节点stream

Braintree提供了一个search交易的API。 Braintree提供了一个例子,但我不知道如何读braintree返回的节点stream。 请看下面的代码片段: var stream = gateway.transaction.search(function (search) { search.paymentMethodToken().is("h337xg"); }); stream.pipe(someWritableStream); //When I try to print the stream in console, I get the following result: { _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: false, calledRead: false, sync: true, needReadable: false, emittedReadable: false, […]

如何使用node.js读取分块stream

以下是search交易的braintree api。 结果以streamforms接收。 但无法读取string或所需的格式接收到的块。 var stream = gateway.transaction.search(function (search) { result = search.paymentMethodToken().is("h337xg"); }); completeData = "" stream.on("data", function(chunk){ // read the chunk completeData += chunk; }); stream.on("end", function(){ // print the output in console console.log(completeData); }); stream.resume(); 可以在控制台中看到的输出为:[object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object]

meteor“找不到模组”braintree“”

我正在尝试将Braintree支付与我的网站进行整合,但Meteor不断给出以下错误: Error: Cannot find module 'Braintree' 我添加meteor到我的项目使用meteor add ulexus:braintree和meteor add hiukim:braintree-helper 。 我跟着这个去尝试让我的项目工作。 这是我的代码: // inside Meteor.startup Braintree = Npm.require('braintree'); var config = Braintree.connect({ environment: Braintree.Environment.Sandbox, merchantId: "my merchant id", privateKey: "my private key", publicKey: "my public key" }); BraintreeHelper.getInstance().connect(config); 我也试着用sudo npm install braintree安装Braintree,但是也没有工作。 如果我尝试没有Braintree = …我得到的错误cannot call method baseUrl on undefined 。 我真的很感激任何帮助。 注意:我以前从未使用过Braintree,最近才开始使用Meteor。 […]

Braintree与沙盒中的JavaScript SDK tokenizeCard返回“无法标记卡”。

我正在使用Nodejs + JavaScript的SDK中,我正在创build一个新的客户使用预定义的客户ID,这是正常工作。 现在,使用相同的客户ID,我在后端生成一个令牌并将其发送给客户端。 现在在客户端我正在运行。 var card = { number: '4111111111111111', cvv: '832', expirationMonth: '10', expirationYear: '2020', cardholderName: 'Ankur Agarwal', billingAddress: { postalCode: '560076' }, }; var client = new braintree.api.Client({clientToken: clientToken}); client.tokenizeCard(card, function (err, nonce) { // Got Error "Unable to tokenize card" }) 这是它最初从服务器获得的http响应。 /**/callback_json1({"error":{"message":"User does not have the required permissions for this […]

Braintree node.js w / iOS 9 Swift 2.1 – 客户端令牌错误

我试图设置一个相对简单的Braintree服务器运行在Node.js与我的客户端写在Swift 2.1 iOS 9,而我能够logging客户端令牌,我收到以下错误: [BraintreeSDK] ERROR Unsupported client token version. Please ensure your server is generating a valid Braintree ClientToken with a server-side SDK that is compatible with this version of Braintree iOS. 以下是我的服务器代码(从BraintreeDev仓库改编而来): 'use strict'; var express = require('express'); var app = express(); var braintree = require('braintree'); var bodyParser = require('body-parser'); var parseUrlEnconded = […]