Class: ActiveMerchant::Billing::Integrations::Citrus::Return
- Defined in:
- lib/active_merchant/billing/integrations/citrus/return.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.
7 8 9 10 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 7 def initialize(query_string, = {}) super @notification = Notification.new(query_string, ) end |
Instance Method Details
#cancelled? ⇒ Boolean
32 33 34 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 32 def cancelled? @notification.status == 'Cancelled' end |
#message ⇒ Object
28 29 30 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 28 def @notification. end |
#status(order_id, order_amount) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 16 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
24 25 26 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 24 def success? status( @params['TxId'], @params['amount'] ) == 'Completed' end |
#transaction_id ⇒ Object
12 13 14 |
# File 'lib/active_merchant/billing/integrations/citrus/return.rb', line 12 def transaction_id @notification.transaction_id end |