Class: Io::Flow::V0::Models::PaymentMethodSummaryAfterpay

Inherits:
PaymentMethodSummary show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodSummary

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodSummary

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodSummaryAfterpay

Returns a new instance of PaymentMethodSummaryAfterpay.



57928
57929
57930
57931
57932
57933
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57928

def initialize(incoming={})
  super(:type => PaymentMethodSummary::Types::PAYMENT_METHOD_SUMMARY_AFTERPAY)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:merchant_of_record], 'PaymentMethodSummaryAfterpay')
  @merchant_of_record = (x = opts.delete(:merchant_of_record); x.is_a?(::Io::Flow::V0::Models::MerchantOfRecord) ? x : ::Io::Flow::V0::Models::MerchantOfRecord.apply(x))
end

Instance Attribute Details

#merchant_of_recordObject (readonly)

Returns the value of attribute merchant_of_record.



57926
57927
57928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57926

def merchant_of_record
  @merchant_of_record
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57939
57940
57941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57939

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

#subtype_to_hashObject



57943
57944
57945
57946
57947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57943

def subtype_to_hash
  {
    :merchant_of_record => merchant_of_record.value
  }
end

#to_jsonObject



57935
57936
57937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57935

def to_json
  JSON.dump(to_hash)
end