braintree node js使用云函数

时间:2018-02-16 16:44:58

标签: node.js firebase paypal braintree

Braintree发现客户使用客户ID返回一个响应对象,该对象包含作为getgateway(key)值的函数..而firebase拒绝将响应推送到数据库中......

错误

  

错误:Firebase.set失败:第一个参数包含一个函数   属性   ' Wallets.qN5RmUgatwbianIuYYHmLX6GGrC3.Accountdetails.creditCards.0.getGateway'   内容:()=>网关

有没有人遇到过这个问题并解决了它?这是我的代码:

find braintree user result:  Customer {
  id: '185946869',
  merchantId: 'hjctjwrqxh6t3qhf',
  firstName: 'kayak@gmail.com',
  lastName: '',
  company: '',
  email: 'kayak@gmail.com',
  phone: '',
  fax: '',
  website: '',
  createdAt: '2018-02-16T10:28:47Z',
  updatedAt: '2018-02-16T10:29:15Z',
  customFields: '',
  creditCards: 
   [ CreditCard {
       bin: '411111',
       cardType: 'Visa',
       cardholderName: null,
       commercial: 'Unknown',
       countryOfIssuance: 'Unknown',
       createdAt: '2018-02-16T10:29:15Z',
       customerId: '185946869',
       customerLocation: 'US',
       debit: 'Unknown',
       default: true,
       durbinRegulated: 'Unknown',
       expirationMonth: '02',
       expirationYear: '2019',
       expired: false,
       healthcare: 'Unknown',
       imageUrl: 'https://assets.braintreegateway.com/payment_method_logo/visa.png?environment=sandbox',
       issuingBank: 'Unknown',
       last4: '1111',
       payroll: 'Unknown',
       prepaid: 'Unknown',
       productId: 'Unknown',
       subscriptions: [],
       token: 'fbm3yx',
       uniqueNumberIdentifier: '1077b77aa2b0c0821e51ad010e31ee93',
       updatedAt: '2018-02-16T10:29:17Z',
       venmoSdk: false,
       verifications: [],

       getGateway: [Function],

       maskedNumber: '411111******1111',
       expirationDate: '02/2019' } ],
  addresses: [],
  getGateway: [Function],
  paymentMethods: 
   [ CreditCard {
       bin: '411111',
       cardType: 'Visa',
       cardholderName: null,
       commercial: 'Unknown',
       countryOfIssuance: 'Unknown',
       createdAt: '2018-02-16T10:29:15Z',
       customerId: '185946869',
       customerLocation: 'US',
       debit: 'Unknown',
       default: true,
       durbinRegulated: 'Unknown',
       expirationMonth: '02',
       expirationYear: '2019',
       expired: false,
       healthcare: 'Unknown',
       imageUrl: 'https://assets.braintreegateway.com/payment_method_logo/visa.png?environment=sandbox',
       issuingBank: 'Unknown',
       last4: '1111',
       payroll: 'Unknown',
       prepaid: 'Unknown',
       productId: 'Unknown',
       subscriptions: [],
       token: 'fbm3yx',
       uniqueNumberIdentifier: '1077b77aa2b0c0821e51ad010e31ee93',
       updatedAt: '2018-02-16T10:29:17Z',
       venmoSdk: false,
       verifications: [],
       getGateway: [Function],
       maskedNumber: '411111******1111',
       expirationDate: '02/2019' } ] }

过去几天我一直在使用Braintree respose对象。这是我的API调用的问题吗?或者有关API服务的更改。

1 个答案:

答案 0 :(得分:0)

您是正确的...我们最近遇到了同一问题,并与Braintree取得了联系。您的通话没有问题...更改已在Braintree node package中,但没有记录。

不幸的是,没有标记可用于指示Braintree API不要将getGateway属性作为transaction.sale()结果对象的一部分发回。

像您一样,我们正在开发的解决方案是遍历结果对象并过滤掉typeof function的所有属性。

据说Braintree目前正在考虑从响应对象中完全删除getGateway方法,尽管他们对此更改没有坚定的承诺或时间表。