Skip to content

Commit

Permalink
Merge pull request #1175 from PrestaShopCorp/release/7.3.5.2
Browse files Browse the repository at this point in the history
Release v7.3.5.2
  • Loading branch information
Matt75 authored Dec 7, 2023
2 parents b69e746 + 77989a8 commit 30cd1da
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 23 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_checkout</name>
<displayName><![CDATA[PrestaShop Checkout]]></displayName>
<version><![CDATA[7.3.5.1]]></version>
<version><![CDATA[7.3.5.2]]></version>
<description><![CDATA[Provide the most commonly used payment methods to your customers in this all-in-one module, and manage all your sales in a centralized interface.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
Expand Down
6 changes: 1 addition & 5 deletions config/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ services:

ps_checkout.module.version:
class: 'PrestaShop\Module\PrestashopCheckout\Version\Version'
factory:
[
'PrestaShop\Module\PrestashopCheckout\Version\Version',
"buildFromString",
]
factory: ["PrestaShop\\Module\\PrestashopCheckout\\Version\\Version", "buildFromString"]
public: true
arguments:
- '@=service("ps_checkout.module").version'
Expand Down
27 changes: 16 additions & 11 deletions controllers/admin/AdminAjaxPrestashopCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,19 +753,24 @@ public function ajaxProcessGetOrRefreshToken()
$psAccountRepository = $this->module->getService('ps_checkout.repository.prestashop.account');

try {
$token = $psAccountRepository->getIdToken();

$this->ajaxDie(json_encode([
$this->exitWithResponse([
'httpCode' => 200,
'status' => true,
'token' => $token,
], JSON_PRETTY_PRINT));
} catch (\Exception $exception) {
http_response_code($exception->getCode());

$this->ajaxDie(json_encode([
'token' => $psAccountRepository->getIdToken(),
'shopId' => $psAccountRepository->getShopUuid(),
'isAccountLinked' => $psAccountRepository->isAccountLinked(),
]);
} catch (Exception $exception) {
$this->exitWithResponse([
'httpCode' => 500,
'status' => false,
'error' => $exception->getMessage(),
], JSON_PRETTY_PRINT));
'error' => sprintf(
'%s %d : %s',
get_class($exception),
$exception->getCode(),
$exception->getMessage()
),
]);
}
}

Expand Down
28 changes: 22 additions & 6 deletions ps_checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Ps_checkout extends PaymentModule

// Needed in order to retrieve the module version easier (in api call headers) than instanciate
// the module each time to get the version
const VERSION = '7.3.5.1';
const VERSION = '7.3.5.2';

const INTEGRATION_DATE = '2022-14-06';

Expand All @@ -144,7 +144,7 @@ public function __construct()

// We cannot use the const VERSION because the const is not computed by addons marketplace
// when the zip is uploaded
$this->version = '7.3.5.1';
$this->version = '7.3.5.2';
$this->author = 'PrestaShop';
$this->currencies = true;
$this->currencies_mode = 'checkbox';
Expand Down Expand Up @@ -526,18 +526,34 @@ public function hookDisplayFooterProduct()

public function getContent()
{
/** @var \PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts $psAccountsFacade */
$psAccountsFacade = $this->getService('ps_accounts.facade');
$env = new \PrestaShop\Module\PrestashopCheckout\Environment\Env();
try {
/** @var \PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts $psAccountsFacade */
$psAccountsFacade = $this->getService('ps_accounts.facade');
/** @var \PrestaShop\PsAccountsInstaller\Installer\Presenter\InstallerPresenter $psAccountsPresenter */
$psAccountsPresenter = $psAccountsFacade->getPsAccountsPresenter();
// @phpstan-ignore-next-line
$contextPsAccounts = $psAccountsPresenter->present($this->name);
} catch (Exception $exception) {
$contextPsAccounts = [];
$this->getLogger()->error(
'Failed to get PsAccounts context',
[
'exception' => get_class($exception),
'exceptionCode' => $exception->getCode(),
'exceptionMessage' => $exception->getMessage(),
]
);
}

/** @var \PrestaShop\Module\PrestashopCheckout\Presenter\Store\StorePresenter $storePresenter */
$storePresenter = $this->getService('ps_checkout.store.store');

Media::addJsDef([
'store' => $storePresenter->present(),
'contextPsAccounts' => $psAccountsFacade->getPsAccountsPresenter()->present(),
'contextPsAccounts' => $contextPsAccounts,
]);

$env = new \PrestaShop\Module\PrestashopCheckout\Environment\Env();
$boSdkUrl = $env->getEnv('CHECKOUT_BO_SDK_URL');
if (substr($boSdkUrl, -3) !== '.js') {
$boSdkVersion = $env->getEnv('CHECKOUT_BO_SDK_VERSION');
Expand Down

0 comments on commit 30cd1da

Please sign in to comment.