-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-> Finishes #213
- Loading branch information
Showing
21 changed files
with
1,230 additions
and
608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Build Frontend", | ||
"type": "node-terminal", | ||
"command": "php mythicalclient frontend:build", | ||
"request": "launch" | ||
|
||
}, | ||
{ | ||
"name": "Watch Backend", | ||
"type": "node-terminal", | ||
"command": "php mythicalclient backend:watch", | ||
"request": "launch" | ||
}, | ||
{ | ||
"name": "Lint Backend", | ||
"type": "node-terminal", | ||
"command": "php mythicalclient backend:lint", | ||
"request": "launch" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of MythicalClient. | ||
* Please view the LICENSE file that was distributed with this source code. | ||
* | ||
* # MythicalSystems License v2.0 | ||
* | ||
* ## Copyright (c) 2021–2025 MythicalSystems and Cassian Gherman | ||
* | ||
* Breaking any of the following rules will result in a permanent ban from the MythicalSystems community and all of its services. | ||
*/ | ||
|
||
use MythicalClient\App; | ||
use MythicalClient\Plugins\PluginDB; | ||
use MythicalClient\Chat\User\Session; | ||
use MythicalClient\Chat\Orders\Orders; | ||
use MythicalClient\Chat\Services\Services; | ||
use MythicalClient\Chat\columns\UserColumns; | ||
use MythicalClient\Chat\Orders\OrdersConfig; | ||
use MythicalClient\Chat\Orders\OrdersInvoices; | ||
use MythicalClient\Chat\Services\ServiceCategories; | ||
use MythicalClient\Plugins\Providers\PluginProviderHelper; | ||
|
||
|
||
$router->add('/api/user/addfunds', function () { | ||
global $pluginManager; | ||
global $pluginManager; | ||
App::init(); | ||
$appInstance = App::getInstance(true); | ||
$appInstance->allowOnlyPOST(); | ||
$session = new Session($appInstance); | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
<?php | ||
|
||
$router->add('/api/webhooks/paypal', function () { | ||
use MythicalClient\App; | ||
use MythicalClient\Chat\columns\UserColumns; | ||
use MythicalClient\Chat\User\Session; | ||
|
||
|
||
}); | ||
/* | ||
* This file is part of MythicalClient. | ||
* Please view the LICENSE file that was distributed with this source code. | ||
* | ||
* # MythicalSystems License v2.0 | ||
* | ||
* ## Copyright (c) 2021–2025 MythicalSystems and Cassian Gherman | ||
* | ||
* Breaking any of the following rules will result in a permanent ban from the MythicalSystems community and all of its services. | ||
*/ | ||
|
||
|
||
// Route handlers | ||
$router->post('/api/webhooks/paypal', function() { | ||
$paypal = new MythicalClient\Gateways\PayPal(); | ||
$paypal->handleIPN(); | ||
}); | ||
|
||
$router->get('/api/paypal/process', function() { | ||
App::init(); | ||
$app = App::getInstance(true); | ||
$session = new Session($app); | ||
|
||
try { | ||
if (!isset($_GET['coins']) || empty($_GET['coins'])) { | ||
throw new \InvalidArgumentException('Missing coins parameter'); | ||
} | ||
|
||
$paypal = new MythicalClient\Gateways\PayPal(); | ||
$redirectUrl = $paypal->createPayment( | ||
(float)$_GET['coins'], | ||
$session->getInfo(UserColumns::UUID, false) | ||
); | ||
|
||
header("Location: $redirectUrl"); | ||
exit; | ||
} catch (\Throwable $e) { | ||
$app->getLogger()->error('PayPal process error: ' . $e->getMessage()); | ||
header('Location: /?error=payment_failed&message=' . $e->getMessage()); | ||
exit; | ||
} | ||
}); | ||
|
||
$router->add('/api/paypal/finish', function() { | ||
App::init(); | ||
$app = App::getInstance(true); | ||
|
||
header('Location: /dashboard'); | ||
exit; | ||
}); |
Oops, something went wrong.