/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/MerchantTest.php (10160B)
'client_id$development$integration_client_id', 'clientSecret' => 'client_secret$development$integration_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', 'paymentMethods' => ['credit_card', 'paypal'], ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); } /** * @expectedException Braintree\Exception\Configuration * @expectedExceptionMessage clientId needs to be passed to Braintree\Gateway */ public function testAssertsHasCredentials() { $gateway = new Braintree\Gateway([ 'clientSecret' => 'client_secret$development$integration_client_secret', ]); $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', ]); } public function testBadPaymentMethods() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$integration_client_id', 'clientSecret' => 'client_secret$development$integration_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', 'paymentMethods' => ['fake_money'], ]); $this->assertEquals(false, $result->success); $errors = $result->errors->forKey('merchant')->onAttribute('paymentMethods'); $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID, $errors[0]->code); } public function testCreateUSMerchantThatAcceptsMultipleCurrencies() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', 'paymentMethods' => ['credit_card', 'paypal'], 'currencies' => ['GBP', 'USD'] ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); $merchantAccounts = $merchant->merchantAccounts; $this->assertEquals(2, count($merchantAccounts)); $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); $this->assertNotNull($usdMerchantAccount); $this->assertEquals(true, $usdMerchantAccount->default); $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); $this->assertNotNull($gbpMerchantAccount); $this->assertEquals(false, $gbpMerchantAccount->default); $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); } public function testCreateEUMerchantThatAcceptsMultipleCurrencies() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'GBR', 'paymentMethods' => ['credit_card', 'paypal'], 'currencies' => ['GBP', 'USD'] ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); $merchantAccounts = $merchant->merchantAccounts; $this->assertEquals(2, count($merchantAccounts)); $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); $this->assertNotNull($usdMerchantAccount); $this->assertEquals(false, $usdMerchantAccount->default); $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); $this->assertNotNull($gbpMerchantAccount); $this->assertEquals(true, $gbpMerchantAccount->default); $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); } public function testCreatePaypalOnlyMerchantThatAcceptsMultipleCurrencies() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', 'paymentMethods' => ['paypal'], 'currencies' => ['GBP', 'USD'], 'paypalAccount' => [ 'clientId' => 'fake_client_id', 'clientSecret' => 'fake_client_secret', ] ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); $merchantAccounts = $merchant->merchantAccounts; $this->assertEquals(2, count($merchantAccounts)); $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); $this->assertNotNull($usdMerchantAccount); $this->assertEquals(true, $usdMerchantAccount->default); $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); $this->assertNotNull($gbpMerchantAccount); $this->assertEquals(false, $gbpMerchantAccount->default); $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); } private function getMerchantAccountForCurrency($merchantAccounts, $currency) { foreach($merchantAccounts as $merchantAccount) { if($merchantAccount->id == $currency) { return $merchantAccount; } } return null; } public function testCreatePaypalOnlyMerchantWithNoCurrenciesProvided() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'JPN', 'paymentMethods' => ['paypal'], 'paypalAccount' => [ 'clientId' => 'fake_client_id', 'clientSecret' => 'fake_client_secret', ] ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); $merchantAccounts = $merchant->merchantAccounts; $this->assertEquals(1, count($merchantAccounts)); $jpyMerchantAccount = $merchantAccounts[0]; $this->assertEquals(true, $jpyMerchantAccount->default); $this->assertEquals('JPY', $jpyMerchantAccount->currencyIsoCode); } public function testCreatePaypalOnlyMerchantWithUnsupportedCountryCodeProvided() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'YEM', 'paymentMethods' => ['paypal'], 'paypalAccount' => [ 'clientId' => 'fake_client_id', 'clientSecret' => 'fake_client_secret', ] ]); $this->assertEquals(true, $result->success); $merchant = $result->merchant; $this->assertNotNull($merchant->id); $credentials = $result->credentials; $this->assertNotNull($credentials->accessToken); $merchantAccounts = $merchant->merchantAccounts; $this->assertEquals(1, count($merchantAccounts)); $usdMerchantAccount = $merchantAccounts[0]; $this->assertEquals(true, $usdMerchantAccount->default); $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); } public function testInvalidCurrencyForMultiCurrency() { $gateway = new Braintree\Gateway([ 'clientId' => 'client_id$development$signup_client_id', 'clientSecret' => 'client_secret$development$signup_client_secret', ]); $result = $gateway->merchant()->create([ 'email' => 'name@email.com', 'countryCodeAlpha3' => 'USA', 'paymentMethods' => ['paypal'], 'currencies' => ['FAKE', 'USD'], 'paypalAccount' => [ 'clientId' => 'fake_client_id', 'clientSecret' => 'fake_client_secret', ] ]); $this->assertEquals(false, $result->success); $errors = $result->errors->forKey('merchant')->onAttribute('currencies'); $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCIES_ARE_INVALID, $errors[0]->code); } }