Module: PayPal::Merchant::Reporting::ClassMethods

Defined in:
lib/paypal/merchant/reporting.rb

Instance Method Summary collapse

Instance Method Details

#balanceObject

Get the balance of your PayPal account

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



17
18
19
20
21
22
23
24
25
26
# 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