public function testCreateWithDeprecatedParameters() { Test\Helper::suppressDeprecationWarnings(); $result = Braintree\MerchantAccount::create(self::$deprecatedValidParams); $this->assertEquals(true, $result->success); $merchantAccount = $result->merchantAccount; $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $merchantAccount->status); $this->assertEquals("sandbox_master_merchant_account", $merchantAccount->masterMerchantAccount->id); }
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 testCreateFromTransparentRedirect_withDefault() { Test\Helper::suppressDeprecationWarnings(); $customer = Braintree\Customer::createNoValidate(); $queryString = $this->createCreditCardViaTr(array('credit_card' => array('number' => '5105105105105100', 'expiration_date' => '05/12', 'options' => array('make_default' => true))), array('creditCard' => array('customerId' => $customer->id))); $result = Braintree\CreditCard::createFromTransparentRedirect($queryString); $this->assertTrue($result->creditCard->isDefault()); }
public function updateCustomerViaTr($regularParams, $trParams) { Test\Helper::suppressDeprecationWarnings(); $trData = Braintree\TransparentRedirect::updateCustomerData(array_merge($trParams, ["redirectUrl" => "http://www.example.com"])); return Test\Helper::submitTrRequest(Braintree\Customer::updateCustomerUrl(), $regularParams, $trData); }