mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 02:01:33 +00:00
Remove unused packages
This commit is contained in:
@@ -35,9 +35,6 @@ class Kernel extends ConsoleKernel
|
||||
if (config('nntmux.purge_inactive_users') === true) {
|
||||
$schedule->job(new RemoveInactiveAccounts())->daily();
|
||||
}
|
||||
$schedule->command('model:prune', [
|
||||
'--model' => [WebhookCall::class],
|
||||
])->daily();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Spatie\WebhookClient\Jobs\ProcessWebhookJob;
|
||||
|
||||
class ProcessBtcPayWebhook extends ProcessWebhookJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$payload = $this->webhookCall->payload;
|
||||
// We have received a payment for an invoice and user should be upgraded to a paid plan based on order
|
||||
if ($payload['type'] === 'InvoiceReceivedPayment') {
|
||||
preg_match('/(?P<role>\w+(\+\+)?)[ ](?P<addYears>\d+)/i', $payload['metadata']['itemDesc'], $matches);
|
||||
$user = User::query()->where('email', '=', $payload['metadata']['buyerEmail'])->first();
|
||||
if ($user) {
|
||||
User::updateUserRole($user->id, $matches['role']);
|
||||
User::updateUserRoleChangeDate($user->id, null, $matches['addYears']);
|
||||
Log::info('User upgraded to '.$matches['role'].' for BTCPay webhook: '.$payload['metadata']['buyerEmail']);
|
||||
} else {
|
||||
Log::error('User not found for BTCPay webhook: '.$payload['metadata']['buyerEmail']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,6 @@
|
||||
"nesbot/carbon": "^2.71",
|
||||
"opis/closure": "^3.6",
|
||||
"pear/net_nntp": "^1.6.0",
|
||||
"petzsch/laravel-btcpay": "^6.0",
|
||||
"php-ffmpeg/php-ffmpeg": "^1.1",
|
||||
"php-http/guzzle7-adapter": "^1.0",
|
||||
"php-http/message": "^1.16",
|
||||
@@ -108,7 +107,6 @@
|
||||
"spatie/laravel-ignition": "^2.3",
|
||||
"spatie/laravel-image-optimizer": "^1.7",
|
||||
"spatie/laravel-permission": "^6.1",
|
||||
"spatie/laravel-webhook-client": "^3.2",
|
||||
"sspat/es-query-sanitizer": "^1.0",
|
||||
"stechstudio/laravel-zipstream": "^4.13",
|
||||
"symfony/http-client": "^6.0",
|
||||
|
||||
Generated
+1
-225
@@ -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": "06e5e436739a821cb2a43615ce09da3d",
|
||||
"content-hash": "d3c7fdba6367788630b0ab603ce98914",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aharen/omdbapi",
|
||||
@@ -329,60 +329,6 @@
|
||||
],
|
||||
"time": "2023-01-15T23:15:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "btcpayserver/btcpayserver-greenfield-php",
|
||||
"version": "v2.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/btcpayserver/btcpayserver-greenfield-php.git",
|
||||
"reference": "9a01503ce9f395bdbb9326fd380650c8faf449f6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/btcpayserver/btcpayserver-greenfield-php/zipball/9a01503ce9f395bdbb9326fd380650c8faf449f6",
|
||||
"reference": "9a01503ce9f395bdbb9326fd380650c8faf449f6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-bcmath": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"vimeo/psalm": "^4.8",
|
||||
"vlucas/phpdotenv": "^5.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"BTCPayServer\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Wouter Samaey",
|
||||
"email": "wouter.samaey@storefront.be"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Tasch",
|
||||
"email": "andy.tasch@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "BTCPay Server Greenfield API PHP client library.",
|
||||
"support": {
|
||||
"issues": "https://github.com/btcpayserver/btcpayserver-greenfield-php/issues",
|
||||
"source": "https://github.com/btcpayserver/btcpayserver-greenfield-php/tree/v2.3.0"
|
||||
},
|
||||
"time": "2023-03-28T10:08:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "cache/adapter-common",
|
||||
"version": "1.3.0",
|
||||
@@ -7033,103 +6979,6 @@
|
||||
},
|
||||
"time": "2020-04-19T15:08:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "petzsch/laravel-btcpay",
|
||||
"version": "v6.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/petzsch/laravel-btcpay.git",
|
||||
"reference": "8ec012319244a66286d6eebb15cece4f0a633341"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/petzsch/laravel-btcpay/zipball/8ec012319244a66286d6eebb15cece4f0a633341",
|
||||
"reference": "8ec012319244a66286d6eebb15cece4f0a633341",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"btcpayserver/btcpayserver-greenfield-php": "^2.0",
|
||||
"ext-json": "*",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=9.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Petzsch\\LaravelBtcpay\\LaravelBtcpayServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"LaravelBtcpay": "Petzsch\\LaravelBtcpay\\LaravelBtcpayFacade"
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Petzsch\\LaravelBtcpay\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Vaibhavraj Roham",
|
||||
"email": "vaibhavraj@vrajroham.me",
|
||||
"homepage": "https://vrajroham.me",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Alex Stewart",
|
||||
"email": "iamalexstewart@gmail.com",
|
||||
"homepage": "https://github.com/alexstewartja",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Markus Petzsch",
|
||||
"email": "markus@petzsch.eu",
|
||||
"homepage": "https://www.petzsch.eu",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "BtcPay wrapper for laravel",
|
||||
"homepage": "https://github.com/petzsch/laravel-btcpay",
|
||||
"keywords": [
|
||||
"btc",
|
||||
"btcpay",
|
||||
"laravel"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/petzsch/laravel-btcpay/issues",
|
||||
"source": "https://github.com/petzsch/laravel-btcpay/tree/v6.0.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://bit.ly/asja_paypal_lara_bitpay",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://www.buymeacoffee.com/asja",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/alexstewartja",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/vrajroham",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/vrajroham",
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-18T13:04:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-ffmpeg/php-ffmpeg",
|
||||
"version": "v1.1.0",
|
||||
@@ -10564,79 +10413,6 @@
|
||||
],
|
||||
"time": "2023-01-14T21:10:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-webhook-client",
|
||||
"version": "3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/laravel-webhook-client.git",
|
||||
"reference": "e2e5e0d9567183ca0fb99e0ca22fe386467e360b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/laravel-webhook-client/zipball/e2e5e0d9567183ca0fb99e0ca22fe386467e360b",
|
||||
"reference": "e2e5e0d9567183ca0fb99e0ca22fe386467e360b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/bus": "^8.50|^9.0|^10.0",
|
||||
"illuminate/database": "^8.50|^9.0|^10.0",
|
||||
"illuminate/support": "^8.50|^9.0|^10.0",
|
||||
"php": "^8.0",
|
||||
"spatie/laravel-package-tools": "^1.11"
|
||||
},
|
||||
"require-dev": {
|
||||
"nunomaduro/larastan": "^1.0.4|^2.2",
|
||||
"orchestra/testbench": "^6.0|^7.0|^8.0",
|
||||
"phpstan/extension-installer": "^1.0",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-phpunit": "^1.0",
|
||||
"phpunit/phpunit": "^9.3",
|
||||
"spatie/laravel-ray": "^1.24"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Spatie\\WebhookClient\\WebhookClientServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Spatie\\WebhookClient\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Freek Van der Herten",
|
||||
"email": "freek@spatie.be",
|
||||
"homepage": "https://spatie.be",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Receive webhooks in Laravel apps",
|
||||
"homepage": "https://github.com/spatie/laravel-webhook-client",
|
||||
"keywords": [
|
||||
"laravel-webhook-client",
|
||||
"spatie"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/spatie/laravel-webhook-client/issues",
|
||||
"source": "https://github.com/spatie/laravel-webhook-client/tree/3.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://spatie.be/open-source/support-us",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-09T07:09:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/temporary-directory",
|
||||
"version": "2.2.0",
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
* This is the BTCPay API Key generated under your user's profile.
|
||||
* This value must be supplied for communication to work.
|
||||
*/
|
||||
'api_key' => env('BTCPAY_API_KEY'),
|
||||
|
||||
/*
|
||||
* This is the URL to your BTCPayServer as shown in the address bar of
|
||||
* your browser. Without the last / at the end of the URL.
|
||||
* i.e.: https://btcpay.your.server.tld
|
||||
*/
|
||||
'server_url' => env('BTCPAY_SERVER_URL'),
|
||||
|
||||
/*
|
||||
* This is the Store ID of your BTCPayServer Store that you wish to create
|
||||
* the invoices on. You will find it in the "Store Settings".
|
||||
* i.e.: someRandomStringWithWildAlphaNumericChars
|
||||
*/
|
||||
'store_id' => env('BTCPAY_STORE_ID'),
|
||||
|
||||
/*
|
||||
* Indicates if configured webhook (notificationURL) should automatically be set on:
|
||||
* - Invoices
|
||||
* - Recipients
|
||||
* - Payouts/PayoutBatches
|
||||
*
|
||||
* This feature is overridden when a value is manually set on a respective resource
|
||||
* before submitting it to the BitPay API.
|
||||
*
|
||||
* Uncomment an entry to enable its auto-population.
|
||||
*/
|
||||
'auto_populate_webhook' => [
|
||||
// \Petzsch\LaravelBtcpay\Constants\WebhookAutoPopulate::For_Invoices,
|
||||
// \Petzsch\LaravelBtcpay\Constants\WebhookAutoPopulate::For_Recipients,
|
||||
// \Petzsch\LaravelBtcpay\Constants\WebhookAutoPopulate::For_Payouts,
|
||||
],
|
||||
];
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'configs' => [
|
||||
[
|
||||
/*
|
||||
* This package supports multiple webhook receiving endpoints. If you only have
|
||||
* one endpoint receiving webhooks, you can use 'default'.
|
||||
*/
|
||||
'name' => 'default',
|
||||
|
||||
/*
|
||||
* We expect that every webhook call will be signed using a secret. This secret
|
||||
* is used to verify that the payload has not been tampered with.
|
||||
*/
|
||||
'signing_secret' => env('WEBHOOK_CLIENT_SECRET'),
|
||||
|
||||
/*
|
||||
* The name of the header containing the signature.
|
||||
*/
|
||||
'signature_header_name' => 'btcpay-sig',
|
||||
|
||||
/*
|
||||
* This class will verify that the content of the signature header is valid.
|
||||
*
|
||||
* It should implement \Spatie\WebhookClient\SignatureValidator\SignatureValidator
|
||||
*/
|
||||
'signature_validator' => \Spatie\WebhookClient\SignatureValidator\DefaultSignatureValidator::class,
|
||||
|
||||
/*
|
||||
* This class determines if the webhook call should be stored and processed.
|
||||
*/
|
||||
'webhook_profile' => \Spatie\WebhookClient\WebhookProfile\ProcessEverythingWebhookProfile::class,
|
||||
|
||||
/*
|
||||
* This class determines the response on a valid webhook call.
|
||||
*/
|
||||
'webhook_response' => \Spatie\WebhookClient\WebhookResponse\DefaultRespondsTo::class,
|
||||
|
||||
/*
|
||||
* The classname of the model to be used to store webhook calls. The class should
|
||||
* be equal or extend Spatie\WebhookClient\Models\WebhookCall.
|
||||
*/
|
||||
'webhook_model' => \Spatie\WebhookClient\Models\WebhookCall::class,
|
||||
|
||||
/*
|
||||
* In this array, you can pass the headers that should be stored on
|
||||
* the webhook call model when a webhook comes in.
|
||||
*
|
||||
* To store all headers, set this value to `*`.
|
||||
*/
|
||||
'store_headers' => [
|
||||
'*',
|
||||
],
|
||||
|
||||
/*
|
||||
* The class name of the job that will process the webhook request.
|
||||
*
|
||||
* This should be set to a class that extends \Spatie\WebhookClient\Jobs\ProcessWebhookJob.
|
||||
*/
|
||||
'process_webhook_job' => '\App\Jobs\ProcessBtcPayWebhook',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
* The integer amount of days after which models should be deleted.
|
||||
*
|
||||
* 7 deletes all records after 1 week. Set to null if no models should be deleted.
|
||||
*/
|
||||
'delete_after_days' => 30,
|
||||
];
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('webhook_calls', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->string('name');
|
||||
$table->string('url');
|
||||
$table->json('headers')->nullable();
|
||||
$table->json('payload')->nullable();
|
||||
$table->text('exception')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user