mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
removing files
This commit is contained in:
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Domain\Settings\Actions;
|
|
||||||
|
|
||||||
use ErrorException;
|
|
||||||
use VueFileManager\Subscription\Support\EngineManager;
|
|
||||||
use VueFileManager\Subscription\Domain\Plans\DTO\CreateFixedPlanData;
|
|
||||||
|
|
||||||
class TestPayPalConnectionAction
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public EngineManager $subscription
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke($credentials)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
// Set temporary stripe connection
|
|
||||||
config([
|
|
||||||
'subscription.credentials.paypal' => [
|
|
||||||
'secret' => $credentials['secret'],
|
|
||||||
'id' => $credentials['key'],
|
|
||||||
'webhook_id' => $credentials['webhook'],
|
|
||||||
'is_live' => $credentials['live'],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Define test plan
|
|
||||||
$data = CreateFixedPlanData::fromArray([
|
|
||||||
'type' => 'fixed',
|
|
||||||
'name' => 'Test Plan',
|
|
||||||
'description' => null,
|
|
||||||
'features' => [
|
|
||||||
'max_storage_amount' => 200,
|
|
||||||
'max_team_members' => 20,
|
|
||||||
],
|
|
||||||
'currency' => 'EUR',
|
|
||||||
'amount' => 99,
|
|
||||||
'interval' => 'month',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Create test plan
|
|
||||||
$plan = $this->subscription
|
|
||||||
->driver('paypal')
|
|
||||||
->createFixedPlan($data);
|
|
||||||
|
|
||||||
// Delete plan
|
|
||||||
$this->subscription
|
|
||||||
->driver('paypal')
|
|
||||||
->deletePlan($plan['id']);
|
|
||||||
} catch (ErrorException $error) {
|
|
||||||
abort(
|
|
||||||
response()->json([
|
|
||||||
'type' => 'service-connection-error',
|
|
||||||
'title' => 'Service Connection Error',
|
|
||||||
'message' => $error->getMessage(),
|
|
||||||
], 401)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Domain\Settings\Actions;
|
|
||||||
|
|
||||||
use ErrorException;
|
|
||||||
use VueFileManager\Subscription\Support\EngineManager;
|
|
||||||
use VueFileManager\Subscription\Domain\Plans\DTO\CreateFixedPlanData;
|
|
||||||
|
|
||||||
class TestPaystackConnectionAction
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public EngineManager $subscription
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke($credentials)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
// Set temporary paystack connection
|
|
||||||
config([
|
|
||||||
'subscription.credentials.paystack' => [
|
|
||||||
'secret' => $credentials['secret'],
|
|
||||||
'public_key' => $credentials['key'],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Define test plan
|
|
||||||
$data = CreateFixedPlanData::fromArray([
|
|
||||||
'type' => 'fixed',
|
|
||||||
'name' => 'Test Plan',
|
|
||||||
'description' => null,
|
|
||||||
'features' => [
|
|
||||||
'max_storage_amount' => 200,
|
|
||||||
'max_team_members' => 20,
|
|
||||||
],
|
|
||||||
'currency' => 'ZAR',
|
|
||||||
'amount' => 99999,
|
|
||||||
'interval' => 'month',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Create test plan
|
|
||||||
$plan = $this->subscription
|
|
||||||
->driver('paystack')
|
|
||||||
->createFixedPlan($data);
|
|
||||||
|
|
||||||
// Delete plan
|
|
||||||
$this->subscription
|
|
||||||
->driver('paystack')
|
|
||||||
->deletePlan($plan['id']);
|
|
||||||
} catch (ErrorException $error) {
|
|
||||||
abort(
|
|
||||||
response()->json([
|
|
||||||
'type' => 'service-connection-error',
|
|
||||||
'title' => 'Service Connection Error',
|
|
||||||
'message' => $error->getMessage(),
|
|
||||||
], 401)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Domain\Settings\Actions;
|
|
||||||
|
|
||||||
use ErrorException;
|
|
||||||
use VueFileManager\Subscription\Support\EngineManager;
|
|
||||||
use VueFileManager\Subscription\Domain\Plans\DTO\CreateFixedPlanData;
|
|
||||||
|
|
||||||
class TestStripeConnectionAction
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public EngineManager $subscription
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke($credentials)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
// Set temporary stripe connection
|
|
||||||
config([
|
|
||||||
'subscription.credentials.stripe' => [
|
|
||||||
'secret' => $credentials['secret'],
|
|
||||||
'public_key' => $credentials['key'],
|
|
||||||
'webhook_key' => $credentials['webhook'],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Define test plan
|
|
||||||
$data = CreateFixedPlanData::fromArray([
|
|
||||||
'type' => 'fixed',
|
|
||||||
'name' => 'Test Plan',
|
|
||||||
'description' => null,
|
|
||||||
'features' => [
|
|
||||||
'max_storage_amount' => 200,
|
|
||||||
'max_team_members' => 20,
|
|
||||||
],
|
|
||||||
'currency' => 'EUR',
|
|
||||||
'amount' => 99,
|
|
||||||
'interval' => 'month',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Create test plan
|
|
||||||
$plan = $this->subscription
|
|
||||||
->driver('stripe')
|
|
||||||
->createFixedPlan($data);
|
|
||||||
|
|
||||||
// Delete plan
|
|
||||||
$this->subscription
|
|
||||||
->driver('stripe')
|
|
||||||
->deletePlan($plan['id']);
|
|
||||||
} catch (ErrorException $error) {
|
|
||||||
abort(
|
|
||||||
response()->json([
|
|
||||||
'type' => 'service-connection-error',
|
|
||||||
'title' => 'Service Connection Error',
|
|
||||||
'message' => $error->getMessage(),
|
|
||||||
], 401)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user