Skip to content

Commit 74c533f

Browse files
author
Oleksandr Iegorov
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-93047-2
2 parents 60dcd51 + 19bec6f commit 74c533f

File tree

32 files changed

+541
-65
lines changed

32 files changed

+541
-65
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Technical issue with the Magento 2 core components
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Preconditions
12+
<!---
13+
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
14+
-->
15+
1.
16+
2.
17+
18+
### Steps to reproduce
19+
<!---
20+
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
21+
-->
22+
1.
23+
2.
24+
25+
### Expected result
26+
<!--- Tell us what do you expect to happen. -->
27+
1. [Screenshots, logs or description]
28+
2.
29+
30+
### Actual result
31+
<!--- Tell us what happened instead. Include error messages and issues. -->
32+
1. [Screenshots, logs or description]
33+
2.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Developer experience issue
3+
about: Issues related to customization, extensibility, modularity
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Summary
12+
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
13+
14+
### Examples
15+
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
16+
17+
### Proposed solution
18+
<!--- Suggest your potential solutions for this issue. -->
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Please consider reporting directly to https://github.com/magento/community-features
4+
5+
---
6+
7+
<!---
8+
Important: This repository is intended only for Magento 2 Technical Issues. Enter Feature Requests at https://github.com/magento/community-features. Project stakeholders monitor and manage requests. Feature requests entered using this form may be moved to the forum.
9+
-->
10+
11+
### Description
12+
<!--- Describe the feature you would like to add. -->
13+
14+
### Expected behavior
15+
<!--- What is the expected behavior of this feature? How is it going to work? -->
16+
17+
### Benefits
18+
<!--- How do you think this feature would improve Magento? -->
19+
20+
### Additional information
21+
<!--- What other information can you provide about the desired feature? -->
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOrderFillBraintreeCreditCardActionGroup">
11+
<arguments>
12+
<argument name="cardData" defaultValue="BraintreeCard"/>
13+
</arguments>
14+
<waitForLoadingMaskToDisappear stepKey="waitLoadingMaskDisappear"/>
15+
<conditionalClick selector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" dependentSelector="{{AdminOrderFormPaymentSection.braintreeCreditCardMethod}}" visible="true" stepKey="chooseBraintreeCreditCard"/>
16+
<waitForLoadingMaskToDisappear stepKey="waitLoadingMask"/>
17+
<selectOption selector="{{AdminOrderFormPaymentSection.braintreeCcType}}" userInput="{{cardData.cc_type}}" stepKey="fillCc"/>
18+
<!--Fill card number-->
19+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcFrame}}" stepKey="switchToCcIFrame"/>
20+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCardNumber}}" userInput="{{cardData.card_number}}" stepKey="fillCardNumber"/>
21+
<waitForPageLoad stepKey="waitForFillCardNumber" time="1"/>
22+
<switchToIFrame stepKey="switchToDefaultContext1"/>
23+
<!--Fill card expiration month-->
24+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpMonthFrame}}" stepKey="switchToCcExpMonthIFrame"/>
25+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpMonth}}" userInput="{{cardData.exp_month}}" stepKey="fillExpMonth"/>
26+
<waitForPageLoad stepKey="waitForFillCardExpMonth" time="1"/>
27+
<switchToIFrame stepKey="switchToDefaultContext2"/>
28+
<!--Fill card expiration year-->
29+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCcExpYear}}" stepKey="switchToCcExpYearIFrame"/>
30+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeExpYear}}" userInput="{{cardData.exp_year}}" stepKey="fillExpYear"/>
31+
<waitForPageLoad stepKey="waitForFillCardExpYear" time="1"/>
32+
<switchToIFrame stepKey="switchToDefaultContext3"/>
33+
<!--Fill card CVV-->
34+
<switchToIFrame selector="{{AdminOrderFormPaymentSection.braintreeCvvFrame}}" stepKey="switchToCvvIFrame"/>
35+
<fillField selector="{{AdminOrderFormPaymentSection.braintreeCvv}}" userInput="{{cardData.cvv}}" stepKey="fillCvv"/>
36+
<waitForPageLoad stepKey="waitForFillCardCvv" time="1"/>
37+
<switchToIFrame stepKey="switchToDefaultContext4"/>
38+
</actionGroup>
39+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@
4343
<requiredEntity type="merchant_id">DefaultMerchantId</requiredEntity>
4444
<requiredEntity type="public_key">DefaultPublicKey</requiredEntity>
4545
<requiredEntity type="private_key">DefaultPrivateKey</requiredEntity>
46+
<requiredEntity type="active">DefaultActive</requiredEntity>
47+
<requiredEntity type="merchant_account_id">DefaultMerchantAccountId</requiredEntity>
4648
</entity>
4749
<entity name="DefaultTitle" type="title">
4850
<data key="value"/>
4951
</entity>
5052
<entity name="DefaultPaymentAction" type="payment_action">
51-
<data key="value"/>
53+
<data key="value">authorize</data>
5254
</entity>
5355
<entity name="DefaultEnvironment" type="environment">
54-
<data key="value"/>
56+
<data key="value">sandbox</data>
5557
</entity>
5658
<entity name="DefaultMerchantId" type="merchant_id">
5759
<data key="value"/>
@@ -62,4 +64,54 @@
6264
<entity name="DefaultPrivateKey" type="private_key">
6365
<data key="value"/>
6466
</entity>
67+
<entity name="DefaultActive" type="active">
68+
<data key="value">0</data>
69+
</entity>
70+
<entity name="DefaultMerchantAccountId" type="merchant_account_id">
71+
<data key="value"/>
72+
</entity>
73+
74+
<entity name="SandboxBraintreeConfig" type="braintree_config_state">
75+
<requiredEntity type="title">EnabledTitle</requiredEntity>
76+
<requiredEntity type="payment_action">AuthorizePaymentAction</requiredEntity>
77+
<requiredEntity type="environment">SandboxEnvironment</requiredEntity>
78+
<requiredEntity type="merchant_id">EnabledMerchantId</requiredEntity>
79+
<requiredEntity type="public_key">EnabledPublicKey</requiredEntity>
80+
<requiredEntity type="private_key">EnabledPrivateKey</requiredEntity>
81+
<requiredEntity type="active">EnabledActive</requiredEntity>
82+
<requiredEntity type="merchant_account_id">EnabledMerchantAccountId</requiredEntity>
83+
</entity>
84+
<entity name="EnabledTitle" type="title">
85+
<data key="value">Credit Card (Braintree)</data>
86+
</entity>
87+
<entity name="AuthorizePaymentAction" type="payment_action">
88+
<data key="value">authorize</data>
89+
</entity>
90+
<entity name="SandboxEnvironment" type="environment">
91+
<data key="value">sandbox</data>
92+
</entity>
93+
<entity name="EnabledMerchantId" type="merchant_id">
94+
<data key="value">d4pdjhxgjfrsmzbf</data>
95+
</entity>
96+
<entity name="EnabledPublicKey" type="public_key">
97+
<data key="value">m7q4wmh43xrgyrst</data>
98+
</entity>
99+
<entity name="EnabledPrivateKey" type="private_key">
100+
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
101+
</entity>
102+
<entity name="EnabledActive" type="active">
103+
<data key="value">1</data>
104+
</entity>
105+
<entity name="EnabledMerchantAccountId" type="merchant_account_id">
106+
<data key="value">Magneto</data>
107+
</entity>
108+
109+
<entity name="BraintreeCard" type="creditCard">
110+
<data key="cc_type">MasterCard</data>
111+
<data key="card_number">5105105105105100</data>
112+
<data key="exp_month">12</data>
113+
<data key="exp_year">20</data>
114+
<data key="cvv">113</data>
115+
</entity>
116+
65117
</entities>

