Class: OffsitePayments::Integrations::DirecPay::Status

Inherits:
Object
  • Object
show all
Includes:
ActiveUtils::PostsData
Defined in:
lib/offsite_payments/integrations/direc_pay.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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


312
313
314
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 312

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

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account


310
311
312
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 310

def 
  @account
end

#optionsObject (readonly)

Returns the value of attribute options


310
311
312
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 310

def options
  @options
end

Instance Method Details

#test?Boolean


326
327
328
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 326

def test?
  OffsitePayments.mode == :test || options[:test]
end

#update(authorization, notification_url) ⇒ Object

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


317
318
319
320
321
322
323
324
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 317

def update(authorization, notification_url)
  url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL
  parameters = [ authorization, , notification_url ]
  data = ActiveUtils::PostData.new
  data[:requestparams] = parameters.join('|')

  response = ssl_get("#{url}?#{data.to_post_data}")
end