/home/desid573/public_html/app/braintree/tests/integration
NameSizeModeActions
Error/-0755rm
Result/-0755rm
AddOnsTest.php29530644editdlrm
AddressTest.php128330644editdlrm
ApplePayTest.php25950644editdlrm
ClientTokenTest.php70160644editdlrm
CreditCardTest.php564890644editdlrm
CreditCardVerificationAdvancedSearchTest.php112090644editdlrm
CreditCardVerificationTest.php22660644editdlrm
CustomerAdvancedSearchTest.php76690644editdlrm
CustomerTest.php706950644editdlrm
DisbursementTest.php12060644editdlrm
DiscountTest.php30720644editdlrm
DisputeSearchTest.php37070644editdlrm
DisputeTest.php155170644editdlrm
DocumentUploadTest.php41850644editdlrm
GraphQLTest.php27850644editdlrm
HttpClientApi.php41700644editdlrm
HttpTest.php62380644editdlrm
IdealPaymentTest.php41410644editdlrm
MasterpassCardTest.php60220644editdlrm
MerchantAccountTest.php300400644editdlrm
MerchantTest.php101600644editdlrm
MultipleValueNodeTest.php33390644editdlrm
OAuthTest.php137320644editdlrm
PaymentMethodNonceTest.php79650644editdlrm
PaymentMethodTest.php696180644editdlrm
PaymentMethodWithUsBankAccountTest.php64830644editdlrm
PayPalAccountTest.php113000644editdlrm
PlanTest.php47570644editdlrm
SamsungPayCardTest.php87580644editdlrm
SettlementBatchSummaryTest.php34970644editdlrm
SubscriptionHelper.php24600644editdlrm
SubscriptionSearchTest.php178430644editdlrm
SubscriptionTest.php553940644editdlrm
TestTransactionTest.php28890644editdlrm
TextNodeTest.php53790644editdlrm
TransactionAdvancedSearchTest.php657420644editdlrm
TransactionLineItemTest.php14010644editdlrm
TransactionTest.php2413430644editdlrm
TransactionWithUsBankAccountTest.php118920644editdlrm
TransparentRedirectTest.php124570644editdlrm
UsBankAccountTest.php46910644editdlrm
UsBankAccountVerificationTest.php98960644editdlrm
VisaCheckoutCardTest.php70770644editdlrm
Edit: /home/desid573/public_html/app/braintree/tests/integration/ClientTokenTest.php (7016B)
authorizationFingerprint; $http = new HttpClientApi(Braintree\Configuration::$global); $response = $http->get_cards([ "authorization_fingerprint" => $authorizationFingerprint, "shared_customer_identifier" => "fake_identifier", "shared_customer_identifier_type" => "testing", ]); $this->assertEquals(200, $response["status"]); } public function test_VersionOptionSupported() { $clientToken = Braintree\ClientToken::generate(["version" => 1]); $version = json_decode($clientToken)->version; $this->assertEquals(1, $version); } public function test_VersionDefaultsToTwo() { $encodedClientToken = Braintree\ClientToken::generate(); $clientToken = base64_decode($encodedClientToken); $version = json_decode($clientToken)->version; $this->assertEquals(2, $version); } public function testGateway_VersionDefaultsToTwo() { $gateway = new Braintree\Gateway([ 'environment' => 'development', 'merchantId' => 'integration_merchant_id', 'publicKey' => 'integration_public_key', 'privateKey' => 'integration_private_key', ]); $encodedClientToken = $gateway->clientToken()->generate(); $clientToken = base64_decode($encodedClientToken); $version = json_decode($clientToken)->version; $this->assertEquals(2, $version); } public function test_GatewayRespectsVerifyCard() { $result = Braintree\Customer::create(); $this->assertTrue($result->success); $customerId = $result->customer->id; $clientToken = Test\Helper::decodedClientToken([ "customerId" => $customerId, "options" => [ "verifyCard" => true ] ]); $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; $http = new HttpClientApi(Braintree\Configuration::$global); $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ "credit_card" => [ "number" => "4000111111111115", "expirationDate" => "11/2099" ], "authorization_fingerprint" => $authorizationFingerprint, "shared_customer_identifier" => "fake_identifier", "shared_customer_identifier_type" => "testing" ])); $this->assertEquals(422, $response["status"]); } public function test_GatewayRespectsFailOnDuplicatePaymentMethod() { $result = Braintree\Customer::create(); $this->assertTrue($result->success); $customerId = $result->customer->id; $clientToken = Test\Helper::decodedClientToken([ "customerId" => $customerId, ]); $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; $http = new HttpClientApi(Braintree\Configuration::$global); $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ "credit_card" => [ "number" => "4242424242424242", "expirationDate" => "11/2099" ], "authorization_fingerprint" => $authorizationFingerprint, "shared_customer_identifier" => "fake_identifier", "shared_customer_identifier_type" => "testing" ])); $this->assertEquals(201, $response["status"]); $clientToken = Test\Helper::decodedClientToken([ "customerId" => $customerId, "options" => [ "failOnDuplicatePaymentMethod" => true ] ]); $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; $http = new HttpClientApi(Braintree\Configuration::$global); $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ "credit_card" => [ "number" => "4242424242424242", "expirationDate" => "11/2099" ], "authorization_fingerprint" => $authorizationFingerprint, "shared_customer_identifier" => "fake_identifier", "shared_customer_identifier_type" => "testing" ])); $this->assertEquals(422, $response["status"]); } public function test_GatewayRespectsMakeDefault() { $result = Braintree\Customer::create(); $this->assertTrue($result->success); $customerId = $result->customer->id; $result = Braintree\CreditCard::create([ 'customerId' => $customerId, 'number' => '4111111111111111', 'expirationDate' => '11/2099' ]); $this->assertTrue($result->success); $clientToken = Test\Helper::decodedClientToken([ "customerId" => $customerId, "options" => [ "makeDefault" => true ] ]); $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; $http = new HttpClientApi(Braintree\Configuration::$global); $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ "credit_card" => [ "number" => "4242424242424242", "expirationDate" => "11/2099" ], "authorization_fingerprint" => $authorizationFingerprint, "shared_customer_identifier" => "fake_identifier", "shared_customer_identifier_type" => "testing" ])); $this->assertEquals(201, $response["status"]); $customer = Braintree\Customer::find($customerId); $this->assertEquals(2, count($customer->creditCards)); foreach ($customer->creditCards as $creditCard) { if ($creditCard->last4 == "4242") { $this->assertTrue($creditCard->default); } } } public function test_ClientTokenAcceptsMerchantAccountId() { $expectedMerchantAccountId = Test\Helper::nonDefaultMerchantAccountId(); $clientToken = Test\Helper::decodedClientToken([ 'merchantAccountId' => $expectedMerchantAccountId ]); $merchantAccountId = json_decode($clientToken)->merchantAccountId; $this->assertEquals($expectedMerchantAccountId, $merchantAccountId); } public function test_GenerateRaisesExceptionOnGateway422() { $this->setExpectedException('InvalidArgumentException', 'customer_id'); Braintree\ClientToken::generate([ "customerId" => "not_a_customer" ]); } }