Parent

Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::Chronopay::Helper

Constants

COUNTRIES_FOR_LANG

All currently supported checkout languages:

es (Spanish)
en (English)
de (German)
pt (Portuguese)
lv (Latvian)
cn1 (Chinese Version 1)
cn2 (Chinese version 2)
nl (Dutch)
ru (Russian)
LANG_FOR_COUNTRY

Public Class Methods

new(order, account, options = {}) click to toggle source
# File lib/active_merchant/billing/integrations/chronopay/helper.rb, line 36
def initialize(order, account, options = {})
  super
  add_field('cb_type', 'p')
end

Public Instance Methods

billing_address(mapping = {}) click to toggle source
# File lib/active_merchant/billing/integrations/chronopay/helper.rb, line 71
def billing_address(mapping = {})
  # Gets the country code in the appropriate format or returns what we were given
  # The appropriate format for Chronopay is the alpha 3 country code
  country_code = lookup_country_code(mapping.delete(:country))
  add_field(mappings[:billing_address][:country], country_code)
  
  countries_with_supported_states = ['USA', 'CAN']
  if !countries_with_supported_states.include?(country_code)
    mapping.delete(:state)
    add_field(mappings[:billing_address][:state], 'XX')
  end  
  mapping.each do |k, v|
    field = mappings[:billing_address][k]
    add_field(field, v) unless field.nil?
  end 
  add_field('language', checkout_language_from_country(country_code))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.