Data seeding: Stripe

This commit is contained in:
Benjamin Beganović 2021-07-11 16:29:54 +02:00
parent e5e9b2151c
commit 9178a70fed
5 changed files with 32 additions and 1 deletions

View File

@ -36,6 +36,11 @@ class ACHTest extends DuskTestCase
->auth();
});
$this->disableCompanyGateways();
// Enable Stripe.
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
// Enable ACH.
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
$fees_and_limits = $cg->fees_and_limits;
@ -63,7 +68,7 @@ class ACHTest extends DuskTestCase
->type('#account-number', '000123456789')
->check('#accept-terms')
->press('Add Payment Method')
->waitForText('ACH (Verification)')
->waitForText('ACH (Verification)', 60)
->type('@verification-1st', '32')
->type('@verification-2nd', '45')
->press('Complete Verification')

View File

@ -37,6 +37,11 @@ class AlipayTest extends DuskTestCase
->auth();
});
$this->disableCompanyGateways();
// Enable Stripe.
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
// Enable Alipay.
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
$fees_and_limits = $cg->fees_and_limits;

View File

@ -35,6 +35,11 @@ class CreditCardTest extends DuskTestCase
->auth();
});
$this->disableCompanyGateways();
// Enable Stripe.
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
$fees_and_limits = $cg->fees_and_limits;
$fees_and_limits->{GatewayType::CREDIT_CARD} = new FeesAndLimits();

View File

@ -36,6 +36,11 @@ class SofortTest extends DuskTestCase
->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;

View File

@ -2,6 +2,7 @@
namespace Tests;
use App\Models\CompanyGateway;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
@ -58,4 +59,14 @@ abstract class DuskTestCase extends BaseTestCase
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
isset($_ENV['DUSK_HEADLESS_DISABLED']);
}
/**
* Disable all company gateways, test classes should enable them per need.
*
* @return void
*/
public function disableCompanyGateways()
{
CompanyGateway::where('company_id', 1)->delete();
}
}