Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Nov 12, 2024
1 parent 84d9f10 commit acc1a46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
7 changes: 1 addition & 6 deletions src/PayPal/Order/Cache/PayPalOrderCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache;

use PsCheckoutCart;
use Psr\SimpleCache\InvalidArgumentException;
use Symfony\Component\Cache\Simple\ChainCache;

class PayPalOrderCache extends ChainCache
Expand All @@ -38,13 +37,9 @@ class PayPalOrderCache extends ChainCache
];

/**
* @param string $key
* @param $value
* @param int $ttl Time To Live in seconds. Defines how long the value will be stored in the cache.
* {@inheritdoc}
*
* @return bool
*
* @throws InvalidArgumentException
*/
public function set($key, $value, $ttl = null)
{
Expand Down
19 changes: 10 additions & 9 deletions src/PayPal/Order/PaypalOrderDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,16 @@ public function isTokenSaved()

public function getPaymentTokenIdentifier()
{
$fundingSource = $this->payPalOrder->getFundingSource();

if ($this->payPalOrder && isset($this->payPalOrder->getPaymentSource()[$fundingSource])) {
$paymentSource = $this->payPalOrder->getPaymentSource()[$fundingSource];

if ($fundingSource === 'card') {
return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : '');
} else {
return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : '';
if ($this->payPalOrder) {
$fundingSource = $this->payPalOrder->getFundingSource();
if (isset($this->payPalOrder->getPaymentSource()[$fundingSource])) {
$paymentSource = $this->payPalOrder->getPaymentSource()[$fundingSource];

if ($fundingSource === 'card') {
return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : '');
} else {
return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : '';
}
}
}

Expand Down

0 comments on commit acc1a46

Please sign in to comment.