Page 1 of 1

[Solved] Need Authorize.Net help please.

Posted: Fri Sep 26, 2008 5:44 pm
by DaveTheAve
Here is my code... but i keep getting the error: "(13) The merchant login ID or password is invalid or the account is inactive."

Please tell me what i'm doing thats so wrong.

Code: Select all

 
  $x_login          = '*********';
  $x_fp_sequence    = mt_rand();
  $x_fp_timestamp   = time();
  $x_fp_hash        = hmac('****************', $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount);
 
  $post = array(
    'x_test_request'    => 'TRUE',
    'x_login'           => $x_login,
    'x_fp_sequence'     => $x_fp_sequence,
    'x_fp_timestamp'    => $x_fp_timestamp,
    'x_fp_hash'         => $x_fp_hash,
   // 'x_method'          => 'CC',
    'x_show_form'       => 'PAYMENT_FORM',
   // 'x_relay_response'  => 'TRUE',
   // 'x_relay_url'       => 'http://Domain.com/test.php?q=abc',
    'x_amount'          => $x_amount
  );
 
  echo '<pre>';
  print_r($post);
 
  $ch=curl_init('https://test.authorize.net/gateway/transact.dll');
  curl_setopt($ch,CURLOPT_POST,1);
  curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
  curl_exec($ch);
  curl_close($ch);
 
function hmac ($key, $data)
{
  return (bin2hex (mhash(MHASH_MD5, $data, $key)));
}
 

Re: [Unsolved] Need Authorize.Net help please.

Posted: Sun Sep 28, 2008 10:06 am
by DaveTheAve
Well I figured it out, deal is, if you send it as an array, it makes the form multipart; so i just sent it as a string and it worked.