class Beaver::PaymentsV30
PaymentsV30
Model.
Attributes
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
Owner structure to be used in any resource where an account is the owner @return [String]
TODO: Write general description for this method @return [Boolean]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [CurrencyEnum]
TODO: Write general description for this method @return [Object]
TODO: Write general description for this method @return [PaymentFailureReason]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [String]
Owner structure to be used in any resource where an account is the owner @return [InitiatedByRespEnum]
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 [PaymentMethodNonExpanded]
Owner structure to be used in any resource where an account is the owner @return [List of PaymentPendingReason]
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 [Status3Enum]
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/payments_v30.rb, line 179 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash['amount'] amount_refunded = hash['amount_refunded'] amount_disputed = hash['amount_disputed'] create_time = hash['create_time'] currency = hash['currency'] id = hash['id'] owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner'] path = hash['path'] if hash['payment_method'] payment_method = PaymentMethodNonExpanded.from_hash(hash['payment_method']) end resource = hash['resource'] status = hash['status'] initiated_by = hash['initiated_by'] auto_capture = hash['auto_capture'] capture_at = hash['capture_at'] custom_data = hash['custom_data'] failure_reason = PaymentFailureReason.from_hash(hash['failure_reason']) if hash['failure_reason'] fee_amount = hash['fee_amount'] order = OrderNonExpanded.from_hash(hash['order']) if hash['order'] # 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 << (PaymentPendingReason.from_hash(structure) if structure) end end if hash['txnr_app_fee'] txnr_app_fee = TransactionRecordNonExpanded.from_hash(hash['txnr_app_fee']) end if hash['txnr_merchant'] txnr_merchant = TransactionRecordNonExpanded.from_hash(hash['txnr_merchant']) end api_version = hash['api_version'] reference_id = hash['reference_id'] # Create object from extracted values. PaymentsV30.new(amount, amount_refunded, amount_disputed, create_time, currency, id, owner, path, payment_method, resource, status, initiated_by, auto_capture, capture_at, custom_data, failure_reason, fee_amount, order, pending_reasons, txnr_app_fee, txnr_merchant, api_version, reference_id) end
A mapping from model property names to API property names.
# File lib/beaver/models/payments_v30.rb, line 102 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['amount_refunded'] = 'amount_refunded' @_hash['amount_disputed'] = 'amount_disputed' @_hash['auto_capture'] = 'auto_capture' @_hash['capture_at'] = 'capture_at' @_hash['create_time'] = 'create_time' @_hash['currency'] = 'currency' @_hash['custom_data'] = 'custom_data' @_hash['failure_reason'] = 'failure_reason' @_hash['fee_amount'] = 'fee_amount' @_hash['id'] = 'id' @_hash['order'] = 'order' @_hash['owner'] = 'owner' @_hash['path'] = 'path' @_hash['payment_method'] = 'payment_method' @_hash['pending_reasons'] = 'pending_reasons' @_hash['resource'] = 'resource' @_hash['status'] = 'status' @_hash['txnr_app_fee'] = 'txnr_app_fee' @_hash['txnr_merchant'] = 'txnr_merchant' @_hash['initiated_by'] = 'initiated_by' @_hash['api_version'] = 'api_version' @_hash['reference_id'] = 'reference_id' @_hash end
# File lib/beaver/models/payments_v30.rb, line 130 def initialize(amount = nil, amount_refunded = nil, amount_disputed = nil, create_time = nil, currency = nil, id = nil, owner = nil, path = nil, payment_method = nil, resource = nil, status = nil, initiated_by = nil, auto_capture = nil, capture_at = nil, custom_data = nil, failure_reason = nil, fee_amount = nil, order = nil, pending_reasons = nil, txnr_app_fee = nil, txnr_merchant = nil, api_version = nil, reference_id = nil) @amount = amount @amount_refunded = amount_refunded @amount_disputed = amount_disputed @auto_capture = auto_capture @capture_at = capture_at @create_time = create_time @currency = currency @custom_data = custom_data @failure_reason = failure_reason @fee_amount = fee_amount @id = id @order = order @owner = owner @path = path @payment_method = payment_method @pending_reasons = pending_reasons @resource = resource @status = status @txnr_app_fee = txnr_app_fee @txnr_merchant = txnr_merchant @initiated_by = initiated_by @api_version = api_version @reference_id = reference_id end