app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11-
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
11+
<operation name="CreateBraintreeConfigState" dataType="braintree_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" successRegex="/messages-message-success/" method="POST">
12+
<contentType>application/x-www-form-urlencoded</contentType>
1213
<object key="groups" dataType="braintree_config_state">
1314
<object key="braintree_section" dataType="braintree_config_state">
1415
<object key="groups" dataType="braintree_config_state">
@@ -36,6 +37,18 @@
3637
</object>
3738
</object>
3839
</object>
40+
<object key="braintree_advanced" dataType="braintree_config_state">
41+
<object key="fields" dataType="braintree_config_state">
42+
<object key="merchant_account_id" dataType="merchant_account_id">
43+
<field key="value">string</field>
44+
</object>
45+
</object>
46+
</object>
47+
</object>
48+
<object key="fields" dataType="braintree_config_state">
49+
<object key="active" dataType="active">
50+
<field key="value">integer</field>
51+
</object>
3952
</object>
4053
</object>
4154
</object>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormPaymentSection">
12+
<element name="braintreeCreditCardMethod" type="radio" selector="#p_method_braintree" timeout="10"/>
13+
<element name="braintreeCcType" type="select" selector="#braintree_cc_type"/>
14+
<element name="braintreeCardNumber" type="input" selector="#credit-card-number"/>
15+
<element name="braintreeExpMonth" type="input" selector="#expiration-month"/>
16+
<element name="braintreeExpYear" type="input" selector="#expiration-year"/>
17+
<element name="braintreeCvv" type="input" selector="#cvv"/>
18+
<element name="braintreeCcFrame" type="iframe" selector="braintree-hosted-field-number"/>
19+
<element name="braintreeCcExpMonthFrame" type="iframe" selector="braintree-hosted-field-expirationMonth"/>
20+
<element name="braintreeCcExpYear" type="iframe" selector="braintree-hosted-field-expirationYear"/>
21+
<element name="braintreeCvvFrame" type="iframe" selector="braintree-hosted-field-cvv"/>
22+
</section>
23+
</sections>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminCreateOrderUsingBraintreePaymentTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Creation an admin order using Braintree payment"/>
15+
<title value="Create order using Braintree payment"/>
16+
<description value="Admin should be able to create order using Braintree payment"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-94247"/>
19+
<group value="braintree"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="SandboxBraintreeConfig" stepKey="setupBraintree"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
<field key="price">100</field>
28+
</createData>
29+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
30+
<createData entity="restrictedWebUser" stepKey="createRestrictedAdmin"/>
31+
32+
<actionGroup ref="LoginToAdminActionGroup" stepKey="loginToBackend"/>
33+
<actionGroup ref="AdminCreateUserRoleActionGroup" stepKey="createRestrictedAdminRole">
34+
<argument name="roleName" value="{{RoleTest.roleName}}"/>
35+
<argument name="resourceAccess" value="Custom"/>
36+
<argument name="resource" value="Magento_Sales::sales"/>
37+
</actionGroup>
38+
<actionGroup ref="AdminAssignUserRoleActionGroup" stepKey="assignAdminRole">
39+
<argument name="user_restricted" value="$$createRestrictedAdmin$$"/>
40+
<argument name="roleName" value="{{RoleTest.roleName}}"/>
41+
</actionGroup>
42+
<actionGroup ref="logout" stepKey="logoutFromBackend"/>
43+
</before>
44+
45+
<after>
46+
<actionGroup ref="LoginToAdminActionGroup" stepKey="loginToBackendWithDefaultAdmin"/>
47+
<!--Remove created admin user-->
48+
<actionGroup ref="AdminDeleteUserActionGroup" stepKey="removeAdminUser">
49+
<argument name="user_restricted" value="$$createRestrictedAdmin$$"/>
50+
</actionGroup>
51+
<!--Remove created admin user role-->
52+
<actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="removeUserRole">
53+
<argument name="roleName" value="{{RoleTest.roleName}}"/>
54+
</actionGroup>
55+
<actionGroup ref="logout" stepKey="logoutDefaultAdminFromBackend"/>
56+
<createData entity="DefaultBraintreeConfig" stepKey="restoreBraintree"/>
57+
<deleteData createDataKey="createSimpleProduct" stepKey="removeSimpleProduct"/>
58+
<deleteData createDataKey="createCustomer" stepKey="removeCustomer"/>
59+
</after>
60+
<!--Login with restricted user-->
61+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="amOnAdminLoginPage"/>
62+
<waitForPageLoad stepKey="waitForLoginPageLoad"/>
63+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="$$createRestrictedAdmin.username$$" stepKey="fillUsername"/>
64+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="$$createRestrictedAdmin.password$$" stepKey="fillPassword"/>
65+
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickOnSignIn"/>
66+
<!--Navigate to orders page-->
67+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
68+
<waitForPageLoad time="30" stepKey="waitForIndexPageLoad"/>
69+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
70+
<!--Create new order-->
71+
<click selector="{{OrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
72+
<!--Choose customer-->
73+
<actionGroup ref="chooseOrderCustomer" stepKey="selectCustomer">
74+
<argument name="customer" value="$$createCustomer$$"/>
75+
</actionGroup>
76+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
77+
<!--Add product to order-->
78+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
79+
<argument name="product" value="$$createSimpleProduct$$"/>
80+
</actionGroup>
81+
<!--Select shipping-->
82+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/>
83+
<!--Fill payment method-->
84+
<actionGroup ref="AdminOrderFillBraintreeCreditCardActionGroup" stepKey="selectBraintreeCreditCard"/>
85+
<!--Submit Order and verify information-->
86+
<click selector="{{AdminOrderFormActionSection.submitOrder}}" stepKey="clickSubmitOrder"/>
87+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage"/>
88+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the order." stepKey="seeOrderSuccessMessage"/>
89+
<actionGroup ref="logout" stepKey="logoutRestrictedAdminFromBackend"/>
90+
</test>
91+
</tests>

