Skip to content

Commit 227f819

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/develop' into MAGETWO-38635-prs
2 parents c644355 + e0ed4ba commit 227f819

File tree

39 files changed

+1058
-218
lines changed

39 files changed

+1058
-218
lines changed

app/code/Magento/BraintreeTwo/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testPlaceRequestWithException()
6969
}
7070

7171
/**
72-
* @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::placeRequest
72+
* @covers \Magento\BraintreeTwo\Gateway\Http\Client\TransactionSubmitForSettlement::process
7373
*/
7474
public function testPlaceRequest()
7575
{

app/code/Magento/BraintreeTwo/view/adminhtml/layout/braintreetwo_report_index.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
10+
<referenceContainer name="page.main.actions">
11+
<block class="Magento\Backend\Block\Template" name="adminhtml.report.grid.braintreetwo.tooltip" template="Magento_BraintreeTwo::grid/tooltip.phtml">
12+
<arguments>
13+
<argument name="tooltip_content" xsi:type="string" translate="true">Apply filters in order to get results. Only first 100 records will be displayed in the grid, you will be able to download full version of the report in .csv format.</argument>
14+
</arguments>
15+
</block>
16+
</referenceContainer>
1017
<referenceContainer name="content">
1118
<uiComponent name="braintreetwo_report"/>
1219
</referenceContainer>

app/code/Magento/BraintreeTwo/view/adminhtml/templates/form/vault.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $id = $block->escapeHtml($block->getData('id'));
2323
<img src="<?php echo $block->escapeUrl($icon['url']); ?>"
2424
width="<?php echo $block->escapeHtml($icon['width']); ?>"
2525
height="<?php echo $block->escapeHtml($icon['height']); ?>"
26-
>
26+
class="payment-icon" >
2727
<span><?php echo $block->escapeHtml(__('ending'));?></span>
2828
<span><?php echo $block->escapeHtml($details['maskedCC']); ?></span>
2929
(<span><?php echo $block->escapeHtml(__('expires'));?></span>:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/**
8+
* @var \Magento\Backend\Block\Template $block
9+
*/
10+
echo $block->escapeHtml($block->getData('tooltip_content'));

app/code/Magento/BraintreeTwo/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ define([
112112
self.selectedCardType(null);
113113
}
114114

115-
if (!event.isValid) {
116-
return false;
117-
}
118-
119-
if (event.card) {
115+
if (event.target.fieldKey === 'number' && event.card) {
116+
if (event.isValid) {
117+
self.cardNumber = event.card;
118+
} else {
119+
self.cardNumber = null;
120+
}
120121
self.selectedCardType(
121122
validator.getMageCardType(event.card.type, self.getCcAvailableTypes())
122123
);

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ define([
99
'underscore',
1010
'Magento_Checkout/js/view/payment/default',
1111
'Magento_BraintreeTwo/js/view/payment/adapter',
12-
'Magento_Checkout/js/model/quote'
13-
], function ($, _, Component, Braintree, quote) {
12+
'Magento_Checkout/js/model/quote',
13+
'Magento_Checkout/js/model/full-screen-loader'
14+
], function ($, _, Component, Braintree, quote, fullScreenLoader) {
1415
'use strict';
1516

1617
var checkout;
@@ -35,6 +36,7 @@ define([
3536
*/
3637
onReady: function (integration) {
3738
checkout = integration;
39+
this.enableButton();
3840
},
3941

4042
/**
@@ -160,6 +162,7 @@ define([
160162
checkout.teardown(function () {
161163
checkout = null;
162164
});
165+
this.disableButton();
163166
this.clientConfig.paypal.amount = this.grandTotalAmount;
164167

165168
Braintree.setConfig(this.clientConfig);
@@ -267,6 +270,22 @@ define([
267270
getPaymentAcceptanceMarkSrc: function () {
268271

269272
return window.checkoutConfig.payment[this.getCode()].paymentAcceptanceMarkSrc;
273+
},
274+
275+
/**
276+
* Disable submit button
277+
*/
278+
disableButton: function () {
279+
fullScreenLoader.startLoader();
280+
$('[data-button="place"]').attr('disabled', 'disabled');
281+
},
282+
283+
/**
284+
* Enable submit button
285+
*/
286+
enableButton: function () {
287+
$('[data-button="place"]').removeAttr('disabled');
288+
fullScreenLoader.stopLoader();
270289
}
271290
});
272291
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</div>
3030
<div class="actions-toolbar">
3131
<div class="primary">
32-
<button data-role="review-save"
32+
<button data-button="place" data-role="review-save"
3333
type="submit"
3434
data-bind="attr: {title: $t('Continue to PayPal')}, enable: (isActive()), click: payWithPayPal"
3535
class="action primary checkout"

app/code/Magento/Paypal/view/adminhtml/templates/payflowpro/vault.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $id = $block->escapeHtml($block->getData('id'));
2424
<img src="<?php echo $block->escapeUrl($icon['url']); ?>"
2525
width="<?php echo $block->escapeHtml($icon['width']); ?>"
2626
height="<?php echo $block->escapeHtml($icon['height']); ?>"
27-
>
27+
class="payment-icon" >
2828
<span><?php echo $block->escapeHtml(__('ending'));?></span>
2929
<span><?php echo $block->escapeHtml($details['cc_last_4']); ?></span>
3030
(<span><?php echo $block->escapeHtml(__('expires'));?></span>:

app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@ define(
1818
return function (messageContainer) {
1919
var serviceUrl,
2020
payload,
21+
method = 'put',
2122
paymentData = quote.paymentMethod();
2223

2324
/**
2425
* Checkout for guest and registered customer.
2526
*/
2627
if (!customer.isLoggedIn()) {
27-
serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/selected-payment-method', {
28+
serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/set-payment-information', {
2829
cartId: quote.getQuoteId()
2930
});
3031
payload = {
3132
cartId: quote.getQuoteId(),
32-
method: paymentData
33+
email: quote.guestEmail,
34+
paymentMethod: paymentData
3335
};
36+
method = 'post';
3437
} else {
3538
serviceUrl = urlBuilder.createUrl('/carts/mine/selected-payment-method', {});
3639
payload = {
@@ -40,7 +43,7 @@ define(
4043
}
4144
fullScreenLoader.startLoader();
4245

43-
return storage.put(
46+
return storage[method](
4447
serviceUrl, JSON.stringify(payload)
4548
).fail(
4649
function (response) {

app/code/Magento/Ui/etc/ui_configuration.xsd

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<xs:element type="button" name="button"/>
4949
<xs:element type="htmlContent" name="htmlContent"/>
5050
<xs:element type="actionDelete" name="actionDelete"/>
51+
<xs:element type="dynamicRowsConfiguration" name="dynamicRows"/>
5152
</xs:choice>
5253
</xs:extension>
5354
</xs:complexContent>
@@ -99,7 +100,6 @@
99100
<xs:element type="insertFormConfiguration" name="insertForm"/>
100101
<xs:element type="insertListingConfiguration" name="insertListing"/>
101102
<xs:element type="modalConfiguration" name="modal"/>
102-
<xs:element type="dynamicRowsConfiguration" name="dynamicRows"/>
103103
</xs:choice>
104104
</xs:extension>
105105
</xs:complexContent>
@@ -131,34 +131,26 @@
131131
</xs:complexType>
132132
<xs:complexType name="modalConfiguration">
133133
<xs:complexContent>
134-
<xs:extension base="modal">
135-
<xs:choice minOccurs="0" maxOccurs="unbounded">
136-
<xs:element type="field" name="field" />
137-
<xs:element type="fieldsetConfiguration" name="fieldset"/>
138-
<xs:element type="containerConfiguration" name="container"/>
139-
<xs:element type="modalConfiguration" name="modal"/>
140-
<xs:element type="dynamicRowsConfiguration" name="dynamicRows"/>
141-
<xs:element type="insertListingConfiguration" name="insertListing"/>
142-
<xs:element type="insertFormConfiguration" name="insertForm"/>
143-
</xs:choice>
134+
<xs:extension base="containerConfiguration">
135+
<xs:choice minOccurs="0" maxOccurs="unbounded"/>
144136
</xs:extension>
145137
</xs:complexContent>
146138
</xs:complexType>
147-
<xs:complexType name="dynamicRowsConfiguration">
139+
<xs:complexType name="massactionConfiguration">
148140
<xs:complexContent>
149-
<xs:extension base="dynamicRows">
141+
<xs:extension base="massaction">
150142
<xs:choice minOccurs="0" maxOccurs="unbounded">
151-
<xs:element type="containerConfiguration" name="container"/>
152-
<xs:element type="actionDelete" name="actionDelete"/>
143+
<xs:element name="action" type="action" />
153144
</xs:choice>
154145
</xs:extension>
155146
</xs:complexContent>
156147
</xs:complexType>
157-
<xs:complexType name="massactionConfiguration">
148+
<xs:complexType name="dynamicRowsConfiguration">
158149
<xs:complexContent>
159-
<xs:extension base="massaction">
150+
<xs:extension base="dynamicRows">
160151
<xs:choice minOccurs="0" maxOccurs="unbounded">
161-
<xs:element name="action" type="action" />
152+
<xs:element type="containerConfiguration" name="container"/>
153+
<xs:element type="actionDelete" name="actionDelete"/>
162154
</xs:choice>
163155
</xs:extension>
164156
</xs:complexContent>

0 commit comments

Comments
 (0)