Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 2
Registered: ‎05-23-2012
Accepted Solution

AIM PHP CURL ERROR (13) The merchant login ID or password is invalid or the account is inactive.

I'm just starting to test and am getting the error: (13) The merchant login ID or password is invalid or the account is inactive.

I am using a live account and have put it in test mode. If I put the same varriables into a html form everything works fine however if post them via php using curl I get the error. The example I'm using below is pretty straight forward but maybe I've overlooked something that someone can spot. Perhaps I have to actually activate the account in some way I've missed, is this possible? Any help would be greatly apprecated. Again I am not using the developer account but the live account in test mode.

Thanks,

Joe

 

<?php

$data = array(
'x_login' => 'omitted',
'x_tran_key' => 'omitted',
'x_type' => 'CAPTURE_ONLY',
'x_amount' => '27.00',
'x_card_num' => '4007000000027',
'x_exp_date' => '04-15'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://secure.authorize.net/gateway/transact.dll');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);

echo $response;

?>


Accepted Solutions
Solution
Accepted by topic author SurferJoe
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM PHP CURL ERROR (13) The merchant login ID or password is invalid or the account is inactive.

From Sample Code

your $data is $post_values in the sample code

$post_string = "";
foreach( $post_values as $key => $value ) { $post_string .= "$key=" . urlencode( $value ) . "&"; } $post_string = rtrim( $post_string, "& " );

 

curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); 

 

From http://www.php.net/manual/en/function.curl-setopt.php

 Passing an array to CURLOPT_POSTFIELDS will encode the data as multipart/form-data, while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded.




View solution in original post


All Replies
Solution
Accepted by topic author SurferJoe
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM PHP CURL ERROR (13) The merchant login ID or password is invalid or the account is inactive.

From Sample Code

your $data is $post_values in the sample code

$post_string = "";
foreach( $post_values as $key => $value ) { $post_string .= "$key=" . urlencode( $value ) . "&"; } $post_string = rtrim( $post_string, "& " );

 

curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); 

 

From http://www.php.net/manual/en/function.curl-setopt.php

 Passing an array to CURLOPT_POSTFIELDS will encode the data as multipart/form-data, while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded.




Member
Posts: 2
Registered: ‎05-23-2012

Re: AIM PHP CURL ERROR (13) The merchant login ID or password is invalid or the account is inactive.

Thanks!!!

I new I had overlooked something.