Commit 2890f77c authored by Sergey Gernyak's avatar Sergey Gernyak

FEAT: getAccountDetails request method

parent b43771c2
......@@ -67,6 +67,7 @@ module BetfairApiNgRails
autoload :LimitOrder, 'betfair_api_ng_rails/api/data/limit_order'
autoload :LimitOnCloseOrder, 'betfair_api_ng_rails/api/data/limit_on_close_order'
autoload :MarketOnCloseOrder, 'betfair_api_ng_rails/api/data/market_on_close_order'
autoload :AccountDetailsResponse,'betfair_api_ng_rails/api/data/account_details_response'
module Concerns
autoload :Hashable, 'betfair_api_ng_rails/api/data/concerns/hashable'
......@@ -125,6 +126,7 @@ module BetfairApiNgRails
autoload :ListMarketCatalogue, 'betfair_api_ng_rails/api/parsers/list_market_catalogue'
autoload :ListMarketBook, 'betfair_api_ng_rails/api/parsers/list_market_book'
autoload :PlaceOrders, 'betfair_api_ng_rails/api/parsers/place_orders'
autoload :GetAccountDetails, 'betfair_api_ng_rails/api/parsers/get_account_details'
end
module ConnectionExt
......
module BetfairApiNgRails
module Api
module Data
class AccountDetailsResponse < Api::Data::Base
include Api::Data::Concerns::Hashable
ACCOUNT_DETAILS_RESPONSE_ATTRS = [
:currency_code,
:first_name,
:last_name,
:locale_code,
:region,
:timezone,
:discount_rate,
:points_balance
]
attributes ACCOUNT_DETAILS_RESPONSE_ATTRS
def self.to_hash_attrs
ACCOUNT_DETAILS_RESPONSE_ATTRS
end
end
end
end
end
module BetfairApiNgRails
module Api
module Parsers
class GetAccountDetails < Api::Parsers::SingleBase
private
def data_class
Api::Data::AccountDetailsResponse
end
end
end
end
end
......@@ -6,6 +6,7 @@ module BetfairApiNgRails
# Returns the details relating your account, including your discount rate and Betfair point balance.
#
def get_account_details
run_request __method__, {}
end
#
......@@ -13,6 +14,7 @@ module BetfairApiNgRails
# from either the UK or AUS Accounts API endpoint if the wallet parameter is not specified.
#
def get_account_funds
run_request __method__, {}
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment