Sha256: db9626cc713418716cbc0249873b1ce607e340165a71739278dfea01f4131319

Contents?: true

Size: 858 Bytes

Versions: 18

Compression:

Stored size: 858 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Paysbuy
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          SUCCESS = '00'
          FAIL = '99'
          PENDING = '02'

          def complete?
            status == 'Completed'
          end

          def item_id
            params['result'][2..-1]
          end

          def status
            status_code = params['result'][0..1]
            case status_code
            when SUCCESS
              'Completed'
            when FAIL
              'Failed'
            when PENDING
              'Pending'
            else
              raise "Unknown status code"
            end
          end

          def acknowledge(authcode = nil)
            true
          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/paysbuy/notification.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.5 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.4 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.3 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.2 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.1 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.42.0 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.41.0 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.40.0 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.39.2 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.39.1 lib/active_merchant/billing/integrations/paysbuy/notification.rb
activemerchant-1.39.0 lib/active_merchant/billing/integrations/paysbuy/notification.rb