Skip to content

Commit 6a8a6a0

Browse files
authored
Merge pull request #3514 from magento-epam/EPAM-PR-21
Fixed issues: MAGETWO-91526 [2.3] Authorize.net Direct Post does not show credit card information MAGETWO-91769 Credit Memo - Wrong tax calculation! #10982 MAGETWO-91639 Tax is added despite customer group changes
2 parents f77f96b + 637dc2a commit 6a8a6a0

34 files changed

+749
-15
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Authorizenet\Block\Adminhtml\Order\View\Info;
9+
10+
use Magento\Framework\Phrase;
11+
use Magento\Payment\Block\ConfigurableInfo;
12+
13+
/**
14+
* Payment information block for Authorize.net payment method
15+
*/
16+
class PaymentDetails extends ConfigurableInfo
17+
{
18+
/**
19+
* Returns localized label for payment info block
20+
*
21+
* @param string $field
22+
* @return string | Phrase
23+
*/
24+
protected function getLabel($field)
25+
{
26+
return __($field);
27+
}
28+
}

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
2727
/**
2828
* @var string
2929
*/
30-
protected $_infoBlockType = \Magento\Payment\Block\Info::class;
30+
protected $_infoBlockType = \Magento\Authorizenet\Block\Adminhtml\Order\View\Info\PaymentDetails::class;
3131

3232
/**
3333
* Payment Method feature
@@ -371,8 +371,7 @@ public function void(\Magento\Payment\Model\InfoInterface $payment)
371371
}
372372

373373
/**
374-
* Refund the amount
375-
* Need to decode last 4 digits for request.
374+
* Refund the amount need to decode last 4 digits for request.
376375
*
377376
* @param \Magento\Framework\DataObject|\Magento\Payment\Model\InfoInterface $payment
378377
* @param float $amount
@@ -626,6 +625,14 @@ protected function fillPaymentByResponse(\Magento\Framework\DataObject $payment)
626625
$payment->setIsTransactionPending(true)
627626
->setIsFraudDetected(true);
628627
}
628+
629+
$additionalInformationKeys = explode(',', $this->getValue('paymentInfoKeys'));
630+
foreach ($additionalInformationKeys as $paymentInfoKey) {
631+
$paymentInfoValue = $response->getDataByKey($paymentInfoKey);
632+
if ($paymentInfoValue !== null) {
633+
$payment->setAdditionalInformation($paymentInfoKey, $paymentInfoValue);
634+
}
635+
}
629636
}
630637

631638
/**
@@ -682,6 +689,7 @@ protected function matchAmount($amount)
682689

683690
/**
684691
* Operate with order using information from Authorize.net.
692+
*
685693
* Authorize order or authorize and capture it.
686694
*
687695
* @param \Magento\Sales\Model\Order $order
@@ -858,7 +866,7 @@ public function getConfigInterface()
858866
* Getter for specified value according to set payment method code
859867
*
860868
* @param mixed $key
861-
* @param null $storeId
869+
* @param int|string|null|\Magento\Store\Model\Store $storeId
862870
* @return mixed
863871
*/
864872
public function getValue($key, $storeId = null)
@@ -918,10 +926,12 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
918926
$payment->setIsTransactionDenied(true);
919927
}
920928
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
921-
return [];
929+
return $response->getData();
922930
}
923931

924932
/**
933+
* Add statuc comment on update.
934+
*
925935
* @param \Magento\Sales\Model\Order\Payment $payment
926936
* @param \Magento\Framework\DataObject $response
927937
* @param string $transactionId
@@ -996,8 +1006,9 @@ protected function getTransactionResponse($transactionId)
9961006
}
9971007

9981008
/**
999-
* @return \Psr\Log\LoggerInterface
1009+
* Get psr logger.
10001010
*
1011+
* @return \Psr\Log\LoggerInterface
10011012
* @deprecated 100.1.0
10021013
*/
10031014
private function getPsrLogger()
@@ -1038,7 +1049,9 @@ private function getOrderIncrementId(): string
10381049
}
10391050

