Class: K2ConnectRuby::K2Entity::SendMoney
- Defined in:
- lib/k2-connect-ruby/k2_entity/k2_financial_entities/send_money.rb
Instance Attribute Summary collapse
-
#payments_location_url ⇒ Object
Returns the value of attribute payments_location_url.
Attributes inherited from K2Entity
#access_token, #k2_response_body, #location_url, #query_hash
Instance Method Summary collapse
- #create_payment(params) ⇒ Object
-
#query_resource(url) ⇒ Object
Query specific URL.
-
#query_status ⇒ Object
Query/Check the status of a recently initiated Send money request.
Methods inherited from K2Entity
Constructor Details
This class inherits a constructor from K2ConnectRuby::K2Entity::K2Entity
Instance Attribute Details
#payments_location_url ⇒ Object
Returns the value of attribute payments_location_url.
7 8 9 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/send_money.rb', line 7 def payments_location_url @payments_location_url end |
Instance Method Details
#create_payment(params) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/send_money.rb', line 9 def create_payment(params) send_money_request = build_send_money_request(params) raise(ArgumentError, send_money_request.errors..first) unless send_money_request.valid? result = K2ConnectRuby::K2Services::SendK2ConnectPostRequestService.call( access_token, send_money_request.endpoint, send_money_request.request_body, ) if result.success? @payments_location_url = result.data[:response_headers][:location] else raise(result.errors.first) end end |
#query_resource(url) ⇒ Object
Query specific URL
31 32 33 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/send_money.rb', line 31 def query_resource(url) super(url) end |
#query_status ⇒ Object
Query/Check the status of a recently initiated Send money request
26 27 28 |
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/send_money.rb', line 26 def query_status super(payments_location_url) end |