コード例 #1
0
 public function testDelete()
 {
     $paymentMethodToken = 'PAYPALToken-' . strval(rand());
     $customer = Braintree\Customer::createNoValidate();
     $http = new HttpClientApi(Braintree\Configuration::$global);
     $nonce = $http->nonceForPayPalAccount(['paypal_account' => ['consent_code' => 'PAYPAL_CONSENT_CODE', 'token' => $paymentMethodToken]]);
     Braintree\PaymentMethod::create(['customerId' => $customer->id, 'paymentMethodNonce' => $nonce]);
     Braintree\PayPalAccount::delete($paymentMethodToken);
     $this->setExpectedException('Braintree\\Exception\\NotFound');
     Braintree\PayPalAccount::find($paymentMethodToken);
 }
コード例 #2
0
 public function testErrorsOnFindWithWhitespaceCharacterArgument()
 {
     $this->setExpectedException('InvalidArgumentException');
     Braintree\PayPalAccount::find('\\t');
 }