Skip to content

Commit d25b2bf

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop-pr20
2 parents 0235fbe + ab188bc commit d25b2bf

File tree

42 files changed

+1726
-3177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1726
-3177
lines changed

app/code/Magento/Config/Console/Command/ConfigSet/DefaultProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public function process($path, $value, $scope, $scopeCode)
9090
}
9191

9292
try {
93-
$config = $this->configFactory->create([
93+
$config = $this->configFactory->create(['data' => [
9494
'scope' => $scope,
9595
'scope_code' => $scopeCode,
96-
]);
96+
]]);
9797
$config->setDataByPath($path, $value);
9898
$config->save();
9999
} catch (\Exception $exception) {

app/code/Magento/Config/Test/Unit/Console/Command/ConfigSet/DefaultProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testProcess($path, $value, $scope, $scopeCode)
103103
$config = $this->createMock(Config::class);
104104
$this->configFactory->expects($this->once())
105105
->method('create')
106-
->with(['scope' => $scope, 'scope_code' => $scopeCode])
106+
->with(['data' => ['scope' => $scope, 'scope_code' => $scopeCode]])
107107
->willReturn($config);
108108
$config->expects($this->once())
109109
->method('setDataByPath')

app/code/Magento/ImportExport/Model/Import.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ class Import extends \Magento\ImportExport\Model\AbstractModel
126126
*/
127127
protected $_importExportData = null;
128128

129+
/**
130+
* @var \Magento\Framework\App\Config\ScopeConfigInterface
131+
*/
132+
private $_coreConfig;
133+
129134
/**
130135
* @var \Magento\ImportExport\Model\Import\ConfigInterface
131136
*/

app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
9-
<group id="paypal_payflowpro_with_express_checkout" translate="label comment" extends="payment_all_paypal/paypal_payflowpro">
9+
<group id="paypal_payflowpro_with_express_checkout" translate="label" extends="payment_all_paypal/paypal_payflowpro">
1010
<label>Payflow Pro</label>
1111
<attribute type="paypal_ec_separate">0</attribute>
1212
<group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10">
@@ -30,7 +30,7 @@
3030
<field id="enable_paypal_payflow"/>
3131
</requires>
3232
</field>
33-
<field id="enable_express_checkout_bml_payflow" translate="label" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
33+
<field id="enable_express_checkout_bml_payflow" translate="label comment" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
3434
<label>Enable PayPal Credit</label>
3535
<comment><![CDATA[PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
3636
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.

app/code/Magento/Paypal/i18n/en_US.csv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ User,User
697697
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
698698
or more. <a href=""https://financing.paypal.com/ppfinportal/content/forrester"" target=""_blank"">See Details</a>.
699699
"
700+
"PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
701+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
702+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>","PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
703+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
704+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>"
700705
"Customize Smart Buttons","Customize Smart Buttons"
701706
"Checkout Page","Checkout Page"
702707
"Label","Label"
@@ -731,4 +736,4 @@ User,User
731736
"PayPal will automatically display each enabled funding option to eligible buyers. For example, PayPal Credit is only shown to buyers in countries where PayPal Credit is offered and the currency offered by the merchant is USD.","PayPal will automatically display each enabled funding option to eligible buyers. For example, PayPal Credit is only shown to buyers in countries where PayPal Credit is offered and the currency offered by the merchant is USD."
732737
"PayPal Credit","PayPal Credit"
733738
"PayPal Guest Checkout Credit Card Icons","PayPal Guest Checkout Credit Card Icons"
734-
"Elektronisches Lastschriftverfahren - German ELV","Elektronisches Lastschriftverfahren - German ELV"
739+
"Elektronisches Lastschriftverfahren - German ELV","Elektronisches Lastschriftverfahren - German ELV"

app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Quote\Api\CartRepositoryInterface;
1414
use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface;
1515
use Magento\Quote\Model\Quote;
16+
use Magento\Store\Model\StoreManagerInterface;
1617

1718
/**
1819
* Get cart
@@ -29,16 +30,24 @@ class GetCartForUser
2930
*/
3031
private $cartRepository;
3132

33+
/**
34+
* @var StoreManagerInterface
35+
*/
36+
private $storeManager;
37+
3238
/**
3339
* @param MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId
3440
* @param CartRepositoryInterface $cartRepository
41+
* @param StoreManagerInterface $storeManager
3542
*/
3643
public function __construct(
3744
MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId,
38-
CartRepositoryInterface $cartRepository
45+
CartRepositoryInterface $cartRepository,
46+
StoreManagerInterface $storeManager
3947
) {
4048
$this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId;
4149
$this->cartRepository = $cartRepository;
50+
$this->storeManager = $storeManager;
4251
}
4352

4453
/**
@@ -75,6 +84,15 @@ public function execute(string $cartHash, ?int $customerId): Quote
7584
);
7685
}
7786

87+
if ((int)$cart->getStoreId() !== (int)$this->storeManager->getStore()->getId()) {
88+
throw new GraphQlNoSuchEntityException(
89+
__(
90+
'Wrong store code specified for cart "%masked_cart_id"',
91+
['masked_cart_id' => $cartHash]
92+
)
93+
);
94+
}
95+
7896
$cartCustomerId = (int)$cart->getCustomerId();
7997

8098
/* Guest cart, allow operations */

app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\QuoteGraphQl\Model\Cart;
99

10+
use Magento\Customer\Helper\Address as AddressHelper;
1011
use Magento\CustomerGraphQl\Model\Customer\Address\GetCustomerAddress;
1112
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
@@ -30,28 +31,44 @@ class QuoteAddressFactory
3031
*/
3132
private $getCustomerAddress;
3233

34+
/**
35+
* @var AddressHelper
36+
*/
37+
private $addressHelper;
38+
3339
/**
3440
* @param BaseQuoteAddressFactory $quoteAddressFactory
3541
* @param GetCustomerAddress $getCustomerAddress
42+
* @param AddressHelper $addressHelper
3643
*/
3744
public function __construct(
3845
BaseQuoteAddressFactory $quoteAddressFactory,
39-
GetCustomerAddress $getCustomerAddress
46+
GetCustomerAddress $getCustomerAddress,
47+
AddressHelper $addressHelper
4048
) {
4149
$this->quoteAddressFactory = $quoteAddressFactory;
4250
$this->getCustomerAddress = $getCustomerAddress;
51+
$this->addressHelper = $addressHelper;
4352
}
4453

4554
/**
4655
* Create QuoteAddress based on input data
4756
*
4857
* @param array $addressInput
4958
* @return QuoteAddress
59+
* @throws GraphQlInputException
5060
*/
5161
public function createBasedOnInputData(array $addressInput): QuoteAddress
5262
{
5363
$addressInput['country_id'] = $addressInput['country_code'] ?? '';
5464

65+
$maxAllowedLineCount = $this->addressHelper->getStreetLines();
66+
if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) {
67+
throw new GraphQlInputException(
68+
__('"Street Address" cannot contain more than %1 lines.', $maxAllowedLineCount)
69+
);
70+
}
71+
5572
$quoteAddress = $this->quoteAddressFactory->create();
5673
$quoteAddress->addData($addressInput);
5774
return $quoteAddress;

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<test name="AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest">
1111
<annotations>
1212
<stories value="Update URL rewrite"/>
13-
<title value="Update Category URL Rewrites, no redirect type"/>
13+
<title value="Update Category URL Rewrites, Temporary redirect type"/>
1414
<description value="Login as Admin and update category UrlRewrite and add Temporary redirect type"/>
1515
<testCaseId value="MC-5356"/>
1616
<severity value="CRITICAL"/>

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\TestFramework\TestCase\GraphQlAbstract;
1414
use Magento\Integration\Api\CustomerTokenServiceInterface;
1515

16+
/**
17+
* Create customer address tests
18+
*/
1619
class CreateCustomerAddressTest extends GraphQlAbstract
1720
{
1821
/**
@@ -198,6 +201,72 @@ public function testCreateCustomerAddressWithMissingAttribute()
198201
$this->graphQlQuery($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
199202
}
200203

204+
/**
205+
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
206+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
207+
*/
208+
public function testCreateCustomerAddressWithRedundantStreetLine()
209+
{
210+
$newAddress = [
211+
'region' => [
212+
'region' => 'Arizona',
213+
'region_id' => 4,
214+
'region_code' => 'AZ'
215+
],
216+
'country_id' => 'US',
217+
'street' => ['Line 1 Street', 'Line 2', 'Line 3'],
218+
'company' => 'Company name',
219+
'telephone' => '123456789',
220+
'fax' => '123123123',
221+
'postcode' => '7777',
222+
'city' => 'City Name',
223+
'firstname' => 'Adam',
224+
'lastname' => 'Phillis',
225+
'middlename' => 'A',
226+
'prefix' => 'Mr.',
227+
'suffix' => 'Jr.',
228+
'vat_id' => '1',
229+
'default_shipping' => true,
230+
'default_billing' => false
231+
];
232+
233+
$mutation
234+
= <<<MUTATION
235+
mutation {
236+
createCustomerAddress(input: {
237+
region: {
238+
region: "{$newAddress['region']['region']}"
239+
region_id: {$newAddress['region']['region_id']}
240+
region_code: "{$newAddress['region']['region_code']}"
241+
}
242+
country_id: {$newAddress['country_id']}
243+
street: ["{$newAddress['street'][0]}","{$newAddress['street'][1]}","{$newAddress['street'][2]}"]
244+
company: "{$newAddress['company']}"
245+
telephone: "{$newAddress['telephone']}"
246+
fax: "{$newAddress['fax']}"
247+
postcode: "{$newAddress['postcode']}"
248+
city: "{$newAddress['city']}"
249+
firstname: "{$newAddress['firstname']}"
250+
lastname: "{$newAddress['lastname']}"
251+
middlename: "{$newAddress['middlename']}"
252+
prefix: "{$newAddress['prefix']}"
253+
suffix: "{$newAddress['suffix']}"
254+
vat_id: "{$newAddress['vat_id']}"
255+
default_shipping: true
256+
default_billing: false
257+
}) {
258+
id
259+
}
260+
}
261+
MUTATION;
262+
263+
$userName = 'customer@example.com';
264+
$password = 'password';
265+
266+
self::expectExceptionMessage('"Street Address" cannot contain more than 2 lines.');
267+
$this->graphQlQuery($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
268+
}
269+
201270
/**
202271
* Verify the fields for Customer address
203272
*

0 commit comments

Comments
 (0)