function testParseAndValidateQueryString_throwsAuthenticationErrorIfBadCredentials()
 {
     Braintree_TestHelper::suppressDeprecationWarnings();
     $privateKey = Braintree_Configuration::privateKey();
     Braintree_Configuration::privateKey('incorrect');
     try {
         $trData = Braintree_TransparentRedirect::createCustomerData(array("redirectUrl" => "http://www.example.com"));
         $queryString = Braintree_TestHelper::submitTrRequest(Braintree_Customer::createCustomerUrl(), array(), $trData);
         $this->setExpectedException('Braintree_Exception_Authentication');
         Braintree_Customer::createFromTransparentRedirect($queryString);
     } catch (Exception $e) {
     }
     $privateKey = Braintree_Configuration::privateKey($privateKey);
     if (isset($e)) {
         throw $e;
     }
 }
Esempio n. 2
0
 function createCustomerViaTr($regularParams, $trParams)
 {
     Braintree_TestHelper::suppressDeprecationWarnings();
     $trData = Braintree_TransparentRedirect::createCustomerData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     return Braintree_TestHelper::submitTrRequest(Braintree_Customer::createCustomerUrl(), $regularParams, $trData);
 }