Class: Io::Flow::V0::Models::MerchantOfRecordPaymentForm
- Inherits:
-
PaymentForm
- Object
- PaymentForm
- Io::Flow::V0::Models::MerchantOfRecordPaymentForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Creates an online payment
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
Attributes inherited from PaymentForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MerchantOfRecordPaymentForm
constructor
A new instance of MerchantOfRecordPaymentForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from PaymentForm
Constructor Details
#initialize(incoming = {}) ⇒ MerchantOfRecordPaymentForm
Returns a new instance of MerchantOfRecordPaymentForm.
39657 39658 39659 39660 39661 39662 39663 39664 39665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39657 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
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
39655 39656 39657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39655 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
39655 39656 39657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39655 def currency @currency end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
39655 39656 39657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39655 def method @method end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
39655 39656 39657 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39655 def order_number @order_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
39671 39672 39673 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39671 def copy(incoming={}) MerchantOfRecordPaymentForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
39675 39676 39677 39678 39679 39680 39681 39682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39675 def subtype_to_hash { :method => method, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
39667 39668 39669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39667 def to_json JSON.dump(to_hash) end |