Sha256: 436046e3e389afffac66b4abed6233c7367342da2ef0c9800cbcc41bc9b69f34

Contents?: true

Size: 909 Bytes

Versions: 28

Compression:

Stored size: 909 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module PayuIn
        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['txnid'], @params['amount'] ) == 'Completed'
          end

          def message
            @notification.message
          end

        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
tanga_activemerchant-1.38.0.5 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.38.0.4 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.38.0.3 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.38.0.2 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.38.0.1 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.38.0 lib/active_merchant/billing/integrations/payu_in/return.rb
tanga_activemerchant-1.37.0 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.43.3 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/payu_in/return.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/payu_in/return.rb