Class: Banker::BarclaycardUK
Overview
This class allows the retrieval of account data for Barcalycard UK
Examples
Get OFX from Barcalycard UK
bank = Banker::BarcalycardUK.new(:username => "joe"
:password => '123456',
:memorable_word => 'superduper')
bank.accounts.first.balance #=> 410010
Constant Summary collapse
- LOGIN_ENDPOINT =
'https://bcol.barclaycard.co.uk/ecom/as2/initialLogon.do'
- EXPORT_ENDPOINT =
'https://bcol.barclaycard.co.uk/ecom/as2/export.do?doAction=processRecentExportTransaction&type=OFX_2_0_2&statementDate=&sortBy=transactionDate&sortType=Dsc'
- FIELDS =
{ username: 'username', password: 'password', memorable_word: [ 'firstAnswer', 'secondAnswer' ] }
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#memorable_word ⇒ Object
Returns the value of attribute memorable_word.
-
#ofx ⇒ Object
Returns the value of attribute ofx.
-
#page ⇒ Object
Returns the value of attribute page.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ BarclaycardUK
constructor
A new instance of BarclaycardUK.
Methods inherited from Base
#class_name, #cleaner, #get, #get_letter, #memorable_required, #params, #parse_ofx
Constructor Details
#initialize(args = {}) ⇒ BarclaycardUK
Returns a new instance of BarclaycardUK.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/banker/barclaycard_uk.rb', line 29 def initialize(args = {}) @keys = [:username, :password, :memorable_word] params(args) @username = args[:username] @password = args[:password] @memorable_word = args[:memorable_word] @accounts = [] authenticate! get_data parse_ofx('credit_card') end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def accounts @accounts end |
#memorable_word ⇒ Object
Returns the value of attribute memorable_word.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def memorable_word @memorable_word end |
#ofx ⇒ Object
Returns the value of attribute ofx.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def ofx @ofx end |
#page ⇒ Object
Returns the value of attribute page.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def page @page end |
#password ⇒ Object
Returns the value of attribute password.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
16 17 18 |
# File 'lib/banker/barclaycard_uk.rb', line 16 def username @username end |