lib/active_merchant/billing/integrations/dibs_flexwin/notification.rb
# Acknowledge the transaction to DibsFlexwin. This method has to be called after a new
# apc arrives. DibsFlexwin will verify that all the information we received are correct and will return a
# ok or a fail.
#
# Example:
#
#   def callback
#     notification = DibsFlexwin::Notification.new( request.raw_post, {
#       :remote_ip     => request.remote_ip,
#       :merchant      => "testmerchant",
#       :security_key1 => "this_is_key1",
#       :security_key2 => "this_is_key2"
#     })
#
#     begin
#       notification.acknowledge
#
#       if notification.potential_fraud?
#         logger.warn { "Got a potential fraud. Look into it." }
#       elsif notification.complete?
#         logger.info { "Got a completed notification, updated order and other stuff." }
#       else
#         logger.warn { "Transaction declined. #{notification.status()}"}
#       end
#
#     rescue ActiveMerchant::Billing::Integrations::DibsFlexwin::Error => e
#       logger.warn { "Got a DIBS error: #{e.message}" }
#     rescue => e
#       logger.warn("Illegal notification received: #{e.message}")
#     ensure
#       head(:ok)
#     end
#   end
Acknowledge the transaction to DibsFlexwin. This method has to be called after a new
apc arrives. DibsFlexwin will verify that all the information we received are correct and will return a
ok or a fail.










Acknowledge the transaction to DibsFlexwin . This method has to be called after a new apc arrives . DibsFlexwin will verify that all the information we received are correct and will return a ok or a fail .
def acknowledge
            raise StandardError, "Invalid sender (#{@options[:remote_ip]})." unless valid_sender?(@options[:remote_ip])
            return true unless params.include?("authkey")
            raise ArgumentError, "Missing security_key1 or security_key2." unless @options[:security_key1] && @options[:security_key2]
            rkey = md5_authkey_preauth( @options[:security_key1], @options[:security_key2],
                                transaction_id(),
                                currency()
            )
            if (rkey.eql?(security_key()))
              @recurring = true
              return true
            end
            key = md5_authkey( @options[:security_key1], @options[:security_key2],
                                transaction_id(),
                                currency(),
                                gross_cents()
            )
            key_match = key.eql?(security_key())
            raise ActiveMerchant::Billing::Integrations::DibsFlexwin::Error, "Invalid authkey" unless key_match
            key_match
          end
def acknowledge raise StandardError , "Invalid sender (#{@options[:remote_ip]})." unless valid_sender? ( @options [ :remote_ip ] ) return true unless params . include? ( "authkey" ) raise ArgumentError , "Missing security_key1 or security_key2." unless @options [ :security_key1 ] && @options [ :security_key2 ] rkey = md5_authkey_preauth ( @options [ :security_key1 ] , @options [ :security_key2 ] , transaction_id ( ) , currency ( ) ) if ( rkey . eql? ( security_key ( ) ) ) @recurring = true return true end key = md5_authkey ( @options [ :security_key1 ] , @options [ :security_key2 ] , transaction_id ( ) , currency ( ) , gross_cents ( ) ) key_match = key . eql? ( security_key ( ) ) raise ActiveMerchant :: Billing :: Integrations :: DibsFlexwin :: Error , "Invalid authkey" unless key_match key_match end
Acknowledge the transaction to DibsFlexwin.
Acknowledge the transaction to DibsFlexwin .