/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/UsBankAccountVerificationTest.php (9896B)
$customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), 'usBankAccountVerificationMethod' => 'network_check', ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $verification = $usBankAccount->verifications[0]; $this->assertEquals('network_check', $verification->verificationMethod); } public function test_findVerification() { $customer = Braintree\Customer::createNoValidate(); $result = Braintree\PaymentMethod::create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; $foundVerification = Braintree\UsBankAccountVerification::find($createdVerification->id); $this->assertEquals($foundVerification, $createdVerification); } public function test_searchVerification() { $customer = Braintree\Customer::createNoValidate(); $result = Braintree\PaymentMethod::create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::INDEPENDENT_CHECK, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; $query = [Braintree\UsBankAccountVerificationSearch::id()->is($createdVerification->id)]; $query[] = Braintree\UsBankAccountVerificationSearch::accountNumber()->endsWith("1234"); $collection = Braintree\UsBankAccountVerification::search($query); $this->assertEquals(1, $collection->maximumCount()); } public function test_attemptConfirmMicroTransferAmounts() { $gateway = new Braintree\Gateway([ 'environment' => 'development', 'merchantId' => 'integration2_merchant_id', 'publicKey' => 'integration2_public_key', 'privateKey' => 'integration2_private_key' ]); $customer = $gateway->customer()->create([ 'firstName' => 'Joe', 'lastName' => 'Brown' ])->customer; $result = $gateway->paymentMethod()->create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); $this->assertFalse($result->success); $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); $this->assertEquals( Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_AMOUNTS_DO_NOT_MATCH, $amountErrors[0]->code ); } public function test_confirmMicroTransferAmountsSettled() { $gateway = new Braintree\Gateway([ 'environment' => 'development', 'merchantId' => 'integration2_merchant_id', 'publicKey' => 'integration2_public_key', 'privateKey' => 'integration2_private_key' ]); $customer = $gateway->customer()->create([ 'firstName' => 'Joe', 'lastName' => 'Brown' ])->customer; $result = $gateway->paymentMethod()->create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce('1000000000'), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [17, 29]); $this->assertTrue($result->success); $usBankAccountVerification = $result->usBankAccountVerification; $this->assertEquals($usBankAccountVerification->status, Braintree\Result\UsBankAccountVerification::VERIFIED); $usBankAccount = $gateway->usBankAccount()->find($usBankAccountVerification->usBankAccount->token); $this->assertTrue($usBankAccount->verified); } public function test_confirmMicroTransferAmountsUnsettled() { $gateway = new Braintree\Gateway([ 'environment' => 'development', 'merchantId' => 'integration2_merchant_id', 'publicKey' => 'integration2_public_key', 'privateKey' => 'integration2_private_key' ]); $customer = $gateway->customer()->create([ 'firstName' => 'Joe', 'lastName' => 'Brown' ])->customer; $result = $gateway->paymentMethod()->create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce('1000000001'), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [17, 29]); $this->assertTrue($result->success); $usBankAccountVerification = $result->usBankAccountVerification; $this->assertEquals($usBankAccountVerification->status, Braintree\Result\UsBankAccountVerification::PENDING); $usBankAccount = $gateway->usBankAccount()->find($usBankAccountVerification->usBankAccount->token); $this->assertFalse($usBankAccount->verified); } public function test_exceedRetryThreshold() { $gateway = new Braintree\Gateway([ 'environment' => 'development', 'merchantId' => 'integration2_merchant_id', 'publicKey' => 'integration2_public_key', 'privateKey' => 'integration2_private_key' ]); $customer = $gateway->customer()->create([ 'firstName' => 'Joe', 'lastName' => 'Brown' ])->customer; $result = $gateway->paymentMethod()->create([ 'customerId' => $customer->id, 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), 'options' => [ 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, ] ]); $usBankAccount = $result->paymentMethod; $this->assertEquals(1, count($usBankAccount->verifications)); $createdVerification = $usBankAccount->verifications[0]; for ($i = 0; $i < 4; $i++) { $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); $this->assertFalse($result->success); $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); $this->assertEquals( Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_AMOUNTS_DO_NOT_MATCH, $amountErrors[0]->code ); } $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); $this->assertFalse($result->success); $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); $this->assertEquals( Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_TOO_MANY_CONFIRMATION_ATTEMPTS, $amountErrors[0]->code ); } }