mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 10:04:35 -04:00
Data seeding: Stripe
This commit is contained in:
parent
e5e9b2151c
commit
9178a70fed
@ -36,6 +36,11 @@ class ACHTest extends DuskTestCase
|
|||||||
->auth();
|
->auth();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->disableCompanyGateways();
|
||||||
|
|
||||||
|
// Enable Stripe.
|
||||||
|
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||||
|
|
||||||
// Enable ACH.
|
// Enable ACH.
|
||||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
@ -63,7 +68,7 @@ class ACHTest extends DuskTestCase
|
|||||||
->type('#account-number', '000123456789')
|
->type('#account-number', '000123456789')
|
||||||
->check('#accept-terms')
|
->check('#accept-terms')
|
||||||
->press('Add Payment Method')
|
->press('Add Payment Method')
|
||||||
->waitForText('ACH (Verification)')
|
->waitForText('ACH (Verification)', 60)
|
||||||
->type('@verification-1st', '32')
|
->type('@verification-1st', '32')
|
||||||
->type('@verification-2nd', '45')
|
->type('@verification-2nd', '45')
|
||||||
->press('Complete Verification')
|
->press('Complete Verification')
|
||||||
|
@ -37,6 +37,11 @@ class AlipayTest extends DuskTestCase
|
|||||||
->auth();
|
->auth();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->disableCompanyGateways();
|
||||||
|
|
||||||
|
// Enable Stripe.
|
||||||
|
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||||
|
|
||||||
// Enable Alipay.
|
// Enable Alipay.
|
||||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
|
@ -35,6 +35,11 @@ class CreditCardTest extends DuskTestCase
|
|||||||
->auth();
|
->auth();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->disableCompanyGateways();
|
||||||
|
|
||||||
|
// Enable Stripe.
|
||||||
|
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||||
|
|
||||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
$fees_and_limits->{GatewayType::CREDIT_CARD} = new FeesAndLimits();
|
$fees_and_limits->{GatewayType::CREDIT_CARD} = new FeesAndLimits();
|
||||||
|
@ -36,6 +36,11 @@ class SofortTest extends DuskTestCase
|
|||||||
->auth();
|
->auth();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->disableCompanyGateways();
|
||||||
|
|
||||||
|
// Enable Stripe.
|
||||||
|
CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->restore();
|
||||||
|
|
||||||
// Enable SOFORT.
|
// Enable SOFORT.
|
||||||
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
$cg = CompanyGateway::where('gateway_key', 'd14dd26a37cecc30fdd65700bfb55b23')->firstOrFail();
|
||||||
$fees_and_limits = $cg->fees_and_limits;
|
$fees_and_limits = $cg->fees_and_limits;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Tests;
|
namespace Tests;
|
||||||
|
|
||||||
|
use App\Models\CompanyGateway;
|
||||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||||
@ -58,4 +59,14 @@ abstract class DuskTestCase extends BaseTestCase
|
|||||||
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
|
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
|
||||||
isset($_ENV['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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user