Sha256: c8989525a2b6b7fa0967517b9c3a30012d55ab9fb4b0366ccd239316618f637c

Contents?: true

Size: 1.19 KB

Versions: 59

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.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.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

59 entries across 59 versions & 12 rubygems

Version Path
tlconnor-activemerchant-1.23.3 lib/active_merchant/billing/integrations/direc_pay/status.rb
tlconnor-activemerchant-1.23.2 lib/active_merchant/billing/integrations/direc_pay/status.rb
tlconnor-activemerchant-1.23.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
tlconnor-activemerchant-1.23.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.23.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.22.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
yetanothernguyen-activemerchant-1.21.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.21.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
tlconnor-activemerchant-1.20.4 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.20.4 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.20.3 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.20.2 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.20.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.20.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
vibedeck-activemerchant-1.18.2 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.18.1 lib/active_merchant/billing/integrations/direc_pay/status.rb
fishman-activemerchant-1.18.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.18.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
activemerchant-1.17.0 lib/active_merchant/billing/integrations/direc_pay/status.rb
yetanothernguyen-activemerchant-1.16.0 lib/active_merchant/billing/integrations/direc_pay/status.rb