app/code/Magento/Braintree/etc/acl.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
<resource id="Magento_Braintree::settlement_report" title="Braintree Settlement" translate="title" sortOrder="80" />
1515
</resource>
1616
</resource>
17+
<resource id="Magento_Sales::sales">
18+
<resource id="Magento_Sales::sales_operation">
19+
<resource id="Magento_Sales::sales_order">
20+
<resource id="Magento_Sales::actions">
21+
<resource id="Magento_Braintree::get_client_token" title="Get Client Token Braintree" sortOrder="170" />
22+
</resource>
23+
</resource>
24+
</resource>
25+
</resource>
1726
</resource>
1827
</resources>
1928
</acl>

app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,10 @@ public function getThumbnailUrl($filePath, $checkFile = false)
566566
* Create thumbnail for image and save it to thumbnails directory
567567
*
568568
* @param string $source Image path to be resized
569-
* @param bool $keepRation Keep aspect ratio or not
569+
* @param bool $keepRatio Keep aspect ratio or not
570570
* @return bool|string Resized filepath or false if errors were occurred
571571
*/
572-
public function resizeFile($source, $keepRation = true)
572+
public function resizeFile($source, $keepRatio = true)
573573
{
574574
$realPath = $this->_directory->getRelativePath($source);
575575
if (!$this->_directory->isFile($realPath) || !$this->_directory->isExist($realPath)) {
@@ -586,7 +586,7 @@ public function resizeFile($source, $keepRation = true)
586586
}
587587
$image = $this->_imageFactory->create();
588588
$image->open($source);
589-
$image->keepAspectRatio($keepRation);
589+
$image->keepAspectRatio($keepRatio);
590590
$image->resize($this->_resizeParameters['width'], $this->_resizeParameters['height']);
591591
$dest = $targetDir . '/' . pathinfo($source, PATHINFO_BASENAME);
592592
$image->save($dest);

0 commit comments

Comments
 (0)