diff --git a/app/Constants.php b/app/Constants.php index 6fad1b3af634..799a4c1bb524 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -306,6 +306,7 @@ if (! defined('APP_NAME')) { define('NINJA_CONTACT_URL', env('NINJA_CONTACT_URL', 'https://www.invoiceninja.com/contact/')); define('NINJA_FROM_EMAIL', env('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com')); define('NINJA_IOS_APP_URL', 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1220337560&mt=8'); + define('NINJA_ANDROID_APP_URL', 'https://play.google.com/store/apps/details?id=com.invoiceninja.invoiceninja'); define('RELEASES_URL', env('RELEASES_URL', 'https://trello.com/b/63BbiVVe/invoice-ninja')); define('ZAPIER_URL', env('ZAPIER_URL', 'https://zapier.com/zapbook/invoice-ninja')); define('OUTDATE_BROWSER_URL', env('OUTDATE_BROWSER_URL', 'http://browsehappy.com/')); diff --git a/app/Listeners/HandleUserLoggedIn.php b/app/Listeners/HandleUserLoggedIn.php index eb59cc9b6214..3ece5ccc1b3d 100644 --- a/app/Listeners/HandleUserLoggedIn.php +++ b/app/Listeners/HandleUserLoggedIn.php @@ -56,8 +56,10 @@ class HandleUserLoggedIn $account->loadLocalizationSettings(); - if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')) { + if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { Session::flash('warning', trans('texts.iphone_app_message', ['link' => link_to(NINJA_IOS_APP_URL, trans('texts.iphone_app'))])); + } elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'Android')) { + Session::flash('warning', trans('texts.iphone_app_message', ['link' => link_to(NINJA_ANDROID_APP_URL, trans('texts.android_app'))])); } // if they're using Stripe make sure they're using Stripe.js diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 2282fb556e23..024584fc510d 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2293,6 +2293,7 @@ $LANG = array( 'renew_license' => 'Renew License', 'iphone_app_message' => 'Consider downloading our :link', 'iphone_app' => 'iPhone app', + 'android_app' => 'Android app', 'logged_in' => 'Logged In', 'switch_to_primary' => 'Switch to your primary company (:name) to manage your plan.', 'inclusive' => 'Inclusive', diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index d044963e98b4..cbc79920316f 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -74,10 +74,9 @@ class AcceptanceTester extends \Codeception\Actor } } - function createClient(\AcceptanceTester $I, $email, $name = '') + function createClient(\AcceptanceTester $I, $email) { $I->amOnPage('/clients/create'); - $I->fillField(['name' => 'name'], $name); $I->fillField(['name' => 'contacts[0][email]'], $email); $I->click('Save'); $I->see($email); diff --git a/tests/acceptance/GatewayFeesCest.php b/tests/acceptance/GatewayFeesCest.php index 4b92f98ee758..c980ab3b5018 100644 --- a/tests/acceptance/GatewayFeesCest.php +++ b/tests/acceptance/GatewayFeesCest.php @@ -18,7 +18,6 @@ class GatewayFeesCest public function checkLineItemFee(AcceptanceTester $I) { - $clientName = $this->faker->text(14); $clientEmail = $this->faker->safeEmail; $productKey = $this->faker->word(); $taxName = $this->faker->word(); @@ -39,7 +38,7 @@ class GatewayFeesCest $partialFee = $feeAmount + ($total / 2 * $feeAmount / 100); $partialFeeWithTax = $partialFee + ($partialFee * $taxRate / 100); - $I->createClient($I, $clientEmail, $clientName); + $I->createClient($I, $clientEmail); $I->createGateway($I); $this->configureFees($I, $feeAmount, $feePercent); @@ -50,14 +49,14 @@ class GatewayFeesCest // without taxing the fee $this->configureGatewayFeeTax($I); - $this->createInvoice($I, $clientName, $productKey, $total, $fee); + $this->createInvoice($I, $clientEmail, $productKey, $total, $fee); // with taxing the fee $this->configureGatewayFeeTax($I, $taxName, $taxRate); - $this->createInvoice($I, $clientName, $productKey, $total, $feeWithTax); + $this->createInvoice($I, $clientEmail, $productKey, $total, $feeWithTax); // partial invoice (resaving invoice between payments) - $invitationKey = $this->createInvoice($I, $clientName, $productKey, $total, $partialFeeWithTax, $total / 2); + $invitationKey = $this->createInvoice($I, $clientEmail, $productKey, $total, $partialFeeWithTax, $total / 2); $invoiceId = $I->grabFromDatabase('invitations', 'invoice_id', ['invitation_key' => $invitationKey]); $invoicePublicId = $I->grabFromDatabase('invoices', 'public_id', ['id' => $invoiceId]); $I->amOnPage('/invoices/' . $invoicePublicId . '/edit'); @@ -124,9 +123,9 @@ class GatewayFeesCest $I->click('#modalSave'); } - private function createInvoice($I, $clientName, $productKey, $amount, $fee, $partial = false) + private function createInvoice($I, $clientEmail, $productKey, $amount, $fee, $partial = false) { - $invoiceNumber = $I->fillInvoice($I, $clientName, $productKey); + $invoiceNumber = $I->fillInvoice($I, $clientEmail, $productKey); if ($partial) { $amount = ($partial * 2); @@ -138,7 +137,7 @@ class GatewayFeesCest //$I->see('Successfully created invoice'); //$clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]); - $clientId = $I->grabFromDatabase('clients', 'id', ['name' => $clientName]); + $clientId = $I->grabFromDatabase('clients', 'id', ['name' => $clientEmail]); $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId, 'invoice_number' => $invoiceNumber]); $invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]);