class OffsitePayments::Integrations::DirecPay::Return

Public Class Methods

new(post_data, options = {}) click to toggle source
# File lib/offsite_payments/integrations/direc_pay.rb, line 291
def initialize(post_data, options = {})
  @notification = Notification.new(treat_failure_as_pending(post_data), options)
end

Public Instance Methods

message() click to toggle source
# File lib/offsite_payments/integrations/direc_pay.rb, line 299
def message
  notification.status
end
success?() click to toggle source
# File lib/offsite_payments/integrations/direc_pay.rb, line 295
def success?
  notification.complete?
end

Private Instance Methods

treat_failure_as_pending(post_data) click to toggle source

Work around the issue that the initial return from DirecPay is always either SUCCESS or FAIL, there is no PENDING

# File lib/offsite_payments/integrations/direc_pay.rb, line 306
def treat_failure_as_pending(post_data)
  post_data.sub(/FAIL/, 'PENDING')
end