Skip to content

Commit

Permalink
Release 2.0.40
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed May 23, 2024
1 parent 7466744 commit 376389c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ This repository contains the plentymarkets extension that enables to process pay

## Documentation

* [Documentation](https://plugin-documentation.wallee.com/wallee-payment/plentymarkets/2.0.39/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.wallee.com/wallee-payment/plentymarkets/2.0.40/docs/en/documentation.html)

## License

Please see the [license file](https://github.com/wallee-payment/plentymarkets/blob/2.0.39/LICENSE) for more information.
Please see the [license file](https://github.com/wallee-payment/plentymarkets/blob/2.0.40/LICENSE) for more information.
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/plentymarkets/releases/tag/2.0.39/">
<a href="https://github.com/wallee-payment/plentymarkets/releases/tag/2.0.40/">
Source
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"namespace": "Wallee",
"type": "payment",
"version": "2.0.39",
"version": "2.0.40",
"license": " Apache License Version 2",
"isClosedSource": false,
"pluginIcon": "icon_plugin_md.png",
Expand Down Expand Up @@ -40,7 +40,7 @@
"php": ">=7.3 <8.1"
},
"dependencies": {
"wallee/sdk": "3.0.2"
"wallee/sdk": "4.2.0"
},
"runOnBuild": [
"Wallee\\Migrations\\CreatePaymentMethods",
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/de/debug.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
basic = "wallee Debug"
wallee_timing="wallee Timing"
wallee_timing="wallee Timing"
wallee_timing_serviceprovider="wallee Timing Service Provider"
3 changes: 2 additions & 1 deletion resources/lang/en/debug.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
basic = "wallee Debug"
wallee_timing="wallee Timing"
wallee_timing="wallee Timing"
wallee_timing_serviceprovider="wallee Timing Service Provider"
3 changes: 2 additions & 1 deletion resources/lang/fr/debug.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
basic = "wallee Debug"
wallee_timing="wallee Timing"
wallee_timing="wallee Timing"
wallee_timing_serviceprovider="wallee Timing Service Provider"
3 changes: 2 additions & 1 deletion resources/lang/it/debug.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
basic = "wallee Debug"
wallee_timing="wallee Timing"
wallee_timing="wallee Timing"
wallee_timing_serviceprovider="wallee Timing Service Provider"
28 changes: 25 additions & 3 deletions src/Helper/WalleeServiceProviderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
use Plenty\Modules\Payment\Events\Checkout\GetPaymentMethodContent;
use Plenty\Modules\Payment\Events\Checkout\ExecutePayment;
use Plenty\Plugin\Events\Dispatcher;
use Plenty\Plugin\Log\Loggable;
use Wallee\Helper\PaymentHelper;
use Wallee\Services\PaymentService;

class WalleeServiceProviderHelper
{
use Loggable;

/**
* @var $eventDispatcher
*/
Expand Down Expand Up @@ -67,14 +70,33 @@ public function __construct(
*/
public function addExecutePaymentContentEventListener() {
$this->eventDispatcher->listen(ExecutePayment::class, function (ExecutePayment $event) {
if ($this->paymentHelper->isWalleePaymentMopId($event->getMop())) {

$time_start = microtime(true);
$timingLogs = [];

$timingLogs["execute_payment_start"] = microtime(true) - $time_start;

$eventOrderId = $this->orderRepository->findById($event->getOrderId());

$timingLogs["eventOrderId"] = microtime(true) - $time_start;

$eventMop = $this->paymentMethodService->findByPaymentMethodId($event->getMop());

$timingLogs["eventMop"] = microtime(true) - $time_start;

if ($eventMop) {

$result = $this->paymentService->executePayment(
$this->orderRepository->findById($event->getOrderId()),
$this->paymentMethodService->findByPaymentMethodId($event->getMop())
$eventOrderId,
$eventMop
);
$event->setValue(isset($result['content']) ? $result['content'] : null);
$event->setType(isset($result['type']) ? $result['type'] : '');
}

$timingLogs["executePayment"] = microtime(true) - $time_start;

$this->getLogger(__METHOD__)->error('wallee::debug.wallee_timing_serviceprovider', $timingLogs);
});
}
}

0 comments on commit 376389c

Please sign in to comment.