Class: OffsitePayments::Integrations::DirecPay::Status
- Inherits:
-
Object
- Object
- OffsitePayments::Integrations::DirecPay::Status
- 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
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(account, options = {}) ⇒ Status
constructor
A new instance of Status.
- #test? ⇒ Boolean
-
#update(authorization, notification_url) ⇒ Object
Use this method to manually request a status update to the provided notification_url.
Constructor Details
#initialize(account, options = {}) ⇒ Status
Returns a new instance of Status.
312 313 314 |
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 312 def initialize(account, = {}) @account, @options = account, end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
310 311 312 |
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 310 def account @account end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
310 311 312 |
# File 'lib/offsite_payments/integrations/direc_pay.rb', line 310 def @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 || [: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(, notification_url) url = test? ? STATUS_TEST_URL : STATUS_LIVE_URL parameters = [ , account, notification_url ] data = ActiveUtils::PostData.new data[:requestparams] = parameters.join('|') response = ssl_get("#{url}?#{data.to_post_data}") end |