Skip to content

Commit 5ae1c31

Browse files
author
Olexandr Lysenko
committed
Merge branch 'develop' into MAGETWO-59074
2 parents 4a6c3e0 + c533b3d commit 5ae1c31

File tree

594 files changed

+22475
-3663
lines changed

Some content is hidden

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

594 files changed

+22475
-3663
lines changed

app/code/Magento/Authorizenet/Model/Source/Cctype.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Cctype extends PaymentCctype
1717
*/
1818
public function getAllowedTypes()
1919
{
20-
return ['VI', 'MC', 'AE', 'DI'];
20+
return ['VI', 'MC', 'AE', 'DI', 'JCB', 'DN'];
2121
}
2222
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<payment>
1111
<authorizenet_directpost>
1212
<active>0</active>
13-
<cctypes>AE,VI,MC,DI</cctypes>
13+
<cctypes>AE,VI,MC,DI,JCB,DN</cctypes>
1414
<debug>0</debug>
1515
<email_customer>0</email_customer>
1616
<login backend_model="Magento\Config\Model\Config\Backend\Encrypted" />

app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
3535
</label>
3636
<div class="admin__field-control">
3737
<select id="<?php /* @noEscape */ echo $code; ?>_cc_type" name="payment[cc_type]"
38-
class="required-entry validate-cc-type-select admin__control-select">
39-
<option value=""></option>
38+
class="admin__control-select"
39+
data-validate="{
40+
'required':true,
41+
'validate-cc-type-select':'#<?php /* @noEscape */ echo $code; ?>_cc_number'
42+
}">
43+
<option value=""><?php echo $block->escapeHtml(__('Please Select')); ?></option>
4044
<?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
4145
<option value="<?php echo $block->escapeHtml($typeCode); ?>"
4246
<?php if ($typeCode == $ccType): ?>selected="selected"<?php endif; ?>>
@@ -46,27 +50,37 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
4650
</select>
4751
</div>
4852
</div>
53+
4954
<div class="admin__field _required">
5055
<label for="<?php /* @noEscape */ echo $code; ?>_cc_number" class="admin__field-label">
5156
<span><?php echo $block->escapeHtml(__('Credit Card Number')); ?></span>
5257
</label>
53-
5458
<div class="admin__field-control">
5559
<input type="text" id="<?php /* @noEscape */ echo $code; ?>_cc_number"
5660
name="payment[cc_number]"
57-
class="input-text required-entry validate-cc-number admin__control-text"
61+
data-validate="{
62+
'required-number':true,
63+
'validate-cc-number':'#<?php /* @noEscape */ echo $code; ?>_cc_type',
64+
'validate-cc-type':'#<?php /* @noEscape */ echo $code; ?>_cc_type'
65+
}"
66+
class="admin__control-text"
5867
value="<?php /* @noEscape */ echo $block->getInfoData('cc_number'); ?>"/>
5968
</div>
6069
</div>
61-
<div class="admin__field _required">
70+
71+
<div class="admin__field _required field-date" id="<?php /* @noEscape */ echo $code; ?>_cc_type_exp_div">
6272
<label for="<?php /* @noEscape */ echo $code; ?>_expiration" class="admin__field-label">
6373
<span><?php echo $block->escapeHtml(__('Expiration Date')); ?></span>
6474
</label>
6575

