Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into feature/braint…
Browse files Browse the repository at this point in the history
…ree-payment

# Conflicts:
#	composer.lock
  • Loading branch information
naydav committed Aug 4, 2019
2 parents 1132a47 + 41daebf commit 6fc0322
Show file tree
Hide file tree
Showing 409 changed files with 27,047 additions and 2,079 deletions.
2 changes: 2 additions & 0 deletions app/code/Magento/Authorizenet/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@
</field>
<field id="min_order_total" translate="label" type="text" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Minimum Order Total</label>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="max_order_total" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Maximum Order Total</label>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,43 @@
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ConfigureAuthorizenetAcceptjs">
<actionGroup name="ConfigureAuthorizenetAcceptjs" extends="EnableAuthorizenetAcceptjs">
<arguments>
<argument name="paymentAction" type="string"/>
</arguments>
<!-- Navigate to configuration -->
<waitForPageLoad stepKey="waitForStores"/>
<click stepKey="clickOnStores" selector="{{AdminMenuSection.stores}}"/>
<waitForPageLoad stepKey="waitForConfiguration"/>
<click stepKey="clickOnConfiguration" selector="{{StoresSubmenuSection.configuration}}"/>
<waitForPageLoad stepKey="waitForSales"/>
<waitForElementVisible stepKey="waitForVisibleHack" selector="{{AdminMenuSection.currencySetup}}"/>
<scrollTo stepKey="scrollToSales" selector="{{StoresConfigurationListSection.sales}}"/>
<click stepKey="clickOnSales" selector="{{StoresConfigurationListSection.sales}}" />
<waitForPageLoad stepKey="waitForPaymentMethods"/>
<click stepKey="clickOnPaymentMethods" selector="{{StoresConfigurationListSection.salesPaymentMethods}}" />
<waitForPageLoad stepKey="waitForOpenConfiguration"/>
<scrollTo stepKey="scrollToOpenConfig" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}"/>
<conditionalClick stepKey="openConfiguration" selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.alreadyOpenSectionToggle}}" visible="false"/>

<!-- Fill Auth.net fields and save -->
<waitForPageLoad stepKey="waitToFillApiLogin"/>
<waitForElementVisible selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionCheckbox}}" stepKey="waitForFormVisible"/>
<conditionalClick selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionCheckbox}}" stepKey="uncheckPaymentActionDefault" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelectDisabled}}" visible="true"/>
<selectOption selector="{{AuthorizenetAcceptjsConfigurationSection.paymentActionSelect}}" stepKey="selectPaymentAction" userInput="{{paymentAction}}"/>
<scrollTo stepKey="scrollToApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}"/>
<fillField stepKey="fillApiLoginId" selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" userInput="{{_CREDS.authorizenet_acceptjs_api_login_id}}"/>
<fillField stepKey="fillTransactionKey" selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_transaction_key}}"/>
<fillField stepKey="fillPublicClientKey" selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_public_client_key}}"/>
<fillField stepKey="fillSignatureKey" selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_signature_key}}"/>
<uncheckOption stepKey="uncheckCheckbox" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultCheckbox}}"/>
<selectOption stepKey="fillExpYear" selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" userInput="Yes"/>
<click stepKey="clickOnSave" selector="{{ConfigurationMainActionsSection.save}}" />
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" stepKey="scrollToApiLoginId"/>
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" userInput="{{_CREDS.authorizenet_acceptjs_api_login_id}}" stepKey="fillApiLoginId"/>
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_transaction_key}}" stepKey="fillTransactionKey"/>
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_public_client_key}}" stepKey="fillPublicClientKey"/>
<fillField selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" userInput="{{_CREDS.authorizenet_acceptjs_signature_key}}" stepKey="fillSignatureKey"/>
</actionGroup>

<actionGroup name="DisableAuthorizenetAcceptjs">
<magentoCLI stepKey="disableAuthorizenetAcceptjs" command="config:set payment/authorizenet_acceptjs/active 0"/>
</actionGroup>

<actionGroup name="EnableAuthorizenetAcceptjs">
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" stepKey="scrollToAuthorizeNetConfigSection"/>
<conditionalClick selector="{{AuthorizenetAcceptjsConfigurationSection.openSectionToggle}}" dependentSelector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" visible="false" stepKey="openConfigSection"/>
<waitForElementVisible selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" stepKey="waitForEnableFieldVisible"/>
<uncheckOption selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultCheckbox}}" stepKey="uncheckCheckbox"/>
<selectOption selector="{{AuthorizenetAcceptjsConfigurationSection.enabledDefaultSelect}}" userInput="Yes" stepKey="enablePayment"/>
</actionGroup>

