Skip to content

Commit

Permalink
Merge branch '2.3-develop' into feature/271-Customer-Attributes-Valid…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
furseyev committed Jun 2, 2019
2 parents 4b7acdc + 93f21ca commit 48f1891
Show file tree
Hide file tree
Showing 507 changed files with 12,968 additions and 5,377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
}
}
}
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// @codingStandardsIgnoreFile
?>
<button class="scalable" type="button" id="<?= $block->getHtmlId() ?>" data-mage-init='{"testConnection":{
"url": "<?= /* @escapeNotVerified */ $block->getAjaxUrl() ?>",
"url": "<?= $block->escapeUrl($block->getAjaxUrl()) ?>",
"elementId": "<?= $block->getHtmlId() ?>",
"successText": "<?= /* @escapeNotVerified */ __('Successful! Test again?') ?>",
"failedText": "<?= /* @escapeNotVerified */ __('Connection failed! Test again?') ?>",
"fieldMapping": "<?= /* @escapeNotVerified */ $block->getFieldMapping() ?>"}, "validation": {}}'>
"successText": "<?= $block->escapeHtmlAttr(__('Successful! Test again?')) ?>",
"failedText": "<?= $block->escapeHtmlAttr(__('Connection failed! Test again?')) ?>",
"fieldMapping": "<?= /* @noEscape */ $block->getFieldMapping() ?>"}, "validation": {}}'>
<span><span><span id="<?= $block->getHtmlId() ?>_result"><?= $block->escapeHtml($block->getButtonLabel()) ?></span></span></span>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
$data = $block->getItems();
if (count($data)):?>
<dl class="block">
<dt class="title"><?= /* @escapeNotVerified */ __($block->getTitle()) ?></dt>
<dt class="title"><?= $block->escapeHtml(__($block->getTitle())) ?></dt>
<?php foreach ($data as $additionalInfo) : ?>
<dd class="item">
<a href="<?= /* @escapeNotVerified */ $block->getLink($additionalInfo->getQueryText()) ?>"
<a href="<?= $block->escapeUrl($block->getLink($additionalInfo->getQueryText())) ?>"
><?= $block->escapeHtml($additionalInfo->getQueryText()) ?></a>
<?php if ($block->isShowResultsCount()): ?>
<span class="count"><?= /* @escapeNotVerified */ $additionalInfo->getResultsCount() ?></span>
<span class="count"><?= /* @noEscape */ (int)$additionalInfo->getResultsCount() ?></span>
<?php endif; ?>
</dd>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\AuthorizenetGraphQl\Model;

use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Framework\GraphQL\DataObjectConverter;

/**
* DataProvider Model for Authorizenet
*/
class AuthorizenetDataProvider implements AdditionalDataProviderInterface
{
private const PATH_ADDITIONAL_DATA = 'input/payment_method/additional_data/authorizenet_acceptjs';

/**
* @var ArrayManager
*/
private $arrayManager;

/**
* AuthorizenetDataProvider constructor.
* @param ArrayManager $arrayManager
*/
public function __construct(
ArrayManager $arrayManager
) {
$this->arrayManager = $arrayManager;
}

/**
* Return additional data
*
* @param array $args
* @return array
*/
public function getData(array $args): array
{
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $args) ?? [];
foreach ($additionalData as $key => $value) {
$additionalData[$this->snakeCaseToCamelCase($key)] = $value;
unset($additionalData[$key]);
}
return $additionalData;
}

/**
* Converts an input string from snake_case to camelCase.
*
* @param string $input
* @return string
*/
private function snakeCaseToCamelCase($input)
{
return lcfirst(str_replace('_', '', ucwords($input, '_')));
}
}
3 changes: 3 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AuthorizenetGraphQl

**AuthorizenetGraphQl** defines the data types needed to pass payment information data from the client to Magento.
25 changes: 25 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "magento/module-authorizenet-graph-ql",
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.1.3||~7.2.0",
"magento/framework": "*",
"magento/module-quote-graph-ql": "*"
},
"suggest": {
"magento/module-graph-ql": "*"
},
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Magento\\AuthorizenetGraphQl\\": ""
}
}
}
16 changes: 16 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/etc/graphql/di.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderPool">
<arguments>
<argument name="dataProviders" xsi:type="array">
<item name="authorizenet_acceptjs" xsi:type="object">Magento\AuthorizenetGraphQl\Model\AuthorizenetDataProvider</item>
</argument>
</arguments>
</type>
</config>
10 changes: 10 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/etc/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_AuthorizenetGraphQl"/>
</config>
12 changes: 12 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

input PaymentMethodAdditionalDataInput {
authorizenet_acceptjs: AuthorizenetInput @doc(description: "Defines the required attributes for Authorize.Net payments")
}

