diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/ACSSTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/ACSSTest.php new file mode 100644 index 000000000000..f1a081ffe3d5 --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/ACSSTest.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::ACSS} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithACSS() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('ACSS') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/BECSTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/BECSTest.php new file mode 100644 index 000000000000..13efce58da9c --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/BECSTest.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::BECS} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithBECS() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('BECS') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/BancontactTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/BancontactTest.php new file mode 100644 index 000000000000..9611214ae88f --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/BancontactTest.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::BANCONTACT} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithBancontact() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('Bancontact') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/EPSTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/EPSTest.php new file mode 100644 index 000000000000..748584f6ab1d --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/EPSTest.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::EPS} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithEPS() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('EPS') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/GiropayTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/GiropayTest.php new file mode 100644 index 000000000000..9ad7b78b1fda --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/GiropayTest.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::GIROPAY} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithGiropay() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('Giropay') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/Prezelewy24Test.php b/tests/Browser/ClientPortal/Gateways/Stripe/Prezelewy24Test.php new file mode 100644 index 000000000000..dbd9f3872621 --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/Prezelewy24Test.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::PRZELEWY24} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithPrezelewy24() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('Prezelewy24') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +} diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/iDEAL.php b/tests/Browser/ClientPortal/Gateways/Stripe/iDEAL.php new file mode 100644 index 000000000000..8720aa4bd527 --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/iDEAL.php @@ -0,0 +1,72 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + $this->disableCompanyGateways(); + + // Enable Stripe. + CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore(); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::IDEAL} = new FeesAndLimits(); + $cg->fees_and_limits = $fees_and_limits; + $cg->save(); + + // SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country. + // Setting country to DEU (276). + $client = Client::first(); + $client->country_id = 276; + $client->save(); + } + + public function testPayingWithiDeal() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('iDeal') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +}