Sha256: cdfe7f52985f13927f22ccc2705df27153943bac901ec1fc9bcd20b21b5599bd

Contents?: true

Size: 969 Bytes

Versions: 18

Compression:

Stored size: 969 Bytes

Contents

module ActiveMerchant
  module Billing
    module Integrations
      module Citrus
        class Return < ActiveMerchant::Billing::Integrations::Return

          def initialize(query_string, options = {})
            super
            @notification = Notification.new(query_string, options)
          end

          def transaction_id
            @notification.transaction_id
          end

          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

          def success?
            status( @params['TxId'], @params['amount'] ) == 'Completed'
          end

          def message
            @notification.message
          end

          def cancelled?
            @notification.status == 'Cancelled'
          end

        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
activemerchant-1.43.3 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.41.0 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/citrus/return.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/citrus/return.rb