input AuthorizenetInput {
opaque_data_descriptor: String! @doc(description: "Authorize.Net's description of the transaction request")
opaque_data_value: String! @doc(description: "The nonce returned by Authorize.Net")
cc_last_4: Int! @doc(description: "The last four digits of the credit or debit card")
}
10 changes: 10 additions & 0 deletions app/code/Magento/AuthorizenetGraphQl/registration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AuthorizenetGraphQl', __DIR__);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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">
<actionGroup name="AssertOrderGraphImageOnDashboardActionGroup">
<click selector="{{AdminDashboardSection.ordersTab}}" stepKey="clickOrdersBtn"/>
<seeElement selector="{{AdminDashboardSection.ordersChart}}" stepKey="seeGraphImage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
<section name="AdminMenuSection"/>
<section name="AdminDashboardSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminDashboardSection">
<element name="ordersTab" type="button" selector="#diagram_tab_orders"/>
<element name="ordersChart" type="button" selector="#diagram_tab_orders_content .dashboard-diagram-image img"/>
<element name="dashboardDiagramContent" type="button" selector="#diagram_tab_content"/>
<element name="dashboardDiagramOrderContentTab" type="block" selector="#diagram_tab_orders_content"/>
<element name="dashboardDiagramAmounts" type="button" selector="#diagram_tab_amounts"/>
Expand Down
30 changes: 28 additions & 2 deletions app/code/Magento/Braintree/Block/Paypal/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Braintree\Block\Paypal;

use Magento\Braintree\Gateway\Config\PayPal\Config;
Expand Down Expand Up @@ -49,8 +51,6 @@ class Button extends Template implements ShortcutInterface
private $payment;

/**
* Constructor
*
* @param Context $context
* @param ResolverInterface $localeResolver
* @param Session $checkoutSession
Expand Down Expand Up @@ -98,6 +98,8 @@ public function getAlias()
}

/**
* Returns container id.
*
* @return string
*/
public function getContainerId()
Expand All @@ -106,6 +108,8 @@ public function getContainerId()
}

/**
* Returns locale.
*
* @return string
*/
public function getLocale()
Expand All @@ -114,6 +118,8 @@ public function getLocale()
}

/**
* Returns currency.
*
* @return string
*/
public function getCurrency()
Expand All @@ -122,6 +128,8 @@ public function getCurrency()
}

/**
* Returns amount.
*
* @return float
*/
public function getAmount()
Expand All @@ -130,6 +138,8 @@ public function getAmount()
}

/**
* Returns if is active.
*
* @return bool
*/
public function isActive()
Expand All @@ -139,6 +149,8 @@ public function isActive()
}

/**
* Returns merchant name.
*
* @return string
*/
public function getMerchantName()
Expand All @@ -147,6 +159,8 @@ public function getMerchantName()
}

/**
* Returns client token.
*
* @return string|null
*/
public function getClientToken()
Expand All @@ -155,10 +169,22 @@ public function getClientToken()
}

/**
* Returns action success.
*
* @return string
*/
public function getActionSuccess()
{
return $this->getUrl(ConfigProvider::CODE . '/paypal/review', ['_secure' => true]);
}

/**
* Gets environment value.
*
* @return string
*/
public function getEnvironment(): string
{
return $this->configProvider->getConfig()['payment'][ConfigProvider::CODE]['environment'];
}
}
25 changes: 13 additions & 12 deletions app/code/Magento/Braintree/Gateway/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Config extends \Magento\Payment\Gateway\Config\Config
const KEY_VERIFY_SPECIFIC = 'verify_specific_countries';
const VALUE_3DSECURE_ALL = 0;
const CODE_3DSECURE = 'three_d_secure';
const KEY_KOUNT_MERCHANT_ID = 'kount_id';
const FRAUD_PROTECTION = 'fraudprotection';

/**
Expand Down Expand Up @@ -173,6 +172,7 @@ public function get3DSecureSpecificCountries($storeId = null)

/**
* Gets value of configured environment.
*
* Possible values: production or sandbox.
*
* @param int|null $storeId
Expand All @@ -183,17 +183,6 @@ public function getEnvironment($storeId = null)
return $this->getValue(Config::KEY_ENVIRONMENT, $storeId);
}

/**
* Gets Kount merchant ID.
*
* @param int|null $storeId
* @return string
*/
public function getKountMerchantId($storeId = null)
{
return $this->getValue(Config::KEY_KOUNT_MERCHANT_ID, $storeId);
}

/**
* Gets merchant ID.
*
Expand All @@ -217,13 +206,25 @@ public function getMerchantAccountId($storeId = null)
}

/**
* Returns SDK url.
*
* @return string
*/
public function getSdkUrl()
{
return $this->getValue(Config::KEY_SDK_URL);
}

/**
* Gets Hosted Fields SDK Url
*
* @return string
*/
public function getHostedFieldsSdkUrl(): string
{
return $this->getValue('hosted_fields_sdk_url');
}

/**
* Checks if fraud protection is enabled.
*
Expand Down
Loading

0 comments on commit 48f1891

Please sign in to comment.