Class: OffsitePayments::Integrations::SagePayForm::Return

Inherits:
Return
  • Object
show all
Defined in:
lib/offsite_payments/integrations/sage_pay_form.rb

Instance Attribute Summary

Attributes inherited from Return

#notification, #params

Instance Method Summary collapse

Methods inherited from Return

#parse

Constructor Details

#initialize(query_string, options) ⇒ Return

Returns a new instance of Return.



412
413
414
415
416
417
418
# File 'lib/offsite_payments/integrations/sage_pay_form.rb', line 412

def initialize(query_string, options)
  begin
    @notification = Notification.new(query_string, options)
  rescue Notification::CryptError => e
    @message = e.message
  end
end

Instance Method Details

#cancelled?Boolean

Returns:

  • (Boolean)


424
425
426
# File 'lib/offsite_payments/integrations/sage_pay_form.rb', line 424

def cancelled?
  @notification && @notification.cancelled?
end

#messageObject



428
429
430
# File 'lib/offsite_payments/integrations/sage_pay_form.rb', line 428

def message
  @message || @notification.message
end

#success?Boolean

Returns:

  • (Boolean)


420
421
422
# File 'lib/offsite_payments/integrations/sage_pay_form.rb', line 420

def success?
  @notification && @notification.complete?
end