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.
I am not able to parse it into php.
Solved! Go to Solution.
08-09-2018 06:39 AM
Hi @jy967845
Have a look at our PHP sample code and SDK
https://github.com/AuthorizeNet/sdk-php
Thanks
08-09-2018 01:00 PM - edited 08-09-2018 01:00 PM
Hi @jy967845
Have a look at our PHP sample code and SDK
https://github.com/AuthorizeNet/sdk-php
Thanks
08-09-2018 01:00 PM - edited 08-09-2018 01:00 PM
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);
08-10-2018 01:22 AM
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.
08-10-2018 04:19 AM