Skip to content

Commit

Permalink
Release 2.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed Sep 29, 2023
1 parent 0c09b04 commit 4bc545a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 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.35/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.wallee.com/wallee-payment/plentymarkets/2.0.36/docs/en/documentation.html)

## License

Please see the [license file](https://github.com/wallee-payment/plentymarkets/blob/2.0.35/LICENSE) for more information.
Please see the [license file](https://github.com/wallee-payment/plentymarkets/blob/2.0.36/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 @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/plentymarkets/releases/tag/2.0.35/">
<a href="https://github.com/wallee-payment/plentymarkets/releases/tag/2.0.36/">
Source
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion 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.35",
"version": "2.0.36",
"license": " Apache License Version 2",
"isClosedSource": false,
"pluginIcon": "icon_plugin_md.png",
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/de/debug.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
basic = "wallee Debug"
basic = "wallee Debug"
wallee_timing="wallee Timing"
3 changes: 2 additions & 1 deletion resources/lang/en/debug.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
basic = "wallee Debug"
basic = "wallee Debug"
wallee_timing="wallee Timing"
3 changes: 2 additions & 1 deletion resources/lang/fr/debug.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
basic = "wallee Debug"
basic = "wallee Debug"
wallee_timing="wallee Timing"
3 changes: 2 additions & 1 deletion resources/lang/it/debug.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
basic = "wallee Debug"
basic = "wallee Debug"
wallee_timing="wallee Timing"
19 changes: 19 additions & 0 deletions src/Services/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public function createWebhook()
public function executePayment(Order $order, PaymentMethod $paymentMethod): array
{
$transactionId = $this->session->getPlugin()->getValue('walleeTransactionId');
$time_start = microtime(true);
$timingLogs = [];

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

$parameters = [
'transactionId' => $transactionId,
Expand All @@ -201,6 +205,9 @@ public function executePayment(Order $order, PaymentMethod $paymentMethod): arra
$existingTransaction = $this->sdkService->call('getTransactionByMerchantReference', [
'merchantReference' => $order->id
]);

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

if (is_array($existingTransaction) && $existingTransaction['error']) {
$this->getLogger(__METHOD__)->error('wallee::ExistingTransactionsError', $existingTransaction);
return [
Expand Down Expand Up @@ -241,9 +248,13 @@ public function executePayment(Order $order, PaymentMethod $paymentMethod): arra
];
}

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

$payment = $this->paymentHelper->createPlentyPayment($transaction);
$this->paymentHelper->assignPlentyPaymentToPlentyOrder($payment, $order->id);

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

$hasPossiblePaymentMethods = $this->sdkService->call('hasPossiblePaymentMethods', [
'transactionId' => $transaction['id']
]);
Expand All @@ -255,9 +266,14 @@ public function executePayment(Order $order, PaymentMethod $paymentMethod): arra
];
}

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

$paymentPageUrl = $this->sdkService->call('buildPaymentPageUrl', [
'id' => $transaction['id']
]);

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

if (is_array($paymentPageUrl) && isset($paymentPageUrl['error'])) {
$this->getLogger(__METHOD__)->error('wallee::PaymentPageUrlError', $paymentPageUrl);
return [
Expand All @@ -267,6 +283,9 @@ public function executePayment(Order $order, PaymentMethod $paymentMethod): arra
];
}

$timingLogs["finished"] = microtime(true) - $time_start;
$this->getLogger(__METHOD__)->debug('wallee::debug.wallee_timing', $timingLogs);

return [
'type' => GetPaymentMethodContent::RETURN_TYPE_REDIRECT_URL,
'content' => $paymentPageUrl
Expand Down

0 comments on commit 4bc545a

Please sign in to comment.