class Io::Flow::V0::Models::MerchantOfRecordPaymentForm
Creates an online payment
Attributes
amount[R]
currency[R]
method[R]
order_number[R]
Public Class Methods
new(incoming={})
click to toggle source
Calls superclass method
Io::Flow::V0::Models::PaymentForm::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 50333 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
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50347 def copy(incoming={}) MerchantOfRecordPaymentForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
subtype_to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50351 def subtype_to_hash { :method => method, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50343 def to_json JSON.dump(to_hash) end