Class: Io::Flow::V0::Models::MerchantOfRecordPaymentForm

Inherits:
PaymentForm
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Creates an online payment

Instance Attribute Summary collapse

Attributes inherited from PaymentForm

#discriminator

Instance Method Summary collapse

Methods inherited from PaymentForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ MerchantOfRecordPaymentForm

Returns a new instance of MerchantOfRecordPaymentForm.



17408
17409
17410
17411
17412
17413
17414
17415
17416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17408

def initialize(incoming={})
  super(:discriminator => PaymentForm::Types::MERCHANT_OF_RECORD_PAYMENT_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:method, :order_number, :amount, :currency], 'MerchantOfRecordPaymentForm')
  @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String)
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



17406
17407
17408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17406

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



17406
17407
17408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17406

def currency
  @currency
end

#methodObject (readonly)

Returns the value of attribute method.



17406
17407
17408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17406

def method
  @method
end

#order_numberObject (readonly)

Returns the value of attribute order_number.



17406
17407
17408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17406

def order_number
  @order_number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17422
17423
17424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17422

def copy(incoming={})
  MerchantOfRecordPaymentForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



17426
17427
17428
17429
17430
17431
17432
17433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17426

def subtype_to_hash
  {
    :method => method,
    :order_number => order_number,
    :amount => amount,
    :currency => currency
  }
end

#to_jsonObject



17418
17419
17420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17418

def to_json
  JSON.dump(to_hash)
end