ordering-components-external 13.2.18 → 13.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{7.ordering-component.eda1dc4602f12077abd7.js → 7.ordering-component.14952af682175cdca2c7.js} +1 -1
- package/_bundles/{ordering-component.eda1dc4602f12077abd7.js → ordering-component.14952af682175cdca2c7.js} +2 -2
- package/_modules/components/PaymentOptionStripeLink/index.js +14 -13
- package/package.json +1 -1
- package/src/components/PaymentOptionStripeLink/index.js +2 -1
- /package/_bundles/{0.ordering-component.eda1dc4602f12077abd7.js → 0.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{1.ordering-component.eda1dc4602f12077abd7.js → 1.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{2.ordering-component.eda1dc4602f12077abd7.js → 2.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{4.ordering-component.eda1dc4602f12077abd7.js → 4.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{5.ordering-component.eda1dc4602f12077abd7.js → 5.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{6.ordering-component.eda1dc4602f12077abd7.js → 6.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{7.ordering-component.eda1dc4602f12077abd7.js.LICENSE.txt → 7.ordering-component.14952af682175cdca2c7.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-component.eda1dc4602f12077abd7.js → 8.ordering-component.14952af682175cdca2c7.js} +0 -0
- /package/_bundles/{ordering-component.eda1dc4602f12077abd7.js.LICENSE.txt → ordering-component.14952af682175cdca2c7.js.LICENSE.txt} +0 -0
|
@@ -64,7 +64,7 @@ var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function Payment
|
|
|
64
64
|
};
|
|
65
65
|
var handleSendStripeLink = /*#__PURE__*/function () {
|
|
66
66
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(type, callback) {
|
|
67
|
-
var data, response, _yield$response$json, result, error;
|
|
67
|
+
var customProviders, data, response, _yield$response$json, result, error;
|
|
68
68
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
69
69
|
while (1) switch (_context.prev = _context.next) {
|
|
70
70
|
case 0:
|
|
@@ -72,14 +72,15 @@ var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function Payment
|
|
|
72
72
|
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
73
73
|
loading: true
|
|
74
74
|
}));
|
|
75
|
+
customProviders = ['pizzahutstaging', 'pizzahutmexico'];
|
|
75
76
|
data = {
|
|
76
77
|
type: type,
|
|
77
|
-
provider: (ordering === null || ordering === void 0 ? void 0 : ordering.project)
|
|
78
|
+
provider: customProviders.includes(ordering === null || ordering === void 0 ? void 0 : ordering.project) ? 'custom' : 'twilio',
|
|
78
79
|
country_phone_code: userInfo.country_phone_code,
|
|
79
80
|
cellphone: userInfo.cellphone,
|
|
80
81
|
message: t('LINK_TO_PAY_MESSAGE', 'Hello there _name_ _lastname_, click on the following link to complete the payment: _link_').replace('_name_', userInfo === null || userInfo === void 0 ? void 0 : userInfo.name).replace('_lastname_', userInfo === null || userInfo === void 0 ? void 0 : userInfo.lastname).replace('_link_', paymentURL)
|
|
81
82
|
};
|
|
82
|
-
_context.next =
|
|
83
|
+
_context.next = 6;
|
|
83
84
|
return fetch("".concat(ordering.root, "/text_messages/send"), {
|
|
84
85
|
method: 'POST',
|
|
85
86
|
headers: {
|
|
@@ -89,16 +90,16 @@ var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function Payment
|
|
|
89
90
|
},
|
|
90
91
|
body: JSON.stringify(data)
|
|
91
92
|
});
|
|
92
|
-
case
|
|
93
|
+
case 6:
|
|
93
94
|
response = _context.sent;
|
|
94
|
-
_context.next =
|
|
95
|
+
_context.next = 9;
|
|
95
96
|
return response.json();
|
|
96
|
-
case
|
|
97
|
+
case 9:
|
|
97
98
|
_yield$response$json = _context.sent;
|
|
98
99
|
result = _yield$response$json.result;
|
|
99
100
|
error = _yield$response$json.error;
|
|
100
101
|
if (!error) {
|
|
101
|
-
_context.next =
|
|
102
|
+
_context.next = 15;
|
|
102
103
|
break;
|
|
103
104
|
}
|
|
104
105
|
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
@@ -106,26 +107,26 @@ var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function Payment
|
|
|
106
107
|
error: result
|
|
107
108
|
}));
|
|
108
109
|
return _context.abrupt("return");
|
|
109
|
-
case
|
|
110
|
+
case 15:
|
|
110
111
|
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
111
112
|
loading: false
|
|
112
113
|
}));
|
|
113
114
|
callback && callback();
|
|
114
115
|
showToast(_ToastContext.ToastType.Success, t('MESSAGE_SENT_SUCCESSFULLY', 'The link has been sent'));
|
|
115
|
-
_context.next =
|
|
116
|
+
_context.next = 23;
|
|
116
117
|
break;
|
|
117
|
-
case
|
|
118
|
-
_context.prev =
|
|
118
|
+
case 20:
|
|
119
|
+
_context.prev = 20;
|
|
119
120
|
_context.t0 = _context["catch"](0);
|
|
120
121
|
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
121
122
|
loading: false,
|
|
122
123
|
error: [_context.t0.message]
|
|
123
124
|
}));
|
|
124
|
-
case
|
|
125
|
+
case 23:
|
|
125
126
|
case "end":
|
|
126
127
|
return _context.stop();
|
|
127
128
|
}
|
|
128
|
-
}, _callee, null, [[0,
|
|
129
|
+
}, _callee, null, [[0, 20]]);
|
|
129
130
|
}));
|
|
130
131
|
return function handleSendStripeLink(_x, _x2) {
|
|
131
132
|
return _ref.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -29,9 +29,10 @@ export const PaymentOptionStripeLink = (props) => {
|
|
|
29
29
|
const handleSendStripeLink = async (type, callback) => {
|
|
30
30
|
try {
|
|
31
31
|
setStripeLinkState({ ...stripeLinkState, loading: true })
|
|
32
|
+
const customProviders = ['pizzahutstaging', 'pizzahutmexico']
|
|
32
33
|
const data = {
|
|
33
34
|
type,
|
|
34
|
-
provider: ordering?.project
|
|
35
|
+
provider: customProviders.includes(ordering?.project) ? 'custom' : 'twilio',
|
|
35
36
|
country_phone_code: userInfo.country_phone_code,
|
|
36
37
|
cellphone: userInfo.cellphone,
|
|
37
38
|
message: t('LINK_TO_PAY_MESSAGE',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|