Class: ActiveMerchant::Billing::Integrations::DirecPay::Status

Inherits:
Object
  • Object
show all
Includes:
PostsData
Defined in:
lib/active_merchant/billing/integrations/direc_pay/status.rb

Constant Summary collapse

STATUS_TEST_URL =
'https://test.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.jsp'
STATUS_LIVE_URL =
'https://www.timesofmoney.com/direcpay/secure/dpPullMerchAtrnDtls.jsp'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PostsData

included, #ssl_get, #ssl_post

Constructor Details

#initialize(account, options = {}) ⇒ Status

Returns a new instance of Status.



14
15
16
# File 'lib/active_merchant/billing/integrations/direc_pay/status.rb', line 14

def initialize(, options = {})
  @account, @options = , options
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



12
13
14
# File 'lib/active_merchant/billing/integrations/direc_pay/status.rb', line 12

def 
  @account
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/active_merchant/billing/integrations/direc_pay/status.rb', line 12

def options
  @options
end

Instance Method Details

#test?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/active_merchant/billing/integrations/direc_pay/status.rb', line 29

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

#update(authorization, notification_url) ⇒ Object

Use this method to manually request a status update to the provided notification_url



20
21
22
23
24
25
26
27
# File 'lib/active_merchant/billing/integrations/direc_pay/status.rb', line 20

def update(authorization, notification_url)
  url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL
  parameters = [ authorization, , notification_url ]
  data = PostData.new
  data[:requestparams] = parameters.join('|')
  
  response = ssl_get("#{url}?#{data.to_post_data}")
end