Sha256: a2f41a5cf95702f012734d61e1b7a1322fcbf6f3f148b1cc3fa700bc6654995d

Contents?: true

Size: 998 Bytes

Versions: 46

Compression:

Stored size: 998 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module EasyPay
        module Common
          def generate_signature(type)
            string = case type
                     when :request
                       request_signature_string
                     when :notify
                       notify_signature_string
                     end

            Digest::MD5.hexdigest(string)
          end

          def request_signature_string
            [
              @fields[mappings[:account]],
              @secret,
              @fields[mappings[:order]],
              @fields[mappings[:amount]]
            ].join
          end

          def notify_signature_string
            [
              params['order_mer_code'],
              params['sum'],
              params['mer_no'],
              params['card'],
              params['purch_date'],
              secret
            ].join
          end
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.43.3 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/easy_pay/common.rb