Class: OFX::FinancialClient
- Inherits:
-
Object
- Object
- OFX::FinancialClient
- Defined in:
- lib/ofx/financial_client.rb
Instance Attribute Summary collapse
-
#client_unique_identifier ⇒ Object
Returns the value of attribute client_unique_identifier.
-
#date_of_last_profile_update ⇒ Object
Returns the value of attribute date_of_last_profile_update.
Instance Method Summary collapse
- #application_identification(ofx_client_spoof = nil) ⇒ Object
- #create_profile_update_request_message ⇒ Object
- #create_signon_request_message(financial_institution_id, ofx_client_id = nil) ⇒ Object
- #financial_institution_identification_for(financial_institution_id) ⇒ Object
-
#initialize(financial_institutions_and_credentials) ⇒ FinancialClient
constructor
A new instance of FinancialClient.
- #user_identification_for(financial_institution_id) ⇒ Object
Constructor Details
#initialize(financial_institutions_and_credentials) ⇒ FinancialClient
Returns a new instance of FinancialClient.
28 29 30 |
# File 'lib/ofx/financial_client.rb', line 28 def initialize(financial_institutions_and_credentials) @financial_institutions_and_credentials = financial_institutions_and_credentials end |
Instance Attribute Details
#client_unique_identifier ⇒ Object
Returns the value of attribute client_unique_identifier.
26 27 28 |
# File 'lib/ofx/financial_client.rb', line 26 def client_unique_identifier @client_unique_identifier end |
#date_of_last_profile_update ⇒ Object
Returns the value of attribute date_of_last_profile_update.
25 26 27 |
# File 'lib/ofx/financial_client.rb', line 25 def date_of_last_profile_update @date_of_last_profile_update end |
Instance Method Details
#application_identification(ofx_client_spoof = nil) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ofx/financial_client.rb', line 45 def application_identification(ofx_client_spoof=nil) # Reference: http://wiki.mthbuilt.com/Tweaking_OFX_Connections case ofx_client_spoof when 'Money' OFX::ApplicationIdentification.new('Money', '1600') when 'Quicken' OFX::ApplicationIdentification.new('QWIN', '1700') when 'QuickBooks' OFX::ApplicationIdentification.new('QBW', '1800') else OFX::ApplicationIdentification.new('OFX', '0010') end end |
#create_profile_update_request_message ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/ofx/financial_client.rb', line 76 def () profileMessageSet = OFX::FinancialInstitutionProfileMessageSet.new profileRequest = OFX::FinancialInstitutionProfileRequest.new profileRequest.transaction_identifier = OFX::TransactionUniqueIdentifier.new profileRequest.client_routing = 'MSGSET' profileRequest.date_of_last_profile_update = self.date_of_last_profile_update profileMessageSet.requests << profileRequest profileMessageSet end |
#create_signon_request_message(financial_institution_id, ofx_client_id = nil) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ofx/financial_client.rb', line 59 def (financial_institution_id, ofx_client_id=nil) signonMessageSet = OFX::SignonMessageSet.new signonRequest = OFX::SignonRequest.new signonRequest.date = DateTime.now signonRequest.user_identification = self.user_identification_for(financial_institution_id) signonRequest.generate_user_key = false signonRequest.language = "ENG" signonRequest.financial_institution_identification = self.financial_institution_identification_for(financial_institution_id) signonRequest. = nil signonRequest.application_identification = self.application_identification(ofx_client_id) signonRequest.client_unique_identifier = self.client_unique_identifier signonMessageSet.requests << signonRequest signonMessageSet end |
#financial_institution_identification_for(financial_institution_id) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/ofx/financial_client.rb', line 32 def financial_institution_identification_for(financial_institution_id) @financial_institutions_and_credentials.each do |pair| return pair[0] if (pair[0].financial_institution_identifier == financial_institution_id) end return nil end |
#user_identification_for(financial_institution_id) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/ofx/financial_client.rb', line 38 def user_identification_for(financial_institution_id) @financial_institutions_and_credentials.each do |pair| return pair[1] if (pair[0].financial_institution_identifier == financial_institution_id) end return nil end |