module PayPal::Merchant::Reporting::ClassMethods

Public Instance Methods

balance() click to toggle source

Get the balance of your PayPal account

Returns an the balance in cents for the primary currency holding of the account).

# File lib/paypal/merchant/reporting.rb, line 17
def balance
  merchant_api = PayPal::Merchant.new
  balance_request = merchant_api.build_get_balance
  response = merchant_api.get_balance(balance_request)
  if response.success?
    Money.parse(response.balance.value).cents
  else
    nil
  end
end