【问题标题】:Logs showing WARNING when trying to credit bank accounts with Balanced Payments尝试使用 Balanced Payments 记入银行帐户时显示 WARNING 的日志
【发布时间】:2013-06-05 12:02:04
【问题描述】:

今天在我的日志中看到了这一点。

  #############################################################
  #   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!   #
  #############################################################

  Using positional arguments is **DEPRECATED**. Please use the
  keyword options pattern instead. Version __0.7.0__ of the
  Ruby client will not support positional arguments.

负责的代码是:

bank_account.credit((amount*100).to_i)

我要改变什么?在文档中也找不到任何内容。 https://www.balancedpayments.com/docs/api?language=ruby#credit-an-existing-bank-account

【问题讨论】:

    标签: balanced-payments


    【解决方案1】:

    bank_account.credit(:amount => (amount*100).to_i) 应该可以解决问题。您收到的错误是警告您不要使用位置参数,例如
    def example(positional_arg1, positional_arg2);end

    可以在here 找到如何正确使用 ruby​​ 客户端的一个很好的示例。

    【讨论】:

      【解决方案2】:

      您应该将此行更改为:

      bank_account.credit(:amount => (amount*100).to_i)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-06-22
        • 1970-01-01
        • 1970-01-01
        • 2013-09-06
        • 1970-01-01
        相关资源
        最近更新 更多