Class: SynapsePay::BankEndpoint
- Inherits:
-
APIEndpoint
- Object
- APIEndpoint
- SynapsePay::BankEndpoint
- Defined in:
- lib/synapse_pay/endpoints/bank_endpoint.rb
Instance Attribute Summary
Attributes inherited from APIEndpoint
Instance Method Summary collapse
- #add(params = {}, headers = {}) ⇒ Object
- #all(params = {}, headers = {}) ⇒ Object
- #link(params = {}, headers = {}) ⇒ Object
- #refresh(id, params = {}, headers = {}) ⇒ Object
- #remove(bank_id, params = {}, headers = {}) ⇒ Object
Methods inherited from APIEndpoint
Constructor Details
This class inherits a constructor from SynapsePay::APIEndpoint
Instance Method Details
#add(params = {}, headers = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/synapse_pay/endpoints/bank_endpoint.rb', line 4 def add(params={}, headers={}) method = APIMethod.new(:post, "/bank/add", params, headers, self) json = @client.execute(method) Bank.new(json[:bank], method, @client) end |
#all(params = {}, headers = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/synapse_pay/endpoints/bank_endpoint.rb', line 10 def all(params={}, headers={}) method = APIMethod.new(:post, "/bank/show", params, headers, self) json = @client.execute(method) APIList.new(:Bank, json[:banks], method, @client) end |
#link(params = {}, headers = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/synapse_pay/endpoints/bank_endpoint.rb', line 16 def link(params={}, headers={}) method = APIMethod.new(:post, "/bank/login", params, headers, self) json = @client.execute(method) if(json[:is_mfa] && json[:response][:type] == "questions") BankMfaQuestions.new(json[:response], method, @client) elsif(json[:is_mfa] && json[:response][:type] == "device") BankMfaDevice.new(json[:response], method, @client) else APIList.new(:Bank, json[:banks], method, @client) end end |
#refresh(id, params = {}, headers = {}) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/synapse_pay/endpoints/bank_endpoint.rb', line 28 def refresh(id, params={}, headers={}) params = ParamsBuilder.merge({ :id => id, }, params) method = APIMethod.new(:post, "/bank/refresh", params, headers, self) json = @client.execute(method) APIList.new(:Bank, json[:banks], method, @client) end |
#remove(bank_id, params = {}, headers = {}) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/synapse_pay/endpoints/bank_endpoint.rb', line 37 def remove(bank_id, params={}, headers={}) params = ParamsBuilder.merge({ :bank_id => bank_id, }, params) method = APIMethod.new(:post, "/bank/delete", params, headers, self) json = @client.execute(method) json end |