public function testParseAndValidateQueryString_throwsAuthenticationErrorIfBadCredentials() { Test\Helper::suppressDeprecationWarnings(); $privateKey = Braintree\Configuration::privateKey(); Braintree\Configuration::privateKey('incorrect'); try { $trData = Braintree\TransparentRedirect::createCustomerData(array("redirectUrl" => "http://www.example.com")); $queryString = Test\Helper::submitTrRequest(Braintree\Customer::createCustomerUrl(), array(), $trData); $this->setExpectedException('Braintree\\Exception\\Authentication'); Braintree\Customer::createFromTransparentRedirect($queryString); } catch (Braintree\Exception $e) { } $privateKey = Braintree\Configuration::privateKey($privateKey); if (isset($e)) { throw $e; } }
public function createCustomerViaTr($regularParams, $trParams) { Test\Helper::suppressDeprecationWarnings(); $trData = Braintree\TransparentRedirect::createCustomerData(array_merge($trParams, ["redirectUrl" => "http://www.example.com"])); return Test\Helper::submitTrRequest(Braintree\Customer::createCustomerUrl(), $regularParams, $trData); }