Updates for BTC payment driver

This commit is contained in:
David Bomba 2024-05-19 19:14:46 +10:00
parent 8ca4d7c197
commit a1fa52dfd3
5 changed files with 36 additions and 30 deletions

View File

@ -32,7 +32,6 @@ use App\Models\BankIntegration;
use App\Models\BankTransaction;
use App\Models\ExpenseCategory;
use League\Fractal\Resource\Item;
use App\DataMapper\EDoc\Schema\RO;
use App\Models\BankTransactionRule;
use Illuminate\Support\Facades\Auth;
use App\Transformers\ArraySerializer;
@ -42,6 +41,7 @@ use Illuminate\Database\Eloquent\Builder;
use League\Fractal\Serializer\JsonApiSerializer;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use Illuminate\Contracts\Container\BindingResolutionException;
use Invoiceninja\Einvoice\Decoder\Schema;
/**
* Class BaseController.
@ -890,7 +890,6 @@ class BaseController extends Controller
/** @phpstan-ignore-next-line **/
$query = $paginator->getCollection();// @phpstan-ignore-line
$resource = new Collection($query, $transformer, $this->entity_type);
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
}
@ -998,8 +997,8 @@ class BaseController extends Controller
if(request()->has('einvoice')){
$ro = new RO();
$response_data['einvoice_schema'] = $ro();
$ro = new Schema();
$response_data['einvoice_schema'] = $ro('FACT1');
}

View File

@ -155,6 +155,7 @@ class CompanyGateway extends BaseModel
'b9886f9257f0c6ee7c302f1c74475f6c' => 321, //GoCardless
'hxd6gwg3ekb9tb3v9lptgx1mqyg69zu9' => 322,
'80af24a6a691230bbec33e930ab40666' => 323,
'vpyfbmdrkqcicpkjqdusgjfluebftuva' => 324, //BTPay
];
protected $touches = [];

View File

@ -150,6 +150,8 @@ class SystemLog extends Model
public const TYPE_PAYPAL_PPCP = 323;
public const TYPE_BTC_PAY = 324;
public const TYPE_QUOTA_EXCEEDED = 400;
public const TYPE_UPSTREAM_FAILURE = 401;

20
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "da485c7cec773404ffe59d450b6505cf",
"content-hash": "1356155e46e797b140685c105df97b8e",
"packages": [
{
"name": "adrienrn/php-mimetyper",
@ -3221,26 +3221,26 @@
},
{
"name": "firebase/php-jwt",
"version": "v6.10.0",
"version": "v6.10.1",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "a49db6f0a5033aef5143295342f1c95521b075ff"
"reference": "500501c2ce893c824c801da135d02661199f60c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff",
"reference": "a49db6f0a5033aef5143295342f1c95521b075ff",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
"reference": "500501c2ce893c824c801da135d02661199f60c5",
"shasum": ""
},
"require": {
"php": "^7.4||^8.0"
"php": "^8.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^6.5||^7.4",
"guzzlehttp/guzzle": "^7.4",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"psr/cache": "^1.0||^2.0",
"psr/cache": "^2.0||^3.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0"
},
@ -3278,9 +3278,9 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v6.10.0"
"source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
},
"time": "2023-12-01T16:26:39+00:00"
"time": "2024-05-18T18:05:11+00:00"
},
{
"name": "fruitcake/php-cors",

View File

@ -12,24 +12,28 @@ return new class extends Migration
*/
public function up(): void
{
$gateway = new Gateway;
$gateway->name = 'BTCPay';
$gateway->key = 'vpyfbmdrkqcicpkjqdusgjfluebftuva';
$gateway->provider = 'BTCPay';
$gateway->is_offsite = true;
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);
$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();
$gateway->visible = true;
$gateway->site_url = 'https://btcpayserver.org';
$gateway->default_gateway_type_id = GatewayType::CRYPTO;
$gateway->save();
}
}
/**
@ -39,4 +43,4 @@ return new class extends Migration
{
//
}
};
};