Sha256: 9be4d86d8b3fe7b0b1ecc030fd6b50336816a66635149afa366046178237155a

Contents?: true

Size: 1.19 KB

Versions: 34

Compression:

Stored size: 1.19 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module DirecPay
        
        class Status
          include PostsData
                    
          STATUS_TEST_URL = 'https://test.direcpay.com/direcpay/secure/dpMerchantTransaction.jsp'
          STATUS_LIVE_URL = 'https://www.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.jsp'
          
          attr_reader :account, :options
          
          def initialize(account, options = {})
            @account, @options = account, options
          end
          
          
          # Use this method to manually request a status update to the provided notification_url
          def update(authorization, notification_url)
            url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL
            parameters = [ authorization, account, notification_url ]
            data = PostData.new
            data[:requestparams] = parameters.join('|')
            
            response = ssl_get("#{url}?#{data.to_post_data}")
          end

          def test?
            ActiveMerchant::Billing::Base.integration_mode == :test || options[:test]
          end
          
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
activemerchant-1.41.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.38.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.38.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.37.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.36.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.35.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.35.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.34.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.34.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.33.0 lib/active_merchant/billing/integrations/direc_pay/status.rb