init push - laying out the project
This commit is contained in:
16
portal/app/lib/integrations/betfair/account_manager.rb
Normal file
16
portal/app/lib/integrations/betfair/account_manager.rb
Normal file
@ -0,0 +1,16 @@
|
||||
module Integrations
|
||||
module Betfair
|
||||
class AccountManager < Base
|
||||
def refresh_account_balance
|
||||
# go check the account balance and update the ExchangeAccount for this account
|
||||
res = self.class.post("#{API_ACCOUNT_ENDPOINT}/getAccountFunds/", { headers: @connection.api_headers, data: {} })
|
||||
if res['availableToBetBalance']
|
||||
acc_bal = res['availableToBetBalance']
|
||||
@account.update(account_balance: acc_bal, account_balance_last_checked: Time.now)
|
||||
end
|
||||
@account.account_balance
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user