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

Inherits:
Object
  • Object
show all
Includes:
ActiveMerchant::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

Returns a new instance of Status.



319
320
321
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 319

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

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



317
318
319
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 317

def 
  @account
end

#optionsObject (readonly)

Returns the value of attribute options.



317
318
319
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 317

def options
  @options
end

Instance Method Details

#test?Boolean

Returns:

  • (Boolean)


333
334
335
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 333

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



324
325
326
327
328
329
330
331
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 324

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

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