Skip to main content

Countries-data

This page offers some information about country related entities.

Admin path for countries: /backend/countries

Fiscality related information regarding countries is available in another wiki.

Setup a new Country​

This is the procedure to create a new country (sample here: Germany):

area = Area.create!(formatted_name: 'Berlin')
vat = Vat.create!(percentage: 0.19, name: '19%', official: true)
domain = Domain.create!({ name: 'Uala DE', url: 'uala.de', short_name: 'uala.de', locales: ['de'], default_locale: 'de', frontend_url: 'www.uala.de', widget_url: 'widget.uala.de' }, without_protection: true)
company = Company.find_by!(name: 'Uala S.r.l.')
country = Country.create!(name: 'Germany', code: 'de', phone_prefix: '49', default_locale: 'de')
country.update!(areas: [area], vats: [vat], domains: [domain], default_domain: domain, company: company)
domain.update({ default_country: country }, without_protection: true)

Change the cancellation mode​

Available models: 'cancel', 'revert'

Country.find_by(code: 'pt').update(checkout_cancellation_mode: 'cancel')

Country Providers​

Admin path for country providers: /backend/country_providers

These entities are used to store:

  • credentials for external services (payment gateways, url shortner services, notification providers, etc.);
  • public and private keys for fiscality;
  • other country-wide configuration options.