<actionGroup name="AssertAuthorizenetAcceptjsRequiredFieldsValidationIsPresentOnSave">
<scrollToTopOfPage stepKey="scrollToTop"/>
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}}" stepKey="scrollToApiLoginIdField"/>
<see selector="{{AuthorizenetAcceptjsConfigurationSection.apiLoginIdField}} + {{AdminConfigSection.fieldError}}" userInput="This is a required field." stepKey="seeApiLoginIdRequiredMessage"/>
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}}" stepKey="scrollToPublicClientKeyField"/>
<see selector="{{AuthorizenetAcceptjsConfigurationSection.publicClientKeyField}} + {{AdminConfigSection.fieldError}}" userInput="This is a required field." stepKey="seePublicClientKeyRequiredErrorMessage"/>
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}}" stepKey="scrollTransactionKeyField"/>
<see selector="{{AuthorizenetAcceptjsConfigurationSection.transactionKeyField}} + {{AdminConfigSection.fieldError}}" userInput="This is a required field." stepKey="seeTransactionKeyRequiredErrorMessage"/>
<scrollTo selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}}" stepKey="scrollToSignatureKeyField"/>
<see selector="{{AuthorizenetAcceptjsConfigurationSection.signatureKeyField}} + {{AdminConfigSection.fieldError}}" userInput="This is a required field." stepKey="seeSignatureKeyRequiredErrorMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="ConfigureAuthorizenetAcceptjsWithoutRequiredOptionsTest">
<annotations>
<stories value="Authorize.net Accept.js"/>
<title value="Unable to configure Authorize.net Accept.js without required options"/>
<description value="Unable to configure Authorize.net Accept.js without required options"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-17805"/>
<useCaseId value="MC-17753"/>
<group value="AuthorizenetAcceptjs"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
<actionGroup ref="EnableAuthorizenetAcceptjs" stepKey="enableAuthorizenetAcceptjs"/>
<actionGroup ref="AssertAuthorizenetAcceptjsRequiredFieldsValidationIsPresentOnSave" stepKey="assertErrorMessages"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
</createData>

<!--Configure Auth.net-->
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
<actionGroup ref="ConfigureAuthorizenetAcceptjs" stepKey="configureAuthorizenetAcceptjs">
<argument name="paymentAction" value="Authorize Only"/>
</actionGroup>
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>

</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>

<!--Configure Auth.net-->
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
<actionGroup ref="ConfigureAuthorizenetAcceptjs" stepKey="configureAuthorizenetAcceptjs">
<argument name="paymentAction" value="Authorize and Capture"/>
</actionGroup>
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>

