Search code examples
balanced-payments

Logs showing WARNING when trying to credit bank accounts with Balanced Payments


Been seeing this in my logs today.

  #############################################################
  #   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.

The code that is responsible for that is:

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

What do I change? Couldn't find anything in the docs either. https://www.balancedpayments.com/docs/api?language=ruby#credit-an-existing-bank-account


Solution

  • bank_account.credit(:amount => (amount*100).to_i) should do the trick. The error you are getting is warning you from using positional arguments e.g.
    def example(positional_arg1, positional_arg2);end

    A good example of how to properly use the ruby client can be found here.