cancel
Showing results for 
Search instead for 
Did you mean: 

createTransactionRequest Api response error

Hello

 

I am new to Authorize.net. I am using "https://apitest.authorize.net/xml/v1/request.api" api to charge credit cards into JSON format with PHP Curl.

It transactionResponse with result "OK".

But I am getting response into string format and I am getting this with a red dot.

 

Screenshot_74.png 

 

I am not able to parse it into php.

 

 

jy967845
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @jy967845

 

Have a look at our PHP sample code and SDK 

 

https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/charge-credit-card.p...

 

https://github.com/AuthorizeNet/sdk-php

 

Thanks





Send feedback at developer_feedback@authorize.net

View solution in original post

Anurag
Moderator Moderator
Moderator
3 REPLIES 3

Hi @jy967845

 

Have a look at our PHP sample code and SDK 

 

https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/charge-credit-card.p...

 

https://github.com/AuthorizeNet/sdk-php

 

Thanks





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

I have  downloaded and configured sample code, it giving me this error when I execute this.
Fatal error: Interface 'JMS\Serializer\GraphNavigatorInterface' not found in  ............./sdk-php/vendor/jms/serializer/src/JMS/Serializer/GraphNavigator.php on line 27

 

 * Can you provide a single api to charge credit card?

 

Currently we are using this


$ch = curl_init('https://apitest.authorize.net/xml/v1/request.api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($post_data));
$data = curl_exec($ch);
curl_close($ch);

1. Can you also share the code for the sample code you are executing?

2. And what is the first line of your code?
Is it 

require 'vendor/autoload.php';

or

require 'autoload.php';

?

 

3. Are you using Composer? Can you share a screenshot of your folder structure - to give an idea of where the sample-code-php directory is, the sample code being exectued, and the vendor folder.