Class: Nihaopay::Transactions::Cancel
- Defined in:
- lib/nihaopay/transactions/cancel.rb
Direct Known Subclasses
Constant Summary
Constants included from Queryable
Constants included from Api
Api::LIVE_HOST, Api::TEST_HOST, Api::VERSION
Instance Attribute Summary collapse
-
#cancel_transaction_id ⇒ Object
Returns the value of attribute cancel_transaction_id.
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
Attributes inherited from Capture
#capture_transaction_id, #captured
Attributes inherited from Base
#amount, #captured, #currency, #note, #reference, #status, #time, #token, #transaction_id, #type
Class Method Summary collapse
- .request_url(transaction_id) ⇒ Object
- .response_keys_map ⇒ Object
- .start(transaction_id, options = {}) ⇒ Object
- .valid_attributes ⇒ Object
- .valid_options ⇒ Object
Methods inherited from Capture
Methods inherited from Base
build, build_from_response!, #cancel, #capture, #initialize, #partial_capture, #partial_refund, #refund, #release, request_body, request_headers
Methods included from Queryable
Methods included from Api
Constructor Details
This class inherits a constructor from Nihaopay::Transactions::Base
Instance Attribute Details
#cancel_transaction_id ⇒ Object
Returns the value of attribute cancel_transaction_id.
4 5 6 |
# File 'lib/nihaopay/transactions/cancel.rb', line 4 def cancel_transaction_id @cancel_transaction_id end |
#cancelled ⇒ Object
Returns the value of attribute cancelled.
4 5 6 |
# File 'lib/nihaopay/transactions/cancel.rb', line 4 def cancelled @cancelled end |
Class Method Details
.request_url(transaction_id) ⇒ Object
15 16 17 |
# File 'lib/nihaopay/transactions/cancel.rb', line 15 def request_url(transaction_id) "#{base_url}/transactions/#{transaction_id}/cancel" end |
.response_keys_map ⇒ Object
27 28 29 |
# File 'lib/nihaopay/transactions/cancel.rb', line 27 def response_keys_map { id: :transaction_id, transaction_id: :cancel_transaction_id } end |
.start(transaction_id, options = {}) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/nihaopay/transactions/cancel.rb', line 7 def start(transaction_id, = {}) @token = .delete(:token) url = request_url(transaction_id) params = request_params() response = HTTParty.post(url, headers: request_headers, body: request_body(params)) build_from_response!(response) end |
.valid_attributes ⇒ Object
23 24 25 |
# File 'lib/nihaopay/transactions/cancel.rb', line 23 def valid_attributes %i[transaction_id status cancelled cancel_transaction_id time].freeze end |
.valid_options ⇒ Object
19 20 21 |
# File 'lib/nihaopay/transactions/cancel.rb', line 19 def [] end |