有一種方式來獲得的所有卡的列表:布倫特裏:讓所有客戶的付款方式
gateway.creditCard.expiringBetween(year1900, year2100, function (err, result) {...})
,然後調用paymentMethod.find
爲每個卡。但我希望在一次通話中獲得與客戶相關的所有付款方式,這可能嗎?
有一種方式來獲得的所有卡的列表:布倫特裏:讓所有客戶的付款方式
gateway.creditCard.expiringBetween(year1900, year2100, function (err, result) {...})
,然後調用paymentMethod.find
爲每個卡。但我希望在一次通話中獲得與客戶相關的所有付款方式,這可能嗎?
我在布倫特裏工作。如果你有更多的問題,你總是可以get in touch with our support team。
客戶被序列化了所有的支付方式。
所以,get the customer然後get the credit cards and paypal accounts from it:
gateway.customer.find("theCustomerId", function(err, customer) {
var payment_methods = customer.creditCards.concat(customer.paypalAccounts);
});
@RobFox請不要進行不會大幅度提高答案的編輯。我知道你只有編輯權限,並且很高興能夠使用它們,但是同樣的規則適用於你之前的版本 - 只做大量修改。 – agf 2016-08-12 16:55:57
我想通這一點。 gateway.customer.find
返回一個包含屬性creditCards
的對象,從文檔中不明顯。
我在布倫特裏工作。一般來說,您不需要在Braintree保險庫中獲得所有付款方式(您正在嘗試做什麼?)。你的用例是什麼? – agf 2014-11-03 17:10:14
不,我試圖爲特定客戶獲取所有付款方式。 – punund 2014-11-03 20:08:00