【问题标题】:Braintree - Determine If Payment Method Is The Default OneBraintree - 确定付款方式是否为默认方式
【发布时间】:2015-05-20 22:26:50
【问题描述】:

我目前正在使用 Ruby braintree gem 来获取客户的所有付款方式。有没有办法确定付款方式是否是默认付款方式? Braintree 是否通过他们的 API 提供这些信息?

customer = Braintree::Customer.find(token)
payment_methods = customer.payment_methods

【问题讨论】:

  • 他们的文档(developers.braintreepayments.com/ios+ruby/reference/response/…) 表明应该可以工作,所以是的。你得到什么回应?
  • 啊,我看到它有一个default? 方法。如果我检查响应,它不会给我该信息。谢谢指点。
  • 我在布伦特里工作。是的,default? 就是你想要的。既然您已经弄清楚了,我建议您将其发布为答案(并让我知道,以便我对其进行投票)。

标签: ruby-on-rails ruby braintree


【解决方案1】:

感谢@snkashis,我能够弄清楚。以下将确定当前付款方式是否为默认付款方式:

payment_method.default?

【讨论】:

    猜你喜欢
    • 2015-10-10
    • 2015-04-03
    • 2016-11-05
    • 2016-01-05
    • 1970-01-01
    • 1970-01-01
    • 2017-08-17
    • 2015-07-12
    • 2021-01-27
    相关资源
    最近更新 更多