Class: OffsitePayments::Integrations::Newebpay::Return

Inherits:
Return
  • Object
show all
Includes:
HasTradeInfo
Defined in:
lib/offsite_payments/integrations/newebpay/return.rb

Overview

The Return object from NewebPay

Since:

  • 0.1.0

Instance Method Summary collapse

Methods included from HasTradeInfo

#checksum, #trade_info, #valid?

Instance Method Details

#cancelled?TrueClass|FalseClass

Does payment cancelled

Returns:

  • (TrueClass|FalseClass)

Since:

  • 0.1.0



26
27
28
# File 'lib/offsite_payments/integrations/newebpay/return.rb', line 26

def cancelled?
  !success?
end

#messageString

The Message from Newebpay

Returns:

  • (String)

Since:

  • 0.1.0



35
36
37
38
39
# File 'lib/offsite_payments/integrations/newebpay/return.rb', line 35

def message
  return unless valid?

  trade_info['Message']
end

#success?TrueClass|FalseClass

Does payment success

Returns:

  • (TrueClass|FalseClass)

Since:

  • 0.1.0



17
18
19
# File 'lib/offsite_payments/integrations/newebpay/return.rb', line 17

def success?
  valid? && params['Status'] == 'SUCCESS'
end