class OffsitePayments::Integrations::Moneybookers::Helper
Constants
- MAPPED_COUNTRY_CODES
- SUPPORTED_COUNTRY_CODES
Public Class Methods
new(order, account, options = {})
click to toggle source
Calls superclass method
# File lib/offsite_payments/integrations/moneybookers.rb, line 55 def initialize(order, account, options = {}) super add_tracking_token add_default_parameters add_seller_details(options) end
Private Instance Methods
add_default_parameters()
click to toggle source
# File lib/offsite_payments/integrations/moneybookers.rb, line 71 def add_default_parameters add_field('hide_login', 1) end
add_seller_details(options)
click to toggle source
# File lib/offsite_payments/integrations/moneybookers.rb, line 75 def add_seller_details(options) add_field('recipient_description', options[:account_name]) if options[:account_name] add_field('country', lookup_country_code(options[:country], :alpha3)) if options[:country] add_field('language', locale_code(options[:country])) if options[:country] end
add_tracking_token()
click to toggle source
# File lib/offsite_payments/integrations/moneybookers.rb, line 64 def add_tracking_token return if application_id.blank? || application_id == 'ActiveMerchant' add_field('merchant_fields', 'platform') add_field('platform', application_id) end
locale_code(country_code)
click to toggle source
# File lib/offsite_payments/integrations/moneybookers.rb, line 81 def locale_code(country_code) return country_code if SUPPORTED_COUNTRY_CODES.include?(country_code) MAPPED_COUNTRY_CODES[country_code] || 'EN' end