</before>
<after>
Expand Down
23 changes: 22 additions & 1 deletion app/code/Magento/AuthorizenetAcceptjs/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<group id="authorizenet_acceptjs_required"/>
</requires>
</field>
<group id="required" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="5">
<group id="required" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="15">
<label>Basic Authorize.Net Settings</label>
<attribute type="expanded">1</attribute>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
Expand All @@ -39,25 +39,44 @@
<label>API Login ID</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
<config_path>payment/authorizenet_acceptjs/login</config_path>
<validate>required-entry</validate>
<depends>
<field id="*/authorizenet_acceptjs/active">1</field>
</depends>
</field>
<field id="trans_key" translate="label" type="obscure" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Transaction Key</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
<config_path>payment/authorizenet_acceptjs/trans_key</config_path>
<validate>required-entry</validate>
<depends>
<field id="*/authorizenet_acceptjs/active">1</field>
</depends>
</field>
<field id="public_client_key" translate="label" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Public Client Key</label>
<config_path>payment/authorizenet_acceptjs/public_client_key</config_path>
<validate>required-entry</validate>
<depends>
<field id="*/authorizenet_acceptjs/active">1</field>
</depends>
</field>
<field id="trans_signature_key" translate="label" type="obscure" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Signature Key</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
<config_path>payment/authorizenet_acceptjs/trans_signature_key</config_path>
<validate>required-entry</validate>
<depends>
<field id="*/authorizenet_acceptjs/active">1</field>
</depends>
</field>
<field id="trans_md5" translate="label" type="obscure" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Merchant MD5 (deprecated)</label>
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
<config_path>payment/authorizenet_acceptjs/trans_md5</config_path>
<depends>
<field id="*/authorizenet_acceptjs/active">1</field>
</depends>
</field>
</group>
<group id="advanced" translate="label" showInDefault="1" showInWebsite="1" showInStore="0" sortOrder="20">
Expand Down Expand Up @@ -101,10 +120,12 @@
<field id="min_order_total" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Minimum Order Total</label>
<config_path>payment/authorizenet_acceptjs/min_order_total</config_path>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="max_order_total" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Maximum Order Total</label>
<config_path>payment/authorizenet_acceptjs/max_order_total</config_path>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ define([
return;
}

authData.clientKey = window.checkoutConfig.payment[this.getCode()].clientKey;
authData.apiLoginID = window.checkoutConfig.payment[this.getCode()].apiLoginID;
authData.clientKey = window.checkoutConfig.payment[this.getCode()].clientKey !== null ?
window.checkoutConfig.payment[this.getCode()].clientKey : '';
authData.apiLoginID = window.checkoutConfig.payment[this.getCode()].apiLoginID !== null ?
window.checkoutConfig.payment[this.getCode()].apiLoginID : '';

cardData.cardNumber = this.creditCardNumber();
cardData.month = this.creditCardExpMonth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Magento\Framework\Stdlib\ArrayManager;

/**
* DataProvider Model for Authorizenet
* SetPaymentMethod additional data provider model for Authorizenet payment method
*/
class AuthorizenetDataProvider implements AdditionalDataProviderInterface
{
Expand All @@ -23,7 +23,6 @@ class AuthorizenetDataProvider implements AdditionalDataProviderInterface
private $arrayManager;

/**
* AuthorizenetDataProvider constructor.
* @param ArrayManager $arrayManager
*/
public function __construct(
Expand All @@ -42,19 +41,19 @@ public function getData(array $data): array
{
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
foreach ($additionalData as $key => $value) {
$additionalData[$this->snakeCaseToCamelCase($key)] = $value;
$additionalData[$this->convertSnakeCaseToCamelCase($key)] = $value;
unset($additionalData[$key]);
}
return $additionalData;
}

/**
* Converts an input string from snake_case to camelCase.
* Convert an input string from snake_case to camelCase.
*
* @param string $input
* @return string
*/
private function snakeCaseToCamelCase($input)
private function convertSnakeCaseToCamelCase($input): string
{
return lcfirst(str_replace('_', '', ucwords($input, '_')));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Click save button and see message-->
<actionGroup name="ClickSaveButtonActionGroup">
<arguments>
<argument name="message" type="string"/>
</arguments>
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitMessage" />
<see userInput="{{message}}" selector="{{AdminMessagesSection.success}}" stepKey="verifyMessage" />
</actionGroup>
</actionGroups>
10 changes: 5 additions & 5 deletions app/code/Magento/Braintree/view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
var config = {
map: {
'*': {
braintreeClient: 'https://js.braintreegateway.com/web/3.46.0-beta-3ds.8/js/client.min.js',
braintreeHostedFields: 'https://js.braintreegateway.com/web/3.46.0-beta-3ds.8/js/hosted-fields.min.js',
braintreePayPal: 'https://js.braintreegateway.com/web/3.46.0-beta-3ds.8/js/paypal-checkout.min.js',
braintree3DSecure: 'https://js.braintreegateway.com/web/3.46.0-beta-3ds.8/js/three-d-secure.min.js',
braintreeDataCollector: 'https://js.braintreegateway.com/web/3.46.0-beta-3ds.8/js/data-collector.min.js'
braintreeClient: 'https://js.braintreegateway.com/web/3.48.0/js/client.min.js',
braintreeHostedFields: 'https://js.braintreegateway.com/web/3.48.0/js/hosted-fields.min.js',
braintreePayPal: 'https://js.braintreegateway.com/web/3.48.0/js/paypal-checkout.min.js',
braintree3DSecure: 'https://js.braintreegateway.com/web/3.48.0/js/three-d-secure.min.js',
braintreeDataCollector: 'https://js.braintreegateway.com/web/3.48.0/js/data-collector.min.js'
}
},
paths: {
Expand Down
Loading

0 comments on commit 6fc0322

Please sign in to comment.