Sha256: b4dfd95a9e9ea0e69093e50f14683243431a0be5b7ff457c8bfa2b9027ec7145

Contents?: true

Size: 981 Bytes

Versions: 29

Compression:

Stored size: 981 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Platron
        class Helper < ActiveMerchant::Billing::Integrations::Helper
          def initialize(order, account, options = {})
            @secret_key = options.delete(:secret)
            @path = options.delete(:path)
            description = options.delete(:description)
            super
            self.add_field('pg_salt', rand(36**15).to_s(36))
            self.add_field('pg_description', description)
          end

          def form_fields
            @fields.merge('pg_sig' => Common.generate_signature(@fields, @path, @secret_key))
          end

          def params
            @fields
          end

          mapping :account, 'pg_merchant_id'
          mapping :amount, 'pg_amount'
          mapping :order, 'pg_order_id'
          mapping :description, 'pg_description'
          mapping :currency, 'pg_currency'
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

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