Class: SixSaferpay::SixTransaction::Refund
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::Refund
- Defined in:
- lib/six_saferpay/api/six_transaction/requests/refund.rb
Instance Attribute Summary collapse
-
#capture_reference ⇒ Object
Returns the value of attribute capture_reference.
-
#pending_notification ⇒ Object
Returns the value of attribute pending_notification.
-
#refund ⇒ Object
Returns the value of attribute refund.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
Instance Method Summary collapse
-
#initialize(request_header: nil, refund:, capture_reference:, pending_notification: nil) ⇒ Refund
constructor
A new instance of Refund.
- #response_class ⇒ Object
- #to_hash ⇒ Object (also: #to_h)
- #to_json ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(request_header: nil, refund:, capture_reference:, pending_notification: nil) ⇒ Refund
Returns a new instance of Refund.
12 13 14 15 16 17 18 19 20 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 12 def initialize(request_header: nil, refund: , capture_reference: , pending_notification: nil) @request_header = request_header || SixSaferpay::RequestHeader.new() @refund = SixSaferpay::Refund.new(**refund.to_h) if refund @capture_reference = SixSaferpay::CaptureReference.new(**capture_reference.to_h) if capture_reference @pending_notification = SixSaferpay::PendingNotification.new(**pending_notification.to_h) if pending_notification end |
Instance Attribute Details
#capture_reference ⇒ Object
Returns the value of attribute capture_reference.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 5 def capture_reference @capture_reference end |
#pending_notification ⇒ Object
Returns the value of attribute pending_notification.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 5 def pending_notification @pending_notification end |
#refund ⇒ Object
Returns the value of attribute refund.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.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.rb', line 5 def request_header @request_header end |
Instance Method Details
#response_class ⇒ Object
40 41 42 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 40 def response_class SixSaferpay::SixTransaction::RefundResponse end |
#to_hash ⇒ Object Also known as: to_h
22 23 24 25 26 27 28 29 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 22 def to_hash hash = Hash.new hash.merge!(request_header: @request_header.to_h) if @request_header hash.merge!(refund: @refund.to_h) if @refund hash.merge!(capture_reference: @capture_reference.to_h) if @capture_reference hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification hash end |
#to_json ⇒ Object
32 33 34 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 32 def to_json to_hash.to_json end |
#url ⇒ Object
36 37 38 |
# File 'lib/six_saferpay/api/six_transaction/requests/refund.rb', line 36 def url '/Payment/v1/Transaction/Refund' end |