class SpikePay::ChargeRequestCreate

Attributes

attributes[R]

Public Class Methods

create(params) click to toggle source
# File lib/spike_pay/data_types.rb, line 41
def self.create(params)
  return params if params.is_a?(self)
  hash = case params
    when Hash; params
    else
      raise SpikePay::InvalidRequestError.new("#{self} does not accept the given value", params)
    end
  self.new(hash)
end
fields() click to toggle source
# File lib/spike_pay/data_types.rb, line 36
def self.fields
  ['amount', 'currency', 'card', 'products']
end
new(hash = {}) click to toggle source
# File lib/spike_pay/data_types.rb, line 51
def initialize(hash = {})
  hash = normalize_hash(hash)
  @attributes = hash
end

Public Instance Methods

amount() click to toggle source

attributes accessors

# File lib/spike_pay/data_types.rb, line 57
def amount
  attributes['amount']
end
amount=(value) click to toggle source
# File lib/spike_pay/data_types.rb, line 61
def amount=(value)
  attributes['amount'] = value
end
card() click to toggle source
# File lib/spike_pay/data_types.rb, line 73
def card
  attributes['card']
end
card=(value) click to toggle source
# File lib/spike_pay/data_types.rb, line 78
def card=(value)
  attributes['card'] = value
end
currency() click to toggle source
# File lib/spike_pay/data_types.rb, line 65
def currency
  attributes['currency']
end
currency=(value) click to toggle source
# File lib/spike_pay/data_types.rb, line 69
def currency=(value)
  attributes['currency'] = value
end
procuts=() click to toggle source
# File lib/spike_pay/data_types.rb, line 86
def procuts=
  value = value['products'][0].is_a?(Hash) ? SpikePay::ProductsRequest.new(['products'][0]) : value
  attributes['products'] = value
end
products() click to toggle source
# File lib/spike_pay/data_types.rb, line 82
def products
  attributes['products']
end