Sha256: da7ae8c50bcb16c50208c46056b1c907fadb0423f1792764ed024f3302150b97

Contents?: true

Size: 833 Bytes

Versions: 93

Compression:

Stored size: 833 Bytes

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:

      module DirecPay
        class Return < ActiveMerchant::Billing::Integrations::Return
          
          def initialize(post_data, options = {})
            @notification = Notification.new(treat_failure_as_pending(post_data), options)
          end

          def success?
            notification.complete?
          end
          
          def message
            notification.status
          end
          
          
          private
          
          # Work around the issue that the initial return from DirecPay is always either SUCCESS or FAIL, there is no PENDING
          def treat_failure_as_pending(post_data)
            post_data.sub(/FAIL/, 'PENDING')
          end
        end
      end
      
    end
  end
end

Version data entries

93 entries across 93 versions & 13 rubygems

Version Path
yetanothernguyen-activemerchant-1.21.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.21.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
tlconnor-activemerchant-1.20.4 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.20.4 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.20.3 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.20.2 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.20.1 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.20.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
vibedeck-activemerchant-1.18.2 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.18.1 lib/active_merchant/billing/integrations/direc_pay/return.rb
fishman-activemerchant-1.18.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.18.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.17.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
yetanothernguyen-activemerchant-1.16.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.16.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
gonow-activemerchant-1.15.0 lib/active_merchant/billing/integrations/direc_pay/return.rb
bitfluent-activemerchant-1.15.1 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-kiddy-1.15.0.kiddy.1 lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-kiddy-1.15.0.kiddy lib/active_merchant/billing/integrations/direc_pay/return.rb
activemerchant-1.15.0 lib/active_merchant/billing/integrations/direc_pay/return.rb