Class: Io::Flow::V0::Models::ShopifyMerchantApplicationForm

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

Instance Attribute Summary collapse

Attributes inherited from MerchantApplicationForm

#discriminator

Instance Method Summary collapse

Methods inherited from MerchantApplicationForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ShopifyMerchantApplicationForm

Returns a new instance of ShopifyMerchantApplicationForm.



63063
63064
63065
63066
63067
63068
63069
63070
63071
63072
63073
63074
63075
63076
63077
63078
63079
63080
63081
63082
63083
63084
63085
63086
63087
63088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63063

def initialize(incoming={})
  super(:discriminator => MerchantApplicationForm::Types::SHOPIFY_MERCHANT_APPLICATION_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @company = (x = opts.delete(:company); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantInfo) ? x : ::Io::Flow::V0::Models::MerchantInfo.new(x)))
  @indirect_tax_number = (x = opts.delete(:indirect_tax_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('indirect_tax_number', x, String))
  @parent_company = (x = opts.delete(:parent_company); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantInfo) ? x : ::Io::Flow::V0::Models::MerchantInfo.new(x)))
  @beneficiary = (x = opts.delete(:beneficiary); x.nil? ? nil : HttpClient::Preconditions.assert_class('beneficiary', x, String))
  @business_url = (x = opts.delete(:business_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('business_url', x, String))
  @business_description = (x = opts.delete(:business_description); x.nil? ? nil : HttpClient::Preconditions.assert_class('business_description', x, String))
  @business_address = (x = opts.delete(:business_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
  @refund_percentage = (x = opts.delete(:refund_percentage); x.nil? ? nil : HttpClient::Preconditions.assert_class('refund_percentage', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @chargeback_percentage = (x = opts.delete(:chargeback_percentage); x.nil? ? nil : HttpClient::Preconditions.assert_class('chargeback_percentage', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @bank_account_number = (x = opts.delete(:bank_account_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('bank_account_number', x, String))
  @aba_routing_transit_number = (x = opts.delete(:aba_routing_transit_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('aba_routing_transit_number', x, String))
  @trade_sectors = (x = opts.delete(:trade_sectors); x.nil? ? nil : HttpClient::Preconditions.assert_class('trade_sectors', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OnboardingTradeSector) ? x : ::Io::Flow::V0::Models::OnboardingTradeSector.apply(x)) })
  @other_trade_sector = (x = opts.delete(:other_trade_sector); x.nil? ? nil : HttpClient::Preconditions.assert_class('other_trade_sector', x, String))
  @third_party_logistics_partners = (x = opts.delete(:third_party_logistics_partners); x.nil? ? nil : HttpClient::Preconditions.assert_class('third_party_logistics_partners', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ThirdPartyLogisticsPartner) ? x : ::Io::Flow::V0::Models::ThirdPartyLogisticsPartner.new(x)) })
  @average_order_weight = (x = opts.delete(:average_order_weight); x.nil? ? nil : HttpClient::Preconditions.assert_class('average_order_weight', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @package_dimensions = (x = opts.delete(:package_dimensions); x.nil? ? nil : HttpClient::Preconditions.assert_class('package_dimensions', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)) })
  @monthly_average_volume_amount = (x = opts.delete(:monthly_average_volume_amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_volume_amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @monthly_average_volume_currency = (x = opts.delete(:monthly_average_volume_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_volume_currency', x, String))
  @monthly_average_number_transactions = (x = opts.delete(:monthly_average_number_transactions); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_number_transactions', x, Integer))
  @dangerous_goods = (x = opts.delete(:dangerous_goods); x.nil? ? nil : HttpClient::Preconditions.assert_class('dangerous_goods', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OnboardingDangerousGoods) ? x : ::Io::Flow::V0::Models::OnboardingDangerousGoods.apply(x)) })
  @default_country_of_origin = (x = opts.delete(:default_country_of_origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_country_of_origin', x, String))
  @ratecard_id = (x = opts.delete(:ratecard_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('ratecard_id', x, String))
end

Instance Attribute Details

#aba_routing_transit_numberObject (readonly)

Returns the value of attribute aba_routing_transit_number.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def aba_routing_transit_number
  @aba_routing_transit_number
end

#average_order_weightObject (readonly)

Returns the value of attribute average_order_weight.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def average_order_weight
  @average_order_weight
end

#bank_account_numberObject (readonly)

Returns the value of attribute bank_account_number.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def 
  @bank_account_number
end

#beneficiaryObject (readonly)

Returns the value of attribute beneficiary.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def beneficiary
  @beneficiary
end

#business_addressObject (readonly)

Returns the value of attribute business_address.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def business_address
  @business_address
end

#business_descriptionObject (readonly)

Returns the value of attribute business_description.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def business_description
  @business_description
end

#business_urlObject (readonly)

Returns the value of attribute business_url.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def business_url
  @business_url
end

#chargeback_percentageObject (readonly)

Returns the value of attribute chargeback_percentage.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def chargeback_percentage
  @chargeback_percentage
end

#companyObject (readonly)

Returns the value of attribute company.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def company
  @company
end

#dangerous_goodsObject (readonly)

Returns the value of attribute dangerous_goods.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def dangerous_goods
  @dangerous_goods
end

#default_country_of_originObject (readonly)

Returns the value of attribute default_country_of_origin.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def default_country_of_origin
  @default_country_of_origin
end

#indirect_tax_numberObject (readonly)

Returns the value of attribute indirect_tax_number.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def indirect_tax_number
  @indirect_tax_number
end

#monthly_average_number_transactionsObject (readonly)

Returns the value of attribute monthly_average_number_transactions.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def monthly_average_number_transactions
  @monthly_average_number_transactions
end

#monthly_average_volume_amountObject (readonly)

Returns the value of attribute monthly_average_volume_amount.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def monthly_average_volume_amount
  @monthly_average_volume_amount
end

#monthly_average_volume_currencyObject (readonly)

Returns the value of attribute monthly_average_volume_currency.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def monthly_average_volume_currency
  @monthly_average_volume_currency
end

#other_trade_sectorObject (readonly)

Returns the value of attribute other_trade_sector.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def other_trade_sector
  @other_trade_sector
end

#package_dimensionsObject (readonly)

Returns the value of attribute package_dimensions.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def package_dimensions
  @package_dimensions
end

#parent_companyObject (readonly)

Returns the value of attribute parent_company.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def parent_company
  @parent_company
end

#ratecard_idObject (readonly)

Returns the value of attribute ratecard_id.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def ratecard_id
  @ratecard_id
end

#refund_percentageObject (readonly)

Returns the value of attribute refund_percentage.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def refund_percentage
  @refund_percentage
end

#third_party_logistics_partnersObject (readonly)

Returns the value of attribute third_party_logistics_partners.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def third_party_logistics_partners
  @third_party_logistics_partners
end

#trade_sectorsObject (readonly)

Returns the value of attribute trade_sectors.



63061
63062
63063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63061

def trade_sectors
  @trade_sectors
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



63094
63095
63096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63094

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

#subtype_to_hashObject



63098
63099
63100
63101
63102
63103
63104
63105
63106
63107
63108
63109
63110
63111
63112
63113
63114
63115
63116
63117
63118
63119
63120
63121
63122
63123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63098

def subtype_to_hash
  {
    :company => company.nil? ? nil : company.to_hash,
    :indirect_tax_number => indirect_tax_number,
    :parent_company => parent_company.nil? ? nil : parent_company.to_hash,
    :beneficiary => beneficiary,
    :business_url => business_url,
    :business_description => business_description,
    :business_address => business_address.nil? ? nil : business_address.to_hash,
    :refund_percentage => refund_percentage.to_f.to_s,
    :chargeback_percentage => chargeback_percentage.to_f.to_s,
    :bank_account_number => ,
    :aba_routing_transit_number => aba_routing_transit_number,
    :trade_sectors => trade_sectors.nil? ? nil : trade_sectors.map { |o| o.value },
    :other_trade_sector => other_trade_sector,
    :third_party_logistics_partners => third_party_logistics_partners.nil? ? nil : third_party_logistics_partners.map { |o| o.to_hash },
    :average_order_weight => average_order_weight.to_f.to_s,
    :package_dimensions => package_dimensions.nil? ? nil : package_dimensions.map { |o| o.to_hash },
    :monthly_average_volume_amount => monthly_average_volume_amount.to_f.to_s,
    :monthly_average_volume_currency => monthly_average_volume_currency,
    :monthly_average_number_transactions => monthly_average_number_transactions,
    :dangerous_goods => dangerous_goods.nil? ? nil : dangerous_goods.map { |o| o.value },
    :default_country_of_origin => default_country_of_origin,
    :ratecard_id => ratecard_id
  }
end

#to_jsonObject



63090
63091
63092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63090

def to_json
  JSON.dump(to_hash)
end