Class: OffsitePayments::Integrations::Citrus::Return
- Defined in:
- lib/offsite_payments/integrations/citrus.rb
Instance Attribute Summary
Attributes inherited from Return
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
-
#initialize(query_string, options = {}) ⇒ Return
constructor
A new instance of Return.
- #message ⇒ Object
- #status(order_id, order_amount) ⇒ Object
- #success? ⇒ Boolean
- #transaction_id ⇒ Object
Methods inherited from Return
Constructor Details
#initialize(query_string, options = {}) ⇒ Return
Returns a new instance of Return.
196 197 198 199 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 196 def initialize(query_string, = {}) super @notification = Notification.new(query_string, ) end |
Instance Method Details
#cancelled? ⇒ Boolean
221 222 223 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 221 def cancelled? @notification.status == 'Failed' end |
#message ⇒ Object
217 218 219 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 217 def @notification. end |
#status(order_id, order_amount) ⇒ Object
205 206 207 208 209 210 211 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 205 def status( order_id, order_amount ) if @notification.invoice_ok?( order_id ) && @notification.amount_ok?( BigDecimal.new(order_amount) ) @notification.status else 'Mismatch' end end |
#success? ⇒ Boolean
213 214 215 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 213 def success? status( @params['TxId'], @params['amount'] ) == 'Completed' end |
#transaction_id ⇒ Object
201 202 203 |
# File 'lib/offsite_payments/integrations/citrus.rb', line 201 def transaction_id @notification.transaction_id end |