Reply
Highlighted
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Trouble testing DPM

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.

Highlighted
Member
Posts: 7
Registered: ‎11-30-2011

Re: Trouble testing DPM

[ Edited ]

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