Search code examples
zend-frameworkbraintree

Client token not generated in AWS Server for Sandbox account


Client token is not generated for sandbox account in Braintree. Previously it was working fine.

When logged into Braintree Sandbox account, it shows the following message in the dashboard

"As part of PCI 3.1 requirements, we've recently deprecated support for TLS 1.0 and 1.1 in the Sandbox. You can find information on how to update your systems here - "

Is this the cause for the issue?

Below is the code we use to generate client token:

$config = Zend_Registry::get('config');
            Braintree_Configuration::environment($config->payment->braintree->environment);
            Braintree_Configuration::merchantId($config->payment->braintree->merchantId);
            Braintree_Configuration::publicKey($config->payment->braintree->publicKey);
            Braintree_Configuration::privateKey($config->payment->braintree->privateKey);
            $clientToken = Braintree_ClientToken::generate();

We have a project developed in Zend Framework 1.12 version.

Any help is greatly appreciated.

Thanks in advance.

When I use getMessage option in catch block, it doesn't show any error messages. But when I use the TraceAsString I receive the following message:

 /home/userName/projects/projectName/vendor/braintree/braintree_php/lib/Braintree/Http.php(101): Braintree\Http->_doUrlRequest('POST', 'https://api.san...', '_doRequest('POST', '/merchants/kyfn...', 'post('/merchants/kyfn...', Array) #3 /home/userName/projects/projectName/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php(47): Braintree\ClientTokenGateway->_doGenerate('/client_token', Array) #4 /home/userName/projects/projectName/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php(18): Braintree\ClientTokenGateway->generate(Array) #5 /home/userName/projects/projectName/application/util/BaseController.php(1336): Braintree\ClientToken::generate() #6 /home/userName/projects/projectName/application/controllers/OffersController.php(856): BaseController->getClientToken() #7 /home/userName/projects/projectName/vendor/zendframework/zendframework1/library/Zend/Controller/Action.php(516): OffersController->checkoutAction() #8 /home/userName/projects/projectName/application/util/BaseController.php(780): Zend_Controller_Action->dispatch('checkoutAction') #9 /home/userName/projects/projectName/vendor/zendframework/zendframework1/library/Zend/Controller/Dispatcher/Standard.php(308): BaseController->dispatch('checkoutAction') #10 /home/userName/projects/projectName/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #11 /home/userName/projects/projectName/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch() #12 /home/userName/projects/projectName/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run() #13 /home/userName/projects/projectName/public/index.php(39): Zend_Application->run() #14 /home/userName/projects/projectName/public/dev-router.php(6): require('/home/userName/pr...') #15 {main}

Solution

  • The issue got fixed after I updated the CURL version of PHP as per the Braintree response.