diff --git a/database/migrations/2024_06_11_231143_add_rotessa_gateway.php b/database/migrations/2024_06_11_231143_add_rotessa_gateway.php new file mode 100644 index 0000000000..264c8b0ee6 --- /dev/null +++ b/database/migrations/2024_06_11_231143_add_rotessa_gateway.php @@ -0,0 +1,56 @@ +first(); + $count = (int) Gateway::count(); + + $configuration = new \stdClass; + $configuration->api_key = ''; + $configuration->test_mode = true; + + if (!$record) { + $gateway = new Gateway; + } else { + $gateway = $record; + } + + $gateway->id = $count + 4000; + $gateway->name = 'Rotessa'; + $gateway->key = Str::lower(Str::random(32)); + $gateway->provider = 'Rotessa'; + $gateway->is_offsite = true; + $gateway->fields = \json_encode($configuration); + $gateway->visible = 1; + $gateway->site_url = "https://rotessa.com"; + $gateway->default_gateway_type_id = 2; + $gateway->save(); + + Gateway::query()->where('name','=', 'Rotessa')->update(['visible' => 1]); + + \DB::statement('SET FOREIGN_KEY_CHECKS=1;'); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Gateway::where('name', '=', 'Rotessa')->delete(); + } +};