Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Oct 23, 2024
1 parent 84eec51 commit fbe47b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Checkout/EventSubscriber/CheckoutEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function proceedToPayment(CheckoutCompletedEvent $event)
} catch (PsCheckoutException $exception) {
if ($exception->getCode() === PsCheckoutException::PAYPAL_ORDER_ALREADY_CAPTURED) {
$this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue()));

return;
} else {
throw $exception;
Expand Down Expand Up @@ -161,6 +162,7 @@ public function proceedToPayment(CheckoutCompletedEvent $event)
throw $exception;
} elseif ($exception->getCode() === PayPalException::ORDER_ALREADY_CAPTURED) {
$this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue()));

return;
} else {
throw $exception;
Expand Down
20 changes: 20 additions & 0 deletions src/PayPal/Order/Cache/PayPalOrderCache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
<?php

/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/

namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache;

use PsCheckoutCart;
Expand All @@ -16,6 +35,7 @@ class PayPalOrderCache extends ChainCache
PsCheckoutCart::STATUS_CANCELED => 3600,
PsCheckoutCart::STATUS_COMPLETED => 3600,
];

public function set($key, $value, $ttl = null)
{
if (!$ttl && isset($value['status']) && isset(self::CACHE_TTL[$value['status']])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand)
$payload['vault'] = true;
}

$response = $this->maaslandHttpClient->captureOrder($payload, [], 3);
$response = $this->maaslandHttpClient->captureOrder($payload);

$orderPayPal = json_decode($response->getBody(), true);

Expand Down

0 comments on commit fbe47b8

Please sign in to comment.