1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/database/migrations/2024_05_03_145535_btcpay_gateway.php
2024-05-19 19:14:46 +10:00

46 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use App\Models\Gateway;
use App\Models\GatewayType;
use Illuminate\Support\Str;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Gateway::find(62))
{
$gateway = new Gateway;
$gateway->id = 62;
$gateway->name = 'BTCPay';
$gateway->key = 'vpyfbmdrkqcicpkjqdusgjfluebftuva';
$gateway->provider = 'BTCPay';
$gateway->is_offsite = true;
$btcpayFieds = new \stdClass;
$btcpayFieds->btcpayUrl = "";
$btcpayFieds->apiKey = "";
$btcpayFieds->storeId = "";
$btcpayFieds->webhookSecret = "";
$gateway->fields = \json_encode($btcpayFieds);
$gateway->visible = true;
$gateway->site_url = 'https://btcpayserver.org';
$gateway->default_gateway_type_id = GatewayType::CRYPTO;
$gateway->save();
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};