1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #7372 from beganovich/company-gateways-create

Fixes for creating new company gateways
This commit is contained in:
David Bomba 2022-04-18 20:20:10 +08:00 committed by GitHub
commit b91c3903c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,7 @@ class CompanyGatewayFactory
$company_gateway->user_id = $user_id;
$company_gateway->require_billing_address = false;
$company_gateway->require_shipping_address = false;
$company_gateway->config = encrypt(json_encode(new \stdClass));
// $company_gateway->fees_and_limits = new FeesAndLimits;
return $company_gateway;

View File

@ -250,7 +250,7 @@ class CompanyGateway extends BaseModel
{
$config = $this->getConfig();
if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {
if ($this->gateway && $this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {
return true;
}