Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5feb6b1
chore: init new major v8
hschoenenberger May 6, 2025
7027a09
[ACCOUNT-2595/2604] feat: create & verify shop identity (#433)
atourneriePresta Jun 5, 2025
a38c18d
fix: shop verification error (#496)
antoinemetifeu Jun 10, 2025
803e259
feat: verif implicit (#499)
antoinemetifeu Jun 10, 2025
03f91ae
[ACCOUNT-2832] feat: identify contact (#481)
hschoenenberger Jun 10, 2025
b78e25f
Add store audience (#501)
antoinemetifeu Jun 12, 2025
cb39e74
Merge remote-tracking branch 'origin/main' into major/v8
hschoenenberger Jun 12, 2025
23ba011
fix: don't disconnect bo when identify contact flow fails (#502)
hschoenenberger Jun 12, 2025
060c341
Merge branch 'main' into major/v8
hschoenenberger Jun 23, 2025
e41dca8
[ACCOUNT-2945] feat: fallback session for ps16 (#506)
hschoenenberger Jun 24, 2025
5e7e291
[ACCOUNT-2953] Compat firebase tokens (#505)
antoinemetifeu Jun 27, 2025
0b4fd03
[ACCOUNT-2853] feat: upgrade to v8 (#503)
guillaume60240 Jun 27, 2025
1d1a9c9
fix: debug hook display condition
hschoenenberger Jun 27, 2025
6e558e6
fix: cache invalidation
hschoenenberger Jun 27, 2025
65129c0
feat: add shop status accessors into PsAccountsService and update rea…
hschoenenberger Jul 1, 2025
37718ac
feat: refresh invalid token (#510)
hschoenenberger Jul 2, 2025
34fbd38
fix: status manager circular dep (#517)
hschoenenberger Jul 15, 2025
4e2f56c
fix: generic beta tag for component version
hschoenenberger Jul 16, 2025
4b2ea02
feat: debugbar alert env (#518)
hschoenenberger Jul 17, 2025
898016a
feat: get last upgraded version (#513)
hschoenenberger Jul 29, 2025
7ea8940
refactor: introduce header constants (#522)
hschoenenberger Jul 31, 2025
fe16271
refactor: improve upgrade service (#524)
antoinemetifeu Aug 6, 2025
e7179cd
fix: plugin upgrade service (#529)
hschoenenberger Aug 6, 2025
9273463
[ACCOUNT-2608] Manual verify shop (#519)
sullivan-monteiro Aug 6, 2025
f195a68
[ACCOUNT-3038] feat: context with empty status (#531)
hschoenenberger Aug 11, 2025
c881efc
[ACCOUNT-3019] Manual verification tracking (#520)
antoinemetifeu Aug 12, 2025
4595525
fix: declare new admin controllers at upgrade time
hschoenenberger Aug 12, 2025
a948434
feat: finish the job providing source tracking (#537)
hschoenenberger Aug 19, 2025
a157798
feat: remove admin debug controller (#534)
hschoenenberger Aug 19, 2025
5362a4f
feat: two steps creation & verification (#538)
hschoenenberger Aug 20, 2025
dfbdbe7
[ACCOUNT-3009] fix: IFrame integration - CORS admin controller (#528)
hschoenenberger Aug 21, 2025
09ddf7d
feat: remove fallback vue component (#535)
hschoenenberger Aug 22, 2025
4a2167c
fix: use fallback session to avoid interacting with ps session (#539)
hschoenenberger Aug 22, 2025
258a0a5
Merge remote-tracking branch 'origin/main' into major/v8
hschoenenberger Aug 22, 2025
62c6f5c
feat: improve upgrade script (#542)
hschoenenberger Aug 28, 2025
77da8bb
[ACCOUNT-3069] fix: reset migrate from v5 (#543)
hschoenenberger Sep 1, 2025
27ad49b
[ACCOUNT-3058] feat: manual verification flag (#544)
hschoenenberger Sep 1, 2025
4615105
[ACCOUNT-3078] feat: optimistic set point of contact (#545)
hschoenenberger Sep 4, 2025
2c1d33d
feat: detect url change alert (#540)
hschoenenberger Sep 4, 2025
196aadb
feat: add isVerified status management in CreateIdentityHandler and S…
guillaume60240 Sep 4, 2025
a0c2ad5
[ACCOUNT-3070] Add store name (#546)
antoinemetifeu Sep 4, 2025
88c7615
feat: improve migration need detection & from version
hschoenenberger Sep 4, 2025
a5fda36
feat: improve migration need detection & from version
hschoenenberger Sep 4, 2025
46fbdb5
feat: improve migration need detection & from version
hschoenenberger Sep 4, 2025
32f86eb
feat: improve migration need detection & from version
hschoenenberger Sep 5, 2025
8a2a54d
Merge remote-tracking branch 'origin/main' into feat/migration-detect…
hschoenenberger Sep 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion controllers/admin/AdminAjaxPsAccountsController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
Expand Down
34 changes: 28 additions & 6 deletions src/Account/CommandHandler/MigrateOrCreateIdentityV8Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,8 @@ public function __construct(
public function handle(MigrateOrCreateIdentityV8Command $command)
{
$shopId = $command->shopId ?: \Shop::getContextShopID();
$shopUuid = $this->configurationRepository->getShopUuid();

// FIXME: command can hold that property depending on context
$fromVersion = $this->upgradeService->getRegisteredVersion();

// FIXME: shouldn't this condition be a specific flag
if (!$shopUuid || version_compare($fromVersion, '8', '>=')) {
if (!$this->needMigration()) {
$this->upgradeService->setVersion();

$this->commandBus->handle(new CreateIdentityCommand(
Expand All @@ -140,6 +135,9 @@ public function handle(MigrateOrCreateIdentityV8Command $command)
return;
}

$shopUuid = $this->configurationRepository->getShopUuid();
$fromVersion = $this->getFromVersion();

// migrate cloudShopId locally
$this->statusManager->setCloudShopId($shopUuid);

Expand Down Expand Up @@ -204,4 +202,28 @@ protected function getFirebaseTokenV6($shopUuid)
$shopUuid
)->token;
}

/**
* @return bool
*/
protected function needMigration()
{
return $this->configurationRepository->getShopUuid() &&
version_compare($this->upgradeService->getRegisteredVersion(), '8', '<');
}

/**
* @return string
*/
protected function getFromVersion()
{
$fromVersion = $this->upgradeService->getRegisteredVersion();
$coreRegisteredVersion = $this->upgradeService->getCoreRegisteredVersion();

if (version_compare($coreRegisteredVersion, $fromVersion, '<')) {
$fromVersion = $coreRegisteredVersion;
}

return $fromVersion;
}
}
6 changes: 6 additions & 0 deletions src/Http/Controller/AbstractV2RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ abstract class AbstractV2RestController extends ModuleFrontController
*/
protected $authenticated = true;

/**
* Header to retrieve bearer from
* FIXME: "Authorization" standard header might be filtered by server configuration
*/
const HEADER_AUTHORIZATION = 'X-Prestashop-Authorization';

/**
* @var object
*/
Expand Down
Loading