1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Add new prop for company gateways table

This commit is contained in:
David Bomba 2024-04-24 16:51:03 +10:00
parent bbb2f0b02b
commit b43a4ec866
4 changed files with 34 additions and 1 deletions

View File

@ -23,7 +23,8 @@ class CompanyGatewayFactory
$company_gateway->require_billing_address = false;
$company_gateway->require_shipping_address = false;
$company_gateway->config = encrypt(json_encode(new \stdClass()));
$company_gateway->always_show_required_fields = true;
return $company_gateway;
}
}

View File

@ -47,6 +47,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @property bool $require_custom_value2
* @property bool $require_custom_value3
* @property bool $require_custom_value4
* @property bool $always_show_required_fields
* @property-read int|null $client_gateway_tokens_count
* @property-read \App\Models\Company $company
* @property-read \App\Models\Gateway $gateway
@ -77,6 +78,7 @@ class CompanyGateway extends BaseModel
'updated_at' => 'timestamp',
'created_at' => 'timestamp',
'deleted_at' => 'timestamp',
'always_show_required_fields' => 'bool',
];
protected $with = [
@ -107,6 +109,7 @@ class CompanyGateway extends BaseModel
'custom_value4',
'token_billing',
'label',
'always_show_required_fields',
];
public static $credit_cards = [

View File

@ -80,6 +80,7 @@ class CompanyGatewayTransformer extends EntityTransformer
'label' => (string) $company_gateway->label ?: '',
'token_billing' => (string) $company_gateway->token_billing,
'test_mode' => (bool) $company_gateway->isTestMode(),
'always_show_required_fields' => (bool) $company_gateway->always_show_required_fields,
];
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('company_gateways', function (Blueprint $table) {
$table->boolean('always_show_required_fields')->default(true);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};