Class: OnlinePayments::SDK::Domain::RefundRequest
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::RefundRequest
- Defined in:
- lib/onlinepayments/sdk/domain/refund_request.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney?
The current value of amount_of_money.
-
#capture_id ⇒ String?
The current value of capture_id.
-
#is_final ⇒ true/false?
The current value of is_final.
-
#line_item_details ⇒ Array<OnlinePayments::SDK::Domain::LineItemDetail>?
The current value of line_item_details.
-
#omnichannel_refund_specific_input ⇒ OnlinePayments::SDK::Domain::OmnichannelRefundSpecificInput?
The current value of omnichannel_refund_specific_input.
-
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences?
The current value of operation_references.
-
#reason ⇒ String?
The current value of reason.
-
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences?
The current value of references.
-
#refund_redirect_payment_method_specific_input ⇒ OnlinePayments::SDK::Domain::RefundRedirectPaymentMethodSpecificInput?
The current value of refund_redirect_payment_method_specific_input.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney?
Returns the current value of amount_of_money.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def amount_of_money @amount_of_money end |
#capture_id ⇒ String?
Returns the current value of capture_id.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def capture_id @capture_id end |
#is_final ⇒ true/false?
Returns the current value of is_final.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def is_final @is_final end |
#line_item_details ⇒ Array<OnlinePayments::SDK::Domain::LineItemDetail>?
Returns the current value of line_item_details.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def line_item_details @line_item_details end |
#omnichannel_refund_specific_input ⇒ OnlinePayments::SDK::Domain::OmnichannelRefundSpecificInput?
Returns the current value of omnichannel_refund_specific_input.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def omnichannel_refund_specific_input @omnichannel_refund_specific_input end |
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences?
Returns the current value of operation_references.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def operation_references @operation_references end |
#reason ⇒ String?
Returns the current value of reason.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def reason @reason end |
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences?
Returns the current value of references.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def references @references end |
#refund_redirect_payment_method_specific_input ⇒ OnlinePayments::SDK::Domain::RefundRedirectPaymentMethodSpecificInput?
Returns the current value of refund_redirect_payment_method_specific_input.
24 25 26 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 24 def refund_redirect_payment_method_specific_input @refund_redirect_payment_method_specific_input end |
Instance Method Details
#from_hash(hash) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 59 def from_hash(hash) super if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'captureId' @capture_id = hash['captureId'] end if hash.has_key? 'isFinal' @is_final = hash['isFinal'] end if hash.has_key? 'lineItemDetails' raise TypeError, "value '%s' is not an Array" % [hash['lineItemDetails']] unless hash['lineItemDetails'].is_a? Array @line_item_details = [] hash['lineItemDetails'].each do |e| @line_item_details << OnlinePayments::SDK::Domain::LineItemDetail.new_from_hash(e) end end if hash.has_key? 'omnichannelRefundSpecificInput' raise TypeError, "value '%s' is not a Hash" % [hash['omnichannelRefundSpecificInput']] unless hash['omnichannelRefundSpecificInput'].is_a? Hash @omnichannel_refund_specific_input = OnlinePayments::SDK::Domain::OmnichannelRefundSpecificInput.new_from_hash(hash['omnichannelRefundSpecificInput']) end if hash.has_key? 'operationReferences' raise TypeError, "value '%s' is not a Hash" % [hash['operationReferences']] unless hash['operationReferences'].is_a? Hash @operation_references = OnlinePayments::SDK::Domain::OperationPaymentReferences.new_from_hash(hash['operationReferences']) end if hash.has_key? 'reason' @reason = hash['reason'] end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = OnlinePayments::SDK::Domain::PaymentReferences.new_from_hash(hash['references']) end if hash.has_key? 'refundRedirectPaymentMethodSpecificInput' raise TypeError, "value '%s' is not a Hash" % [hash['refundRedirectPaymentMethodSpecificInput']] unless hash['refundRedirectPaymentMethodSpecificInput'].is_a? Hash @refund_redirect_payment_method_specific_input = OnlinePayments::SDK::Domain::RefundRedirectPaymentMethodSpecificInput.new_from_hash(hash['refundRedirectPaymentMethodSpecificInput']) end end |
#to_h ⇒ Hash
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/onlinepayments/sdk/domain/refund_request.rb', line 45 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['captureId'] = @capture_id unless @capture_id.nil? hash['isFinal'] = @is_final unless @is_final.nil? hash['lineItemDetails'] = @line_item_details.collect{|val| val.to_h} unless @line_item_details.nil? hash['omnichannelRefundSpecificInput'] = @omnichannel_refund_specific_input.to_h unless @omnichannel_refund_specific_input.nil? hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil? hash['reason'] = @reason unless @reason.nil? hash['references'] = @references.to_h unless @references.nil? hash['refundRedirectPaymentMethodSpecificInput'] = @refund_redirect_payment_method_specific_input.to_h unless @refund_redirect_payment_method_specific_input.nil? hash end |