Skip to content

Commit f04367c

Browse files
author
Michael Logvin
committed
Merge branch 'develop' into bugfixes
2 parents 2987481 + ddd2dd4 commit f04367c

File tree

9 files changed

+49
-27
lines changed

9 files changed

+49
-27
lines changed

app/code/Magento/Checkout/Api/GuestPaymentInformationManagementInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Checkout\Api;
77

8+
/**
9+
* Interface for managing guest payment information
10+
* @api
11+
*/
812
interface GuestPaymentInformationManagementInterface
913
{
1014
/**

app/code/Magento/Checkout/Api/GuestShippingInformationManagementInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Checkout\Api;
77

8+
/**
9+
* Interface for managing guest shipping address information
10+
* @api
11+
*/
812
interface GuestShippingInformationManagementInterface
913
{
1014
/**

app/code/Magento/Checkout/Api/PaymentInformationManagementInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Checkout\Api;
77

8+
/**
9+
* Interface for managing quote payment information
10+
* @api
11+
*/
812
interface PaymentInformationManagementInterface
913
{
1014
/**

app/code/Magento/Checkout/Api/ShippingInformationManagementInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Checkout\Api;
77

8+
/**
9+
* Interface for managing customer shipping address information
10+
* @api
11+
*/
812
interface ShippingInformationManagementInterface
913
{
1014
/**

app/code/Magento/Checkout/view/frontend/web/js/action/get-payment-information.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
define(
66
[
7+
'jquery',
78
'Magento_Checkout/js/model/quote',
89
'Magento_Checkout/js/model/url-builder',
910
'mage/storage',
@@ -12,13 +13,13 @@ define(
1213
'Magento_Checkout/js/model/payment/method-converter',
1314
'Magento_Checkout/js/model/payment-service'
1415
],
15-
function (quote, urlBuilder, storage, errorProcessor, customer, methodConverter, paymentService) {
16+
function ($, quote, urlBuilder, storage, errorProcessor, customer, methodConverter, paymentService) {
1617
'use strict';
1718

18-
return function () {
19-
var serviceUrl,
20-
payload;
19+
return function (deferred) {
20+
var serviceUrl;
2121

22+
deferred = deferred || $.Deferred();
2223
/**
2324
* Checkout for guest and registered customer.
2425
*/
@@ -29,19 +30,19 @@ define(
2930
} else {
3031
serviceUrl = urlBuilder.createUrl('/carts/mine/payment-information', {});
3132
}
32-
payload = {
33-
cartId: quote.getQuoteId()
34-
};
33+
3534
return storage.get(
36-
serviceUrl, JSON.stringify(payload)
35+
serviceUrl, false
3736
).done(
3837
function (response) {
3938
quote.setTotals(response.totals);
4039
paymentService.setPaymentMethods(methodConverter(response.payment_methods));
40+
deferred.resolve();
4141
}
4242
).fail(
4343
function (response) {
4444
errorProcessor.process(response);
45+
deferred.reject();
4546
}
4647
);
4748
};

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define([
5555
};
5656
events['click ' + this.options.item.button] = function(event) {
5757
event.stopPropagation();
58-
self._updateItemQty($(event.target));
58+
self._updateItemQty($(event.currentTarget));
5959
};
6060

6161
this._on(this.element, events);

app/code/Magento/Checkout/view/frontend/web/template/payment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<li id="opc-payment" role="presentation" class="checkout-payment-method" data-bind="fadeVisible: isVisible">
7+
<li id="payment" role="presentation" class="checkout-payment-method" data-bind="fadeVisible: isVisible">
88
<div class="step-title" data-bind="i18n: title" data-role="title"></div>
99
<div id="checkout-step-payment"
1010
class="step-content"

app/code/Magento/Checkout/view/frontend/web/template/shipping.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<li id="opc-shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()">
7+
<li id="shipping" class="checkout-shipping-address" data-bind="fadeVisible: visible()">
88
<div class="step-title" data-bind="i18n: 'Shipping Address'" data-role="title"></div>
99
<div id="checkout-step-shipping"
1010
class="step-content"

app/code/Magento/SalesRule/view/frontend/web/js/action/cancel-coupon.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,50 @@
99
/*global define,alert*/
1010
define(
1111
[
12-
'ko',
1312
'jquery',
1413
'Magento_Checkout/js/model/quote',
1514
'Magento_Checkout/js/model/resource-url-manager',
16-
'Magento_Checkout/js/model/payment-service',
1715
'Magento_Checkout/js/model/error-processor',
1816
'Magento_Ui/js/model/messageList',
1917
'mage/storage',
20-
'Magento_Checkout/js/action/get-totals',
18+
'Magento_Checkout/js/action/get-payment-information',
19+
'Magento_Checkout/js/model/totals',
2120
'mage/translate'
2221
],
23-
function (ko, $, quote, urlManager, paymentService, errorProcessor, messageList, storage, getTotalsAction, $t) {
22+
function ($, quote, urlManager, errorProcessor, messageList, storage, getPaymentInformationAction, totals, $t) {
2423
'use strict';
24+
2525
return function (isApplied, isLoading) {
26-
var quoteId = quote.getQuoteId();
27-
var url = urlManager.getCancelCouponUrl(quoteId);
28-
var message = $t('Your coupon was successfully removed');
26+
var quoteId = quote.getQuoteId(),
27+
url = urlManager.getCancelCouponUrl(quoteId),
28+
message = $t('Your coupon was successfully removed');
2929
messageList.clear();
30+
3031
return storage.delete(
3132
url,
3233
false
3334
).done(
34-
function (response) {
35+
function () {
3536
var deferred = $.Deferred();
36-
isLoading(false);
37-
getTotalsAction([], deferred);
38-
$.when(deferred).done(function() {
37+
totals.isLoading(true);
38+
getPaymentInformationAction(deferred);
39+
$.when(deferred).done(function () {
3940
isApplied(false);
40-
paymentService.setPaymentMethods(
41-
paymentService.getAvailablePaymentMethods()
42-
);
41+
totals.isLoading(false);
42+
});
43+
messageList.addSuccessMessage({
44+
'message': message
4345
});
44-
messageList.addSuccessMessage({'message': message});
4546
}
4647
).fail(
4748
function (response) {
48-
isLoading(false);
49+
totals.isLoading(false);
4950
errorProcessor.process(response);
5051
}
52+
).always(
53+
function () {
54+
isLoading(false);
55+
}
5156
);
5257
};
5358
}

0 commit comments

Comments
 (0)