Class: Io::Flow::V0::Models::PaymentMethodSummaryPaypal

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 = {}) ⇒ PaymentMethodSummaryPaypal

Returns a new instance of PaymentMethodSummaryPaypal.



53740
53741
53742
53743
53744
53745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53740

def initialize(incoming={})
  super(:type => PaymentMethodSummary::Types::PAYMENT_METHOD_SUMMARY_PAYPAL)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:merchant_of_record], 'PaymentMethodSummaryPaypal')
  @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.



53738
53739
53740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53738

def merchant_of_record
  @merchant_of_record
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53751
53752
53753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53751

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

#subtype_to_hashObject



53755
53756
53757
53758
53759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53755

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

#to_jsonObject



53747
53748
53749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53747

def to_json
  JSON.dump(to_hash)
end