Fixes for company gateway creation

This commit is contained in:
David Bomba 2022-04-14 18:44:35 +10:00
parent 0a40bd9545
commit 719f6715e8
2 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,8 @@ 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;
}