class Beaver::PaymentsRequest
PaymentsRequest
Model.
Attributes
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [Integer]
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 [CurrencyEnum]
TODO: Write general description for this method @return [Object]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [InitiatedByReqEnum]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [PaymentMethodForPayments]
TODO: Write general description for this method @return [List of EmbeddedRbit]
TODO: Write general description for this method @return [String]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/payments_request.rb, line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash['account_id'] amount = hash['amount'] currency = hash['currency'] if hash['payment_method'] payment_method = PaymentMethodForPayments.from_hash(hash['payment_method']) end auto_capture = hash['auto_capture'] capture_at = hash['capture_at'] custom_data = hash['custom_data'] fee_amount = hash['fee_amount'] order_id = hash['order_id'] initiated_by = hash['initiated_by'] # Parameter is an array, so we need to iterate through it rbits = nil unless hash['rbits'].nil? rbits = [] hash['rbits'].each do |structure| rbits << (EmbeddedRbit.from_hash(structure) if structure) end end reference_id = hash['reference_id'] # Create object from extracted values. PaymentsRequest.new(account_id, amount, currency, payment_method, auto_capture, capture_at, custom_data, fee_amount, order_id, initiated_by, rbits, reference_id) end
A mapping from model property names to API property names.
# File lib/beaver/models/payments_request.rb, line 58 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['amount'] = 'amount' @_hash['auto_capture'] = 'auto_capture' @_hash['capture_at'] = 'capture_at' @_hash['currency'] = 'currency' @_hash['custom_data'] = 'custom_data' @_hash['fee_amount'] = 'fee_amount' @_hash['order_id'] = 'order_id' @_hash['payment_method'] = 'payment_method' @_hash['initiated_by'] = 'initiated_by' @_hash['rbits'] = 'rbits' @_hash['reference_id'] = 'reference_id' @_hash end
# File lib/beaver/models/payments_request.rb, line 75 def initialize(account_id = nil, amount = nil, currency = nil, payment_method = nil, auto_capture = nil, capture_at = nil, custom_data = nil, fee_amount = nil, order_id = nil, initiated_by = nil, rbits = nil, reference_id = nil) @account_id = account_id @amount = amount @auto_capture = auto_capture @capture_at = capture_at @currency = currency @custom_data = custom_data @fee_amount = fee_amount @order_id = order_id @payment_method = payment_method @initiated_by = initiated_by @rbits = rbits @reference_id = reference_id end