Skip to content

Commit 0350a67

Browse files
committed
Merge branch 'ACP2E-2258' of https://github.com/magento-l3/magento2ce into PR-VK-2023-09-29
2 parents 76d6e58 + 2fd49da commit 0350a67

File tree

6 files changed

+258
-72
lines changed

6 files changed

+258
-72
lines changed

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
<item>6161 West Centinela Avenue</item>
382382
</array>
383383
<data key="city">Culver City</data>
384-
<data key="country_id">United States</data>
384+
<data key="country_id">US</data>
385385
<data key="country">United States</data>
386386
<data key="state">California</data>
387387
<data key="postcode">90230</data>

app/code/Magento/Fedex/Model/Carrier.php

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
2-
/************************************************************************
3-
*
4-
* ADOBE CONFIDENTIAL
5-
* ___________________
6-
*
7-
* Copyright 2014 Adobe
2+
/**
3+
* Copyright 2023 Adobe
84
* All Rights Reserved.
95
*
6+
* ADOBE CONFIDENTIAL
7+
*
108
* NOTICE: All information contained herein is, and remains
119
* the property of Adobe and its suppliers, if any. The intellectual
1210
* and technical concepts contained herein are proprietary to Adobe
@@ -15,7 +13,6 @@
1513
* Dissemination of this information or reproduction of this material
1614
* is strictly forbidden unless prior written permission is obtained
1715
* from Adobe.
18-
* ************************************************************************
1916
*/
2017

2118
namespace Magento\Fedex\Model;
@@ -30,6 +27,7 @@
3027
use Magento\Framework\Url\DecoderInterface;
3128
use Magento\Framework\Xml\Security;
3229
use Magento\Quote\Model\Quote\Address\RateRequest;
30+
use Magento\Sales\Model\Order;
3331
use Magento\Shipping\Model\Carrier\AbstractCarrier;
3432
use Magento\Shipping\Model\Carrier\AbstractCarrierOnline;
3533
use Magento\Shipping\Model\Rate\Result;
@@ -1174,15 +1172,16 @@ protected function _formShipmentRequest(\Magento\Framework\DataObject $request)
11741172
$countriesOfManufacture = [];
11751173
$productIds = [];
11761174
$packageItems = $request->getPackageItems();
1177-
foreach ($packageItems as $itemShipment) {
1178-
$item = new \Magento\Framework\DataObject();
1179-
$item->setData($itemShipment);
1180-
1181-
$unitPrice += $item->getPrice();
1182-
$itemsQty += $item->getQty();
1183-
1184-
$itemsDesc[] = $item->getName();
1185-
$productIds[] = $item->getProductId();
1175+
/** @var Order $order */
1176+
$order = $request->getOrderShipment()->getOrder();
1177+
foreach ($packageItems as $orderItemId => $itemShipment) {
1178+
if ($item = $order->getItemById($orderItemId)) {
1179+
$unitPrice += $item->getPrice();
1180+
$itemsQty += $itemShipment['qty'];
1181+
1182+
$itemsDesc[] = $item->getName();
1183+
$productIds[] = $item->getProductId();
1184+
}
11861185
}
11871186

11881187
// get countries of manufacture
@@ -1343,7 +1342,6 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request): \
13431342
{
13441343
$this->_prepareShipmentRequest($request);
13451344
$result = new \Magento\Framework\DataObject();
1346-
$response = null;
13471345
$accessToken = $this->_getAccessToken();
13481346
if (empty($accessToken)) {
13491347
return $result->setErrors(__('Authorization Error. No Access Token found with given credentials.'));
@@ -1380,7 +1378,7 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request): \
13801378
$debugData['result']['error'] = $response['errors']['message'] . ' ';
13811379
}
13821380

1383-
$result->setErrors($debugData['result']['error']);
1381+
$result->setErrors($debugData['result']['error'] . $debugData['result']['code']);
13841382
}
13851383

13861384
$this->_debug($debugData);

app/code/Magento/Fedex/Test/Mftf/Data/FedExConfigData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,16 @@
4646
<data key="value">0</data>
4747
<data key="label">No</data>
4848
</entity>
49+
<entity name="AdminFedexAccount" type="fedex_config">
50+
<data key="path">carriers/fedex/account</data>
51+
</entity>
52+
<entity name="AdminFedexHubId" type="fedex_config">
53+
<data key="path">carriers/fedex/smartpost_hubid</data>
54+
</entity>
55+
<entity name="AdminFedexApiKey" type="fedex_config">
56+
<data key="path">carriers/fedex/api_key</data>
57+
</entity>
58+
<entity name="AdminFedexSecretKey" type="fedex_config">
59+
<data key="path">carriers/fedex/secret_key</data>
60+
</entity>
4961
</entities>

