Class: SixSaferpay::SixTransaction::AdjustAmount
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::AdjustAmount
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(request_header: nil, token:, amount:) ⇒ AdjustAmount
constructor
A new instance of AdjustAmount.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, token:, amount:) ⇒ AdjustAmount
Returns a new instance of AdjustAmount.
12 13 14 15 16 17 18 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 12 def initialize(request_header: nil, token: , amount: ) @request_header = request_header || SixSaferpay::RequestHeader.new() @token = token @amount = SixSaferpay::Amount.new(**amount.to_h) if amount end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 5 def amount @amount end |
#request_header ⇒ Object
Returns the value of attribute request_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 5 def request_header @request_header end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 5 def token @token end |
Instance Method Details
#response_class ⇒ Object
37 38 39 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 37 def response_class SixSaferpay::SixTransaction::AdjustAmountResponse end |
#to_hash ⇒ Object Also known as: to_h
20 21 22 23 24 25 26 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 20 def to_hash hash = Hash.new hash.merge!(request_header: @request_header.to_h) if @request_header hash.merge!(token: @token) if @token hash.merge!(amount: @amount.to_h) if @amount hash end |
#to_json ⇒ Object
29 30 31 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 29 def to_json to_hash.to_json end |
#url ⇒ Object
33 34 35 |
# File 'lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb', line 33 def url '/Payment/v1/Transaction/AdjustAmount' end |