Skip to content

Commit 4ff725e

Browse files
ACQE-8324: Using rest api update guest cart of configurable product
- Fixed soap api issue
1 parent 0f2f316 commit 4ff725e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartConfigurableItemRepositoryTest.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@
3131
*/
3232
class GuestCartConfigurableItemRepositoryTest extends WebapiAbstract
3333
{
34-
private const RESOURCE_PATH_ADMIN_TOKEN = "/V1/integration/admin/token";
3534

3635
private const RESOURCE_PATH_GUEST_CART = '/V1/guest-carts/';
3736

3837
private const SERVICE_VERSION_GUEST_CART = 'V1';
3938

4039
private const SERVICE_NAME_GUEST_CART = 'quoteGuestCartManagementV1';
4140

41+
private const SERVICE_NAME_GUEST_CART_ITEM = 'quoteGuestCartItemRepositoryV1';
42+
43+
private const SERVICE_VERSION_GUEST_CART_ITEM = 'V1';
44+
4245
/**
4346
* @var AdminTokenServiceInterface
4447
*/
@@ -115,7 +118,7 @@ private function createGuestCart(): string
115118
'soap' => [
116119
'service' => self::SERVICE_NAME_GUEST_CART,
117120
'serviceVersion' => self::SERVICE_VERSION_GUEST_CART,
118-
'operation' => self::SERVICE_NAME_GUEST_CART . 'Save',
121+
'operation' => self::SERVICE_NAME_GUEST_CART . 'CreateEmptyCart',
119122
],
120123
];
121124

@@ -297,15 +300,22 @@ private function getCartServiceInfo(
297300
$httpMethod = Request::HTTP_METHOD_GET;
298301
}
299302

303+
// Determine SOAP operation based on action
304+
$soapOperation = match ($action) {
305+
'get' => self::SERVICE_NAME_GUEST_CART_ITEM . 'GetList',
306+
'add', 'update' => self::SERVICE_NAME_GUEST_CART_ITEM . 'Save',
307+
default => self::SERVICE_NAME_GUEST_CART_ITEM . 'Save'
308+
};
309+
300310
return [
301311
'rest' => [
302312
'resourcePath' => $resourcePath,
303313
'httpMethod' => $httpMethod
304314
],
305315
'soap' => [
306-
'service' => self::SERVICE_NAME_GUEST_CART,
307-
'serviceVersion' => self::SERVICE_VERSION_GUEST_CART,
308-
'operation' => self::SERVICE_NAME_GUEST_CART . 'Save',
316+
'service' => self::SERVICE_NAME_GUEST_CART_ITEM,
317+
'serviceVersion' => self::SERVICE_VERSION_GUEST_CART_ITEM,
318+
'operation' => $soapOperation,
309319
],
310320
];
311321
}

0 commit comments

Comments
 (0)