Skip to content

Commit

Permalink
Merge pull request #5 from WebStollenPaymentTeam/main
Browse files Browse the repository at this point in the history
jtl mollie plugin v1.5.0
  • Loading branch information
hwysoszynski authored Apr 3, 2024
2 parents 2e3fa58 + 1f90c2a commit c197e36
Show file tree
Hide file tree
Showing 110 changed files with 2,558 additions and 2,830 deletions.
20 changes: 0 additions & 20 deletions .gitignore

This file was deleted.

150 changes: 0 additions & 150 deletions .gitlab-ci.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .htaccess

This file was deleted.

45 changes: 4 additions & 41 deletions Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,19 @@

namespace Plugin\ws5_mollie;

use JTL\Backend\Notification;
use JTL\Backend\NotificationEntry;
use JTL\DB\ReturnType;
use JTL\Events\Dispatcher;
use JTL\Exceptions\CircularReferenceException;
use JTL\Exceptions\ServiceNotFoundException;
use JTL\Shop;
use Plugin\ws5_mollie\lib\Hook\ApplePay;
use Plugin\ws5_mollie\lib\Hook\Checkbox;
use Plugin\ws5_mollie\lib\Hook\IncompletePaymentHandler;
use Plugin\ws5_mollie\lib\Hook\Queue;
use Plugin\ws5_mollie\lib\Mapper\MollieUpgradeMapper;
use WS\JTL5\Mapper\UpgradeMapperInterface;
use WS\JTL5\Traits\Plugins;
use Plugin\ws5_mollie\lib\PluginHelper;

require_once __DIR__ . '/vendor/autoload.php';

class Bootstrap extends \WS\JTL5\Bootstrap
class Bootstrap extends \WS\JTL5\V1_0_16\Bootstrap
{
use Plugins;

/**
* @param Dispatcher $dispatcher
* @throws CircularReferenceException
Expand All @@ -37,27 +29,6 @@ public function boot(Dispatcher $dispatcher): void
{
parent::boot($dispatcher);

if (!Shop::isFrontend()) {
$notificationSetting = self::Plugin('ws5_mollie')->getConfig()->getValue("notifications");
if (in_array($notificationSetting, ['Y', 'A']) && $authorized = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_orders WHERE cStatus = "authorized" AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY)', ReturnType::AFFECTED_ROWS)) {
Notification::getInstance()->add(
NotificationEntry::TYPE_WARNING,
'Mollie Authorized Orders',
"Derzeit gibt es {$authorized} Bestellung(en), mit dem Status 'authorized' (in den letzten 30 Tagen).",
Shop::getURL() . '/admin/plugin.php?kPlugin=' . self::Plugin('ws5_mollie')->getID()
);
}

if (in_array($notificationSetting, ['Y', 'Q']) && $errors = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_queue WHERE cError IS NOT NULL AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY);', ReturnType::AFFECTED_ROWS)) {
Notification::getInstance()->add(
NotificationEntry::TYPE_DANGER,
'Mollie Queue with Errors',
"Derzeit gibt es {$errors} Warteschlangen-Einträge, mit einem Fehler (in den letzten 30 Tagen).",
Shop::getURL() . '/admin/plugin.php?kPlugin=' . self::Plugin('ws5_mollie')->getID()
);
}
}

$this->listen(HOOK_SMARTY_OUTPUTFILTER, [ApplePay::class, 'execute']);

$this->listen(HOOK_BESTELLVORGANG_PAGE, [IncompletePaymentHandler::class, 'checkForIncompletePayment']);
Expand All @@ -69,17 +40,9 @@ public function boot(Dispatcher $dispatcher): void
$this->listen(HOOK_BESTELLUNGEN_XML_BESTELLSTATUS, [Queue::class, 'xmlBestellStatus']);

$this->listen(HOOK_BESTELLUNGEN_XML_BEARBEITESTORNO, [Queue::class, 'xmlBearbeiteStorno']);

if ($this->getPlugin()->getConfig()->getValue('useCustomerAPI') === 'C') {
if (PluginHelper::getSetting('useCustomerAPI') === 'C') {
$this->listen(HOOK_CHECKBOX_CLASS_GETCHECKBOXFRONTEND, [Checkbox::class, 'execute']);
}
}

/**
* @return null|UpgradeMapperInterface
*/
public function getUpgradeMapper(): ?UpgradeMapperInterface
{
return new MollieUpgradeMapper('ws_mollie', 'ws5_mollie');
}
}
25 changes: 0 additions & 25 deletions LICENSE

This file was deleted.

Empty file removed Migrations/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion adminmenu/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @link https://www.webstollen.de
*/

use WS\JTL5\Backend\API;
use WS\JTL5\V1_0_16\Backend\API;

if ($_SERVER['HTTP_HOST'] === 'localhost') {
header('Access-Control-Allow-Origin: *');
Expand Down
24 changes: 0 additions & 24 deletions adminmenu/app/.gitignore

This file was deleted.

46 changes: 46 additions & 0 deletions adminmenu/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
Loading

0 comments on commit c197e36

Please sign in to comment.