Sha256: c9083078087ca11c67a7a94bd1c48c9f9fb9f9df260f7b8f1030f53365ee03f3

Contents?: true

Size: 1.35 KB

Versions: 5

Compression:

Stored size: 1.35 KB

Contents

module ActiveMerchant
  module Billing
    module Integrations
      module Payline
        autoload :Helper,       File.dirname(__FILE__) + '/lib/helper.rb'
        autoload :Return,       File.dirname(__FILE__) + '/lib/return.rb'
        autoload :Notification, File.dirname(__FILE__) + '/lib/notification.rb'
        autoload :WebPayment,   File.dirname(__FILE__) + '/lib/web_payment.rb'

        # Overwrite this if you want to change the Payline homologation url
        mattr_accessor :homologation_url
        self.homologation_url = 'https://homologation.payline.com/V4/services/DirectPaymentAPI'

        # Overwrite this if you want to change the Payline production url
        mattr_accessor :production_url 
        self.production_url = 'https://services.payline.com/V4/services/DirectPaymentAPI'

        def self.service_url
          mode = ActiveMerchant::Billing::Base.integration_mode
          case mode
          when :production
            self.production_url    
          when :test
            self.homologation_url
          else
            raise StandardError, "Integration mode set to an invalid value: #{mode}"
          end
        end

        def self.notification(post)
          Notification.new(post)
        end

        def self.return(query_string, options = {})
          Return.new(query_string)
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_merchant_payline-0.2.13 lib/active_merchant_payline/integration/payline.rb
active_merchant_payline-0.2.12 lib/active_merchant_payline/integration/payline.rb
active_merchant_payline-0.2.11 lib/active_merchant_payline/integration/payline.rb
active_merchant_payline-0.2.10 lib/active_merchant_payline/integration/payline.rb
active_merchant_payline-0.2.9 lib/active_merchant_payline/integration/payline.rb