6676
<div class="admin__field-control">
6777
<select id="<?php /* @noEscape */ echo $code; ?>_expiration"
6878
name="payment[cc_exp_month]"
69-
class="validate-cc-exp required-entry admin__control-select admin__control-select-month">
79+
class="admin__control-select admin__control-select-month"
80+
data-validate="{
81+
'required':true,
82+
'validate-cc-exp':'#<?php /* @noEscape */ echo $code; ?>_expiration_yr'
83+
}">
7084
<?php foreach ($block->getCcMonths() as $k => $v): ?>
7185
<option value="<?php echo $block->escapeHtml($k); ?>"
7286
<?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif; ?>>
@@ -76,7 +90,9 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
7690
</select>
7791
<select id="<?php /* @noEscape */ echo $code; ?>_expiration_yr"
7892
name="payment[cc_exp_year]"
79-
class="required-entry admin__control-select admin__control-select-year">
93+
class="admin__control-select admin__control-select-year"
94+
data-container="<?php /* @noEscape */ echo $code; ?>-cc-year"
95+
data-validate="{required:true}">
8096
<?php foreach ($block->getCcYears() as $k => $v): ?>
8197
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
8298
<?php if ($k == $ccExpYear): ?>selected="selected"<?php endif; ?>>
@@ -86,17 +102,27 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
86102
</select>
87103
</div>
88104
</div>
105+
89106
<?php if ($block->hasVerification()): ?>
90-
<div class="admin__field _required">
91-
<label for="<?php /* @noEscape */ echo $code; ?>_cc_cid">
107+
<div class="admin__field _required field-cvv">
108+
<label class="admin__field-label"
109+
for="<?php /* @noEscape */ echo $code; ?>_cc_cid"
110+
id="<?php /* @noEscape */ echo $code; ?>_cc_type_cvv_div">
92111
<span><?php echo $block->escapeHtml(__('Card Verification Number')); ?></span>
93112
</label>
94113