10401051
/**
1041-
* Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
1052+
* Checks if filter action is Report Only.
1053+
*
1054+
* Transactions that trigger this filter are processed as normal,
10421055
* but are also reported in the Merchant Interface as triggering this filter.
10431056
*
10441057
* @param string $fdsFilterAction

app/code/Magento/Authorizenet/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<cgi_url>https://secure.authorize.net/gateway/transact.dll</cgi_url>
3333
<cgi_url_td_test_mode>https://apitest.authorize.net/xml/v1/request.api</cgi_url_td_test_mode>
3434
<cgi_url_td>https://api2.authorize.net/xml/v1/request.api</cgi_url_td>
35+
<paymentInfoKeys>x_card_type,x_account_number,x_avs_code,x_auth_code,x_response_reason_text,x_cvv2_resp_code</paymentInfoKeys>
3536
</authorizenet_directpost>
3637
</payment>
3738
</default>

app/code/Magento/Authorizenet/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
</argument>
3636
</arguments>
3737
</type>
38+
<type name="Magento\Authorizenet\Block\Adminhtml\Order\View\Info\PaymentDetails">
39+
<arguments>
40+
<argument name="config" xsi:type="object">Magento\Authorizenet\Model\Directpost</argument>
41+
</arguments>
42+
</type>
3843
</config>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,9 @@ Debug,Debug
6767
"Minimum Order Total","Minimum Order Total"
6868
"Maximum Order Total","Maximum Order Total"
6969
"Sort Order","Sort Order"
70+
"x_card_type","Credit Card Type"
71+
"x_account_number", "Credit Card Number"
72+
"x_avs_code","AVS Response Code"
73+
"x_auth_code","Processor Authentication Code"
74+
"x_response_reason_text","Processor Response Text"
75+
"x_cvv2_resp_code","CVV2 Response Code"

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>
1616
<element name="changeStoreButton" type="button" selector="#store-change-button" timeout="10"/>
1717
<element name="selectStoreView" type="button" selector="//ul[@data-role='stores-list']/li/a[normalize-space(.)='{{var1}}']" timeout="10" parameterized="true"/>
18+
<element name="selectTaxClass" type="select" selector="select[name='product[tax_class_id]']"/>
1819
<element name="saveAndDuplicate" type="button" selector="span[id='save_and_duplicate']" timeout="30"/>
1920
</section>
2021
</sections>

app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112

113113
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
114114
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
115+
<!-- Reset admin order filter -->
116+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
117+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/>
115118
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/>
116119
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
117120
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SetGroupForValidVATIdIntraUnionActionGroup">
12+
<arguments>
13+
<argument name="value" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminStoresCustomerConfigurationPage.url}}" stepKey="navigateToCustomerConfigurationPage" />
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<conditionalClick stepKey="expandCreateNewAccountOptionsTab" selector="{{AdminStoresCustomerConfigurationSection.createNewAccOpt}}" dependentSelector="{{AdminStoresCustomerConfigurationSection.enableAutoAssignCustomerGroup}}" visible="false"/>
18+
<waitForElementVisible selector="{{AdminStoresCustomerConfigurationSection.createNewAccOpt}}" stepKey="waitForElementsAppeared"/>
19+
<selectOption selector="{{AdminStoresCustomerConfigurationSection.groupForValidVATIdIntraUnion}}" userInput="{{value}}" stepKey="selectValue"/>
20+
<click selector="{{AdminStoresCustomerConfigurationSection.createNewAccOpt}}" stepKey="collapseTab" />
21+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/>
22+
<waitForPageLoad stepKey="waitForConfigSaved"/>
23+
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
9+
<page name="AdminStoresCustomerConfigurationPage" url="admin/system_config/edit/section/customer/" area="admin" module="Magento_Config">
10+
<section name="AdminStoresCustomerConfigurationSection"/>
11+
</page>
12+
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminStoresCustomerConfigurationSection">
10+
<element name="createNewAccOpt" type="button" selector="#customer_create_account-head"/>
11+
<element name="enableAutoAssignCustomerGroup" type="button" selector="#customer_create_account_auto_group_assign"/>
12+
<element name="groupForValidVATIdIntraUnion" type="select" selector="#customer_create_account_viv_intra_union_group"/>
13+
</section>
14+
</sections>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCreateCustomerGroupActionGroup">
11+
<arguments>
12+
<argument name="groupName" type="string"/>
13+
<argument name="taxClass" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminNewCustomerGroupPage.url}}" stepKey="goToNewCustomerGroupPage"/>
16+
<waitForPageLoad stepKey="waitForNewCustomerGroupPageLoad"/>
17+
18+
<!--Set tax class for customer group-->
19+
<fillField stepKey="fillGroupName" selector="{{AdminNewCustomerGroupSection.groupName}}" userInput="{{groupName}}"/>
20+
<selectOption selector="{{AdminNewCustomerGroupSection.taxClass}}" userInput="{{taxClass}}" stepKey="selectTaxClassOption"/>
21+
<click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup"/>
22+
<waitForPageLoad stepKey="waitForCustomerGroupSaved"/>
23+
<see stepKey="seeCustomerGroupSaveMessage" userInput="You saved the customer group."/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups 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/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminDeleteCustomerGroupActionGroup">
1212
<arguments>
1313
<argument name="customerGroupName" type="string"/>

app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,9 @@
4646

4747
<click stepKey="saveAddress" selector="{{StorefrontCustomerAddressSection.saveAddress}}"/>
4848
</actionGroup>
49+
50+
<actionGroup name="SignUpNewCustomerStorefrontActionGroup" extends="SignUpNewUserFromStorefrontActionGroup">
51+
<waitForPageLoad stepKey="waitForRegistered" after="clickCreateAccountButton"/>
52+
<remove keyForRemoval="seeThankYouMessage" after="waitForRegistered"/>
53+
</actionGroup>
4954
</actionGroups>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,11 @@
108108
<data key="country_id">GB</data>
109109
<data key="telephone">444-44-444-44</data>
110110
</entity>
111+
<entity name="UK_Simple_Address" extends="UK_Not_Default_Address">
112+
<array key="street">
113+
<item>172, Westminster Bridge Rd</item>
114+
<item>7700 xyz street</item>
115+
</array>
116+
<data key="state">California</data>
117+
</entity>
111118
</entities>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SetCustomerCreateNewAccountOptionsConfig" type="customer_create_new_account_config">
12+
<requiredEntity type="auto_group_assign">EnableAutomaticAssignmentCustomerGroup</requiredEntity>
13+
<requiredEntity type="viv_on_each_transaction">EnableValidateEachTransaction</requiredEntity>
14+
<requiredEntity type="vat_frontend_visibility">EnableShowVATNumberStorefront</requiredEntity>
15+
</entity>
16+
<entity name="EnableAutomaticAssignmentCustomerGroup" type="auto_group_assign">
17+
<data key="value">1</data>
18+
</entity>
19+
<entity name="EnableValidateEachTransaction" type="viv_on_each_transaction">
20+
<data key="value">1</data>
21+
</entity>
22+
<entity name="EnableShowVATNumberStorefront" type="vat_frontend_visibility">
23+
<data key="value">1</data>
24+
</entity>
25+
26+
<entity name="SetCustomerCreateNewAccountOptionsDefaultConfig" type="customer_create_new_account_config">
27+
<requiredEntity type="auto_group_assign">DefaultAutomaticAssignmentCustomerGroup</requiredEntity>
28+
<requiredEntity type="viv_on_each_transaction">DefaultValidateEachTransaction</requiredEntity>
29+
<requiredEntity type="vat_frontend_visibility">DefaultShowVATNumberStorefront</requiredEntity>
30+
</entity>
31+
<entity name="DefaultAutomaticAssignmentCustomerGroup" type="auto_group_assign">
32+
<data key="value">0</data>
33+
</entity>
34+
<entity name="DefaultValidateEachTransaction" type="viv_on_each_transaction">
35+
<data key="value">0</data>
36+
</entity>
37+
<entity name="DefaultShowVATNumberStorefront" type="vat_frontend_visibility">
38+
<data key="value">0</data>
39+
</entity>
40+
</entities>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CustomerCreateNewAccountOptionsConfigState" dataType="customer_create_new_account_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/customer/" method="POST">
12+
<object key="groups" dataType="customer_create_new_account_config">
13+
<object key="create_account" dataType="customer_create_new_account_config">
14+
<object key="fields" dataType="customer_create_new_account_config">
15+
<object key="auto_group_assign" dataType="auto_group_assign">
16+
<field key="value">string</field>
17+
</object>
18+
<object key="viv_on_each_transaction" dataType="viv_on_each_transaction">
19+
<field key="value">string</field>
20+
</object>
21+
<object key="vat_frontend_visibility" dataType="vat_frontend_visibility">
22+
<field key="value">string</field>
23+
</object>
24+
</object>
25+
</object>
26+
</object>
27+
</operation>
28+
</operations>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminCustomerGroupPage" url="/customer/group/" area="admin" module="Magento_Customer">
12+
<section name="AdminCustomerGroupMainSection"/>
13+
</page>
14+
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminNewCustomerGroupPage" url="/customer/group/new/" area="admin" module="Magento_Customer">
12+
<section name="AdminNewCustomerGroupSection"/>
13+
</page>
14+
</pages>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCustomerGroupMainSection">
12+
<element name="filterBtn" type="button" selector="//button[text()='Filters']"/>
13+
<element name="groupField" type="input" selector="//*[@name='customer_group_code']"/>
14+
<element name="applyFiltersBtn" type="button" selector="//*[text()='Apply Filters']"/>
15+
<element name="selectFirstRow" type="button" selector="//button[@class='action-select']"/>
16+
<element name="deleteBtn" type="button" selector="//*[text()='Delete']"/>
17+
<element name="clearAllBtn" type="button" selector="//button[text()='Clear all']"/>
18+
</section>
19+
</sections>

0 commit comments

Comments
 (0)