Parent

Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::Gestpay::Helper

Public Class Methods

new(order, account, options = {}) click to toggle source

Valid language codes

Italian           => 1
English               => 2
Spanish               => 3
French    => 4
Tedesco   => 5
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 13
def initialize(order, account, options = {})
  super
  add_field('PAY1_IDLANGUAGE', 2)
end

Public Instance Methods

currency=(currency_code) click to toggle source
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 38
def currency=(currency_code)
  code = CURRENCY_MAPPING[currency_code]
                              raise StandardError, "Invalid currency code #{currency_code} specified" if code.nil?
                              
                              add_field(mappings[:currency], code)
end
customer(params = {}) click to toggle source
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 33
def customer(params = {})
  add_field(mappings[:customer][:email], params[:email])
  add_field('PAY1_CHNAME', "#{params[:first_name]} #{params[:last_name]}")
end
encryption_query_string() click to toggle source
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 59
def encryption_query_string
  fields = ['PAY1_AMOUNT', 'PAY1_SHOPTRANSACTIONID', 'PAY1_UICCODE']

  encoded_params = fields.collect{ |field| "#{field}=#{CGI.escape(@fields[field])}" }.join(DELIMITER)

  "#{ENCRYPTION_PATH}?a=" + CGI.escape(@fields['ShopLogin']) + "&b=" + encoded_params + "&c=" + CGI.escape(VERSION)
end
form_fields() click to toggle source
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 45
def form_fields
  @encrypted_data ||= get_encrypted_string
            
  {
    'a' => @fields['ShopLogin'],
    'b' => @encrypted_data
  }
end
get_encrypted_string() click to toggle source
# File lib/active_merchant/billing/integrations/gestpay/helper.rb, line 54
def get_encrypted_string
  response = ssl_get(Gestpay.service_url, encryption_query_string)
  parse_response(response)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.