Sha256: 1e294065dd200e39c6944626ed880a15c789fd35de7369fdfd5e6abf9577263f

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

module ActiveMerchant
  module Billing
    module Integrations
      module Payline
        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'
        autoload :WebPaymentResponse,   File.dirname(__FILE__) + '/lib/web_payment_response.rb'
        
        # Overwrite this if you want to change the Payline homologation url
        mattr_accessor :homologation_url
        self.homologation_url= 'homologation.payline.com'

        # Overwrite this if you want to change the Payline production url
        mattr_accessor :production_url 
        self.production_url= 'services.payline.com'
        
        mattr_accessor :path
        self.path= '/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.authorize(options = {})
          WebPaymentResponse.new(
            WebPayment.authorize(options)
          )
        end
        
        def self.payment_details
          
        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.14 lib/active_merchant_payline/integration/payline.rb