diff --git a/tests/Browser/ClientPortal/Gateways/Stripe/SofortTest.php b/tests/Browser/ClientPortal/Gateways/Stripe/SofortTest.php new file mode 100644 index 000000000000..13cbd041574e --- /dev/null +++ b/tests/Browser/ClientPortal/Gateways/Stripe/SofortTest.php @@ -0,0 +1,67 @@ +driver->manage()->deleteAllCookies(); + } + + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth(); + }); + + // Enable SOFORT. + $cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail(); + $fees_and_limits = $cg->fees_and_limits; + $fees_and_limits->{GatewayType::SOFORT} = 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 testPayingWithSofort() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.invoices.index') + ->click('@pay-now') + ->press('Pay Now') + ->clickLink('Sofort') + ->press('Pay Now') + ->waitForText('Sofort test payment page', 120) + ->press('.common-Button.common-Button--default') + ->waitForText('Details of the payment', 60); + }); + } +}