Sha256: 5a0e372cb11477f569142f1f959de082a58e5075bd71368b74a2a12470ad5587

Contents?: true

Size: 1.19 KB

Versions: 48

Compression:

Stored size: 1.19 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Paxum
        class Helper < ActiveMerchant::Billing::Integrations::Helper
          include Common

          def initialize(order, account, options = {})
            @paxum_options = options.dup
            options.delete(:description)
            options.delete(:fail_url)
            options.delete(:success_url)
            options.delete(:result_url)
            super
            add_field "button_type_id", "1"
            add_field "variables", "notify_url=#{@paxum_options[:result_url]}"
            @paxum_options.each do |key, value|
              add_field mappings[key], value
            end
          end

          def form_fields
            @fields
          end

          def params
            @fields
          end

          mapping :account, 'business_email'
          mapping :amount, 'amount'
          mapping :currency, 'currency'
          mapping :order, 'item_id'
          mapping :description, 'item_name'
          mapping :fail_url, 'cancel_url'
          mapping :success_url, 'finish_url'
          mapping :result_url, 'notify_url'
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 4 rubygems

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