Skip to content

Commit 045729f

Browse files
jczhuoMetasol-loup
andauthored
Pipe version to repair cpi (#688)
* Piping magento extension version to repair CPI endpoint * Pipe extension version into the repair endpoint * Switch to use systemConfig->getModuleVersion() * Cleanup import * Fix the committed files with updated linters --------- Co-authored-by: Paul Kang <[email protected]>
1 parent 5b1cd92 commit 045729f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,21 +1077,24 @@ public function getGraphApiVersion(): string
10771077
* @param string $customToken
10781078
* @param string $accessToken
10791079
* @param string $seller_platform_type
1080+
* @param string $extensionVersion
10801081
* @throws GuzzleException
10811082
*/
10821083
public function repairCommercePartnerIntegration(
10831084
$externalBusinessId,
10841085
$shopDomain,
10851086
$customToken,
10861087
$accessToken,
1087-
$seller_platform_type
1088+
$seller_platform_type,
1089+
$extensionVersion
10881090
) {
10891091
$request = [
10901092
'access_token' => $accessToken,
10911093
'fbe_external_business_id' => $externalBusinessId,
10921094
'custom_token' => $customToken,
10931095
'shop_domain' => $shopDomain,
1094-
'commerce_partner_seller_platform_type' => $seller_platform_type
1096+
'commerce_partner_seller_platform_type' => $seller_platform_type,
1097+
'extension_version' => $extensionVersion
10951098
];
10961099
$response = $this->callApi('POST', "commerce_partner_integrations_repair", $request);
10971100
return json_decode($response->getBody()->__toString(), true);

app/code/Meta/BusinessExtension/Model/MBEInstalls.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,15 @@ public function repairCommercePartnerIntegration($storeId): bool
342342
$customToken = $this->apiKeyService->getCustomApiKey();
343343
$domain = $this->storeManager->getStore($storeId)->getBaseUrl();
344344
$seller_platform_type = $this->adobeConfig->getCommercePartnerSellerPlatformType();
345+
$extensionVersion = $this->systemConfig->getModuleVersion();
345346

346347
$response = $this->graphApiAdapter->repairCommercePartnerIntegration(
347348
$externalBusinessId,
348349
$domain,
349350
$customToken,
350351
$accessToken,
351-
$seller_platform_type
352+
$seller_platform_type,
353+
$extensionVersion
352354
);
353355
if ($response['success'] === true) {
354356
$integrationId = $response['id'];

0 commit comments

Comments
 (0)