Sha256: ac7a3d83e56a36693405d5e2c19ce1043c877d6d72cdce2f6dd829daa0c9773d

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 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'

        # 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

1 entries across 1 versions & 1 rubygems

Version Path
active_merchant_payline-0.2.8 lib/active_merchant_payline/integration/payline.rb