class Beaver::RefundResp
RefundResp
Model.
Attributes
TODO: Write general description for this method @return [RefundAmounts]
Owner structure to be used in any resource where an account is the owner @return [String]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Object]
TODO: Write general description for this method @return [RefundFailureReason]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [OrderNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [OwnerIsAccount]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [PaymentNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [PaymentMethodNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [List of RefundPendingReason]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [String]
Owner structure to be used in any resource where an account is the owner @return [TransactionRecordNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [TransactionRecordNonExpanded]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/refund_resp.rb, line 144 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amounts = RefundAmounts.from_hash(hash['amounts']) if hash['amounts'] create_time = hash['create_time'] failure_reason = RefundFailureReason.from_hash(hash['failure_reason']) if hash['failure_reason'] id = hash['id'] order = OrderNonExpanded.from_hash(hash['order']) if hash['order'] owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner'] path = hash['path'] payment = PaymentNonExpanded.from_hash(hash['payment']) if hash['payment'] if hash['payment_method'] payment_method = PaymentMethodNonExpanded.from_hash(hash['payment_method']) end refund_reason = hash['refund_reason'] resource = hash['resource'] status = hash['status'] if hash['txnr_app_fee_refund'] txnr_app_fee_refund = TransactionRecordNonExpanded.from_hash(hash['txnr_app_fee_refund']) end if hash['txnr_merchant_refund'] txnr_merchant_refund = TransactionRecordNonExpanded.from_hash(hash['txnr_merchant_refund']) end custom_data = hash['custom_data'] # Parameter is an array, so we need to iterate through it pending_reasons = nil unless hash['pending_reasons'].nil? pending_reasons = [] hash['pending_reasons'].each do |structure| pending_reasons << (RefundPendingReason.from_hash(structure) if structure) end end api_version = hash['api_version'] reference_id = hash['reference_id'] # Create object from extracted values. RefundResp.new(amounts, create_time, failure_reason, id, order, owner, path, payment, payment_method, refund_reason, resource, status, txnr_app_fee_refund, txnr_merchant_refund, custom_data, pending_reasons, api_version, reference_id) end
A mapping from model property names to API property names.
# File lib/beaver/models/refund_resp.rb, line 82 def self.names @_hash = {} if @_hash.nil? @_hash['amounts'] = 'amounts' @_hash['create_time'] = 'create_time' @_hash['custom_data'] = 'custom_data' @_hash['failure_reason'] = 'failure_reason' @_hash['id'] = 'id' @_hash['order'] = 'order' @_hash['owner'] = 'owner' @_hash['path'] = 'path' @_hash['payment'] = 'payment' @_hash['payment_method'] = 'payment_method' @_hash['pending_reasons'] = 'pending_reasons' @_hash['refund_reason'] = 'refund_reason' @_hash['resource'] = 'resource' @_hash['status'] = 'status' @_hash['txnr_app_fee_refund'] = 'txnr_app_fee_refund' @_hash['txnr_merchant_refund'] = 'txnr_merchant_refund' @_hash['api_version'] = 'api_version' @_hash['reference_id'] = 'reference_id' @_hash end
# File lib/beaver/models/refund_resp.rb, line 105 def initialize(amounts = nil, create_time = nil, failure_reason = nil, id = nil, order = nil, owner = nil, path = nil, payment = nil, payment_method = nil, refund_reason = nil, resource = nil, status = nil, txnr_app_fee_refund = nil, txnr_merchant_refund = nil, custom_data = nil, pending_reasons = nil, api_version = nil, reference_id = nil) @amounts = amounts @create_time = create_time @custom_data = custom_data @failure_reason = failure_reason @id = id @order = order @owner = owner @path = path @payment = payment @payment_method = payment_method @pending_reasons = pending_reasons @refund_reason = refund_reason @resource = resource @status = status @txnr_app_fee_refund = txnr_app_fee_refund @txnr_merchant_refund = txnr_merchant_refund @api_version = api_version @reference_id = reference_id end