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
activemerchant-1.41.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.38.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.38.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.37.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.36.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.35.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.35.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.34.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.34.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.33.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.32.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.32.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.31.1 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.31.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
activemerchant-1.30.0 lib/active_merchant/billing/integrations/easy_pay/common.rb
jelaniharris-activemerchant-1.29.2 lib/active_merchant/billing/integrations/easy_pay/common.rb