Hi, I am having some issues starting with vantiv.
- I am not using composer.
- I have donwloaded the PHP SKD and uploaded to my server.
- I have configured the SDK using the file Setup.php where I have setted the name, password and Merchant ID as blank, the URL setted as sandbox. No proxy, no batch process, no SFTP.
- I have Created a test file with this code:
namespace litle\sdk;
require_once ("XmlParser.php");
require_once ("XmlFields.php");
require_once ("Transactions.php");
require_once ("UrlMapper.php");
require_once ("Obj2xml.php");
require_once ("LitleXmlMapper.php");
require_once ("LitleResponseProcessor.php");
require_once ("LitleRequest.php");
require_once ("LitleOnlineRequest.php");
require_once ("LitleOnline.php");
require_once ("Communication.php");
require_once ("Checker.php");
require_once ("Obj2xml.php");
#Sale
$sale_info = array(
'orderId' => '1',
'id'=> '456',
'amount' => '10010',
'orderSource'=>'ecommerce',
'billToAddress'=>array(
'name' => 'John Smith',
'addressLine1' => '1 Main St.',
'city' => 'Burlington',
'state' => 'MA',
'zip' => '01803-3747',
'country' => 'US'),
'card'=>array(
'number' =>'4100117890123000',
'expDate' => '0112',
'cardValidationNum' => '349',
'type' => 'MC')
);
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($sale_info);
#display results
echo ("Response: " . (XmlParser::getNode($saleResponse,'response')) . "<br>");
echo ("Message: " . XmlParser::getNode($saleResponse,'message') . "<br>");
echo ("Litle Transaction ID: " . XmlParser::getNode($saleResponse,'litleTxnId'));
And I am getting this message:
110010ecommerceJohn Smith1 Main St.BurlingtonMA01803-3747USMC41001178901230000112349
Fatal error: Uncaught exception 'Exception' with message 'Unsupported SSL protocol version' in /home/Vantiv/litle/sdk/Communication.php:50 Stack trace: #0 /home/Vantiv/litle/sdk/LitleXmlMapper.php(35): litle\sdk\Communication::httpRequest('<?xml version="...', Array) #1 /home/Vantiv/litle/sdk/LitleOnlineRequest.php(630): litle\sdk\LitleXmlMapper->request('<?xml version="...', Array, false) #2 /home/Vantiv/litle/sdk/LitleOnlineRequest.php(160): litle\sdk\LitleOnlineRequest->processRequest(Array, Array, 'sale', Array, Array) #3 /home/Vantiv/litle/sdk/test.php(47): litle\sdk\LitleOnlineRequest->saleRequest(Array) #4 {main} thrown in /home/Vantiv/litle/sdk/Communication.php on line 50
Does this mean that I should already have ssh configured in my server in test/development mode?
What am I missing?
Hi Monica,
Can you check the Communication.php class to see that the cURL options are being set correctly? Our Sandbox environment requires TLS v1.1 as a minimum so the SSL version needs to be set in the cURL options.
Example Communication.php configuration:
curl_setopt($ch, CURLOPT_PROXY, $config['proxy']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml', 'Expect: '));
curl_setopt($ch, CURLOPT_URL, $config['url']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
If you continue to experience issues connecting to our Sandbox environment please email sdksupport@vantiv.com for further assistance.
Thanks,
Brian