app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
<testCaseId value="MC-20287"/>
1919
<useCaseId value="MC-18215"/>
2020
<group value="shipping"/>
21-
<skip>
22-
<issueId value="MQE-1578"/>
23-
</skip>
2421
<group value="pr_exclude"/>
2522
</annotations>
2623
<before>
@@ -35,22 +32,27 @@
3532
<magentoCLI command="config:set {{AdminFedexEnableSandboxModeConfigData.path}} {{AdminFedexEnableSandboxModeConfigData.value}}" stepKey="enableSandbox"/>
3633
<magentoCLI command="config:set {{AdminFedexEnableDebugConfigData.path}} {{AdminFedexEnableDebugConfigData.value}}" stepKey="enableDebug"/>
3734
<magentoCLI command="config:set {{AdminFedexEnableShowMethodConfigData.path}} {{AdminFedexEnableShowMethodConfigData.value}}" stepKey="enableShowMethod"/>
38-
<!--TODO: add fedex credentials-->
35+
<magentoCLI command="config:set {{AdminFedexAccount.path}} {{_CREDS.carriers_fedex_account}}" stepKey="accountSetting"/>
36+
<magentoCLI command="config:set {{AdminFedexHubId.path}} {{_CREDS.carriers_fedex_smartpost_hubid}}" stepKey="accountHub"/>
37+
<magentoCLI command="config:set {{AdminFedexApiKey.path}} {{_CREDS.carriers_fedex_api_key}}" stepKey="accountApiKey"/>
38+
<magentoCLI command="config:set {{AdminFedexSecretKey.path}} {{_CREDS.carriers_fedex_secret_key}}" stepKey="accountSecretKey"/>
39+
3940
<!--Set StoreInformation configs data-->
4041
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{AdminGeneralSetStoreNameConfigData.value}}'" stepKey="setStoreInformationName"/>
41-
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.telephone}}" stepKey="setStoreInformationPhone"/>
42-
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setStoreInformationCountry"/>
43-
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setStoreInformationCity"/>
44-
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setStoreInformationPostcode"/>
45-
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setStoreInformationStreetAddress"/>
42+
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} {{US_Address_California.telephone}}" stepKey="setStoreInformationPhone"/>
43+
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} {{US_Address_California.country_id}}" stepKey="setStoreInformationCountry"/>
44+
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} '{{US_Address_California.city}}'" stepKey="setStoreInformationCity"/>
45+
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} {{US_Address_California.postcode}}" stepKey="setStoreInformationPostcode"/>
46+
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setStoreInformationStreetAddress"/>
4647
<magentoCLI command="config:set {{AdminGeneralSetStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setStoreInformationStreetAddress2"/>
4748
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} {{AdminGeneralSetVatNumberConfigData.value}}" stepKey="setStoreInformationVatNumber"/>
49+
4850
<!--Set Shipping settings origin data-->
49-
<magentoCLI command="config:set {{AdminShippingSettingsOriginCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setOriginCountry"/>
50-
<magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setOriginCity"/>
51-
<magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setOriginZipCode"/>
52-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setOriginStreetAddress"/>
53-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setOriginStreetAddress2"/>
51+
<magentoCLI command="config:set {{AdminShippingSettingsOriginCountryConfigData.path}} {{US_Address_AE.country_id}}" stepKey="setOriginCountry"/>
52+
<magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} '{{US_Address_AE.city}}'" stepKey="setOriginCity"/>
53+
<magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} {{US_Address_AE.postcode}}" stepKey="setOriginZipCode"/>
54+
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} '{{US_Address_AE.street[0]}}'" stepKey="setOriginStreetAddress"/>
55+
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} '{{US_Address_AE.street[0]}}'" stepKey="setOriginStreetAddress2"/>
5456
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
5557
<argument name="indices" value=""/>
5658
</actionGroup>
@@ -73,6 +75,10 @@
7375
<magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} ''" stepKey="setOriginZipCode"/>
7476
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} ''" stepKey="setOriginStreetAddress"/>
7577
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} ''" stepKey="setOriginStreetAddress2"/>
78+
<magentoCLI command="config:set {{AdminFedexAccount.path}} ''" stepKey="accountSetting"/>
79+
<magentoCLI command="config:set {{AdminFedexHubId.path}} ''" stepKey="accountHub"/>
80+
<magentoCLI command="config:set {{AdminFedexApiKey.path}} ''" stepKey="accountApiKey"/>
81+
<magentoCLI command="config:set {{AdminFedexSecretKey.path}} ''" stepKey="accountSecretKey"/>
7682
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
7783
<argument name="indices" value=""/>
7884
</actionGroup>

0 commit comments

Comments
 (0)