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