cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble testing DPM

I'm using the DPM integration method, and regardless of what details I enter it returns the response code 3. That's supposed to mean that the card is declined, but it gives that when I use the test card info from the help files and when I use real credit card info as well.

 

Here's the simplified test page which has nothing but the sample html with the values plugged in: https://www.reellocations.com/clonedir/testpage.html

 

Does anyone know what I could be missing here?

Gavagai
Member
11 REPLIES 11

Where did you get that code from? My version of the SDK has this (from AuthorizeNetDPM.php):

 

public static function getCreditCardForm($amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $test_mode = true, $prefill = true)
    {
        $time = time();
        $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);

 And this (from AuthorizeNetSIM.php, which DPM inherits from):

 

public static function getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $fp_timestamp)
    {
        $api_login_id = ($api_login_id ? $api_login_id : (defined('AUTHORIZENET_API_LOGIN_ID') ? AUTHORIZENET_API_LOGIN_ID : ""));
        $transaction_key = ($transaction_key ? $transaction_key : (defined('AUTHORIZENET_TRANSACTION_KEY') ? AUTHORIZENET_TRANSACTION_KEY : ""));
        if (function_exists('hash_hmac')) {
            return hash_hmac("md5", $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^", $transaction_key); 
        }
        return bin2hex(mhash(MHASH_MD5, $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^", $transaction_key));
    }

If I had to guess from the error you say you're getting now, you're not including one of the values that goes into the fingerprint. If it were my code, I could probably find the problem fairly quickly, but it may be a bit hard by remote control.

Found I typoed $api_login_id as $apt_login_id, fixed that and it works now. :)