95114
<div class="admin__field-control">
96115
<input type="text"
97-
class="required-entry input-text validate-cc-cvn admin__control-text"
116+
data-container="<?php /* @noEscape */ echo $code; ?>-cc-cvv"
117+
title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
118+
class="admin__control-text cvv"
98119
id="<?php /* @noEscape */ echo $code; ?>_cc_cid" name="payment[cc_cid]"
99-
value="<?php /* @noEscape */ echo $block->getInfoData('cc_cid') ?>"/>
120+
value="<?php /* @noEscape */ echo $block->getInfoData('cc_cid') ?>"
121+
data-validate="{
122+
'required-number':true,
123+
'validate-cc-cvn':'#<?php /* @noEscape */ echo $code; ?>_cc_type'
124+
}"
125+
autocomplete="off"/>
100126
</div>
101127
</div>
102128
<?php endif; ?>
@@ -105,7 +131,7 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
105131
require([
106132
'prototype',
107133
'Magento_Sales/order/create/scripts',
108-
"Magento_Sales/order/create/form",
134+
'Magento_Sales/order/create/form',
109135
'Magento_Authorizenet/js/direct-post'
110136
], function(){
111137

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<template>
1212
<minify_html>0</minify_html>
1313
</template>
14+
<static>
15+
<sign>1</sign>
16+
</static>
1417
</dev>
1518
<system>
1619
<media_storage_configuration>

app/code/Magento/Braintree/Helper/Country.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66
namespace Magento\Braintree\Helper;
77

88
use Magento\Directory\Model\ResourceModel\Country\CollectionFactory;
9+
use Magento\Braintree\Model\Adminhtml\System\Config\Country as CountryConfig;
910

1011
/**
1112
* Class Country
1213
*/
1314
class Country
1415
{
1516
/**
16-
* @var \Magento\Directory\Model\ResourceModel\Country\CollectionFactory
17+
* @var CollectionFactory
1718
*/
1819
private $collectionFactory;
1920

2021
/**
21-
* @var \Magento\Braintree\Model\Adminhtml\System\Config\Country
22+
* @var CountryConfig
2223
*/
2324
private $countryConfig;
2425

@@ -28,13 +29,11 @@ class Country
2829
private $countries;
2930

3031
/**
31-
* @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $factory
32-
* @param \Magento\Braintree\Model\Adminhtml\System\Config\Country $countryConfig
32+
* @param CollectionFactory $factory
33+
* @param CountryConfig $countryConfig
3334
*/
34-
public function __construct(
35-
\Magento\Directory\Model\ResourceModel\Country\CollectionFactory $factory,
36-
\Magento\Braintree\Model\Adminhtml\System\Config\Country $countryConfig
37-
) {
35+
public function __construct(CollectionFactory $factory, CountryConfig $countryConfig)
36+
{
3837
$this->collectionFactory = $factory;
3938
$this->countryConfig = $countryConfig;
4039
}

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<argument name="code" xsi:type="const">Magento\Braintree\Model\Ui\PayPal\ConfigProvider::PAYPAL_CODE</argument>
2323
<argument name="infoBlockType" xsi:type="string">BraintreePayPalInfo</argument>
2424
<argument name="valueHandlerPool" xsi:type="object">BraintreePayPalValueHandlerPool</argument>
25+
<argument name="validatorPool" xsi:type="object">BraintreePayPalValidatorPool</argument>
2526
<argument name="commandPool" xsi:type="object">BraintreePayPalCommandPool</argument>
2627
</arguments>
2728
</virtualType>
@@ -474,7 +475,7 @@
474475
</arguments>
475476
</virtualType>
476477

477-
<!-- Value validators infrastructure -->
478+
<!-- Braintree validators infrastructure -->
478479
<virtualType name="BraintreeCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
479480
<arguments>
480481
<argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\Config</argument>
@@ -487,6 +488,22 @@
487488
</argument>
488489
</arguments>
489490
</virtualType>
491+
<!-- Braintree validators infrastructure -->
492+
493+
<!-- Braintree PayPal validators -->
494+
<virtualType name="BraintreePayPalCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
495+
<arguments>
496+
<argument name="config" xsi:type="object">Magento\Braintree\Gateway\Config\PayPal\Config</argument>
497+
</arguments>
498+
</virtualType>
499+
<virtualType name="BraintreePayPalValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
500+
<arguments>
501+
<argument name="validators" xsi:type="array">
502+
<item name="country" xsi:type="string">BraintreePayPalCountryValidator</item>
503+
</argument>
504+
</arguments>
505+
</virtualType>
506+
<!-- END Braintree PayPal validators -->
490507

491508
<type name="Magento\Braintree\Block\Info">
492509
<arguments>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ define([
1212
'Magento_Checkout/js/model/quote',
1313
'Magento_Checkout/js/model/full-screen-loader',
1414
'Magento_Checkout/js/model/payment/additional-validators',
15-
'Magento_Vault/js/view/payment/vault-enabler'
16-
], function ($, _, Component, Braintree, quote, fullScreenLoader, additionalValidators, VaultEnabler) {
15+
'Magento_Vault/js/view/payment/vault-enabler',
16+
'Magento_Checkout/js/action/create-billing-address'
17+
], function (
18+
$,
19+
_,
20+
Component,
21+
Braintree,
22+
quote,
23+
fullScreenLoader,
24+
additionalValidators,
25+
VaultEnabler,
26+
createBillingAddress
27+
) {
1728
'use strict';
1829

1930
return Component.extend({
@@ -172,14 +183,16 @@ define([
172183
var billingAddress = {
173184
street: [address.streetAddress],
174185
city: address.locality,
175-
regionCode: address.region,
176186
postcode: address.postalCode,
177187
countryId: address.countryCodeAlpha2,
188+
email: customer.email,
178189
firstname: customer.firstName,
179190
lastname: customer.lastName,
180191
telephone: customer.phone
181192
};
182193

194+
billingAddress['region_code'] = address.region;
195+
billingAddress = createBillingAddress(billingAddress);
183196
quote.billingAddress(billingAddress);
184197
},
185198

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109
<input type="checkbox"
110110
name="vault[is_enabled]"
111111
class="checkbox"
112-
data-bind="attr: {'id': getCode() + '_vault_enabler'}, checked: vaultEnabler.isActivePaymentTokenEnabler"/>
113-
<label class="label" data-bind="attr: {'for': getCode() + '_vault_enabler'}">
112+
data-bind="attr: {'id': getCode() + '_enable_vault'}, checked: vaultEnabler.isActivePaymentTokenEnabler"/>
113+
<label class="label" data-bind="attr: {'for': getCode() + '_enable_vault'}">
114114
<span><!-- ko i18n: 'Save for later use.'--><!-- /ko --></span>
115115
</label>
116116
<div class="field-tooltip toggle">

app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<input type="checkbox"
3333
name="vault[is_enabled]"
3434
class="checkbox"
35-
data-bind="attr: {'id': getCode() + '_vault_enabler'}, checked: vaultEnabler.isActivePaymentTokenEnabler"/>
36-
<label class="label" data-bind="attr: {'for': getCode() + '_vault_enabler'}">
35+
data-bind="attr: {'id': getCode() + '_enable_vault'}, checked: vaultEnabler.isActivePaymentTokenEnabler"/>
36+
<label class="label" data-bind="attr: {'for': getCode() + '_enable_vault'}">
3737
<span><!-- ko i18n: 'Save for later use.'--><!-- /ko --></span>
3838
</label>
3939
<div class="field-tooltip toggle">

app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,7 @@ private function getShipmentTypeValue($type)
331331
protected function cleanNotBundleAdditionalAttributes($dataRow)
332332
{
333333
if (!empty($dataRow['additional_attributes'])) {
334-
$additionalAttributes = explode(
335-
ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR,
336-
$dataRow['additional_attributes']
337-
);
334+
$additionalAttributes = $this->parseAdditionalAttributes($dataRow['additional_attributes']);
338335
$dataRow['additional_attributes'] = $this->getNotBundleAttributes($additionalAttributes);
339336
}
340337

@@ -349,17 +346,38 @@ protected function cleanNotBundleAdditionalAttributes($dataRow)
349346
*/
350347
protected function getNotBundleAttributes($additionalAttributes)
351348
{
352-
$cleanedAdditionalAttributes = '';
353-
foreach ($additionalAttributes as $attribute) {
354-
list($attributeCode, $attributeValue) = explode(ImportProductModel::PAIR_NAME_VALUE_SEPARATOR, $attribute);
355-
if (!in_array('bundle_' . $attributeCode, $this->getBundleColumns())) {
356-
$cleanedAdditionalAttributes .= $attributeCode
357-
. ImportProductModel::PAIR_NAME_VALUE_SEPARATOR
358-
. $attributeValue
359-
. ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR;
349+
$filteredAttributes = [];
350+
foreach ($additionalAttributes as $code => $value) {
351+
if (!in_array('bundle_' . $code, $this->getBundleColumns())) {
352+
$filteredAttributes[] = $code . ImportProductModel::PAIR_NAME_VALUE_SEPARATOR . $value;
360353
}
361354
}
355+
return implode(ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $filteredAttributes);
356+
}
362357

363-
return rtrim($cleanedAdditionalAttributes, ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR);
358+
/**
359+
* Retrieves additional attributes as array code=>value.
360+
*
361+
* @param string $additionalAttributes
362+
* @return array
363+
*/
364+
private function parseAdditionalAttributes($additionalAttributes)
365+
{
366+
$attributeNameValuePairs = explode(ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalAttributes);
367+
$preparedAttributes = [];
368+
$code = '';
369+
foreach ($attributeNameValuePairs as $attributeData) {
370+
//process case when attribute has ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR inside its value
371+
if (strpos($attributeData, ImportProductModel::PAIR_NAME_VALUE_SEPARATOR) === false) {
372+
if (!$code) {
373+
continue;
374+
}
375+
$preparedAttributes[$code] .= ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR . $attributeData;
376+
continue;
377+
}
378+
list($code, $value) = explode(ImportProductModel::PAIR_NAME_VALUE_SEPARATOR, $attributeData, 2);
379+
$preparedAttributes[$code] = $value;
380+
}
381+
return $preparedAttributes;
364382
}
365383
}

0 commit comments

Comments
 (0)