-
Notifications
You must be signed in to change notification settings - Fork 2
/
specific_country_payment_method_fix_2.3.5-p1_composer-2020-05-20-10-41-44.patch
70 lines (68 loc) · 2.5 KB
/
specific_country_payment_method_fix_2.3.5-p1_composer-2020-05-20-10-41-44.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
diff --git a/vendor/amzn/amazon-pay-module/view/frontend/web/js/view/shipping.js b/vendor/amzn/amazon-pay-module/view/frontend/web/js/view/shipping.js
index c7d8897..6a2c7e0 100644
--- a/vendor/amzn/amazon-pay-module/view/frontend/web/js/view/shipping.js
+++ b/vendor/amzn/amazon-pay-module/view/frontend/web/js/view/shipping.js
@@ -2,22 +2,14 @@
define(
[
'jquery',
- 'underscore',
- 'ko',
'Magento_Checkout/js/view/shipping',
'Magento_Customer/js/model/customer',
- 'Magento_Checkout/js/action/set-shipping-information',
- 'Magento_Checkout/js/model/step-navigator',
'Amazon_Payment/js/model/storage'
],
function (
$,
- _,
- ko,
Component,
customer,
- setShippingInformationAction,
- stepNavigator,
amazonStorage
) {
'use strict';
@@ -49,32 +41,20 @@ define(
},
/**
- * New setShipping Action for Amazon Pay to bypass validation
+ * Overridden validateShippingInformation for Amazon Pay to bypass validation
+ *
+ * @inheritDoc
*/
- setShippingInformation: function () {
-
- /**
- * Set Amazon shipping info
- */
- function setShippingInformationAmazon() {
- setShippingInformationAction().done(
- function () {
- stepNavigator.next();
- }
- );
+ validateShippingInformation: function () {
+ if (!amazonStorage.isAmazonAccountLoggedIn()) {
+ return this._super();
}
- if (amazonStorage.isAmazonAccountLoggedIn() && customer.isLoggedIn()) {
- setShippingInformationAmazon();
- } else if (amazonStorage.isAmazonAccountLoggedIn() && !customer.isLoggedIn()) {
-
- if (this.validateGuestEmail()) {
- setShippingInformationAmazon();
- }
- //if using guest checkout or guest checkout with amazon pay we need to use the main validation
- } else if (this.validateShippingInformation()) {
- setShippingInformationAmazon();
+ if (!customer.isLoggedIn()) {
+ return this.validateGuestEmail();
}
+
+ return true;
}
});
}