ordering-components-external 13.2.15 → 13.2.16
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.e9db5c24b106074faad6.js → 7.ordering-component.6b92f3ab4699d251734f.js} +1 -1
- package/_bundles/ordering-component.6b92f3ab4699d251734f.js +2 -0
- package/_modules/components/Checkout/index.js +19 -1
- package/_modules/components/PaymentOptionStripeLink/index.js +154 -0
- package/_modules/components/PaymentOptions/index.js +16 -16
- package/_modules/index.js +7 -0
- package/package.json +1 -1
- package/src/components/Checkout/index.js +17 -1
- package/src/components/PaymentOptionStripeLink/index.js +91 -0
- package/src/components/PaymentOptions/index.js +7 -6
- package/src/index.js +2 -0
- package/_bundles/ordering-component.e9db5c24b106074faad6.js +0 -2
- /package/_bundles/{0.ordering-component.e9db5c24b106074faad6.js → 0.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{1.ordering-component.e9db5c24b106074faad6.js → 1.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{2.ordering-component.e9db5c24b106074faad6.js → 2.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{4.ordering-component.e9db5c24b106074faad6.js → 4.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{5.ordering-component.e9db5c24b106074faad6.js → 5.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{6.ordering-component.e9db5c24b106074faad6.js → 6.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{7.ordering-component.e9db5c24b106074faad6.js.LICENSE.txt → 7.ordering-component.6b92f3ab4699d251734f.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-component.e9db5c24b106074faad6.js → 8.ordering-component.6b92f3ab4699d251734f.js} +0 -0
- /package/_bundles/{ordering-component.e9db5c24b106074faad6.js.LICENSE.txt → ordering-component.6b92f3ab4699d251734f.js.LICENSE.txt} +0 -0
|
@@ -49,7 +49,8 @@ var Checkout = exports.Checkout = function Checkout(props) {
|
|
|
49
49
|
UIComponent = props.UIComponent,
|
|
50
50
|
isApp = props.isApp,
|
|
51
51
|
isKiosk = props.isKiosk,
|
|
52
|
-
isCustomerMode = props.isCustomerMode
|
|
52
|
+
isCustomerMode = props.isCustomerMode,
|
|
53
|
+
handleOrderRedirect = props.handleOrderRedirect;
|
|
53
54
|
var _useApi = (0, _ApiContext.useApi)(),
|
|
54
55
|
_useApi2 = _slicedToArray(_useApi, 1),
|
|
55
56
|
ordering = _useApi2[0];
|
|
@@ -847,6 +848,23 @@ var Checkout = exports.Checkout = function Checkout(props) {
|
|
|
847
848
|
setDeliveryOptionSelected(cart === null || cart === void 0 ? void 0 : cart.delivery_option_id);
|
|
848
849
|
}
|
|
849
850
|
}, [cart === null || cart === void 0 ? void 0 : cart.delivery_option_id]);
|
|
851
|
+
(0, _react.useEffect)(function () {
|
|
852
|
+
var _socket$socket;
|
|
853
|
+
var handleCartUpdate = function handleCartUpdate(cart) {
|
|
854
|
+
var _cart$order, _cart$order2;
|
|
855
|
+
if ((cart === null || cart === void 0 ? void 0 : cart.status) !== 1 || !(cart !== null && cart !== void 0 && (_cart$order = cart.order) !== null && _cart$order !== void 0 && _cart$order.uuid)) return;
|
|
856
|
+
handleOrderRedirect && handleOrderRedirect(cart === null || cart === void 0 || (_cart$order2 = cart.order) === null || _cart$order2 === void 0 ? void 0 : _cart$order2.uuid);
|
|
857
|
+
};
|
|
858
|
+
if (isCustomerMode && socket !== null && socket !== void 0 && (_socket$socket = socket.socket) !== null && _socket$socket !== void 0 && (_socket$socket = _socket$socket._callbacks) !== null && _socket$socket !== void 0 && _socket$socket.$carts_update) {
|
|
859
|
+
socket.on('carts_update', handleCartUpdate);
|
|
860
|
+
}
|
|
861
|
+
return function () {
|
|
862
|
+
var _socket$socket2;
|
|
863
|
+
if (isCustomerMode && socket !== null && socket !== void 0 && (_socket$socket2 = socket.socket) !== null && _socket$socket2 !== void 0 && (_socket$socket2 = _socket$socket2._callbacks) !== null && _socket$socket2 !== void 0 && _socket$socket2.$carts_update) {
|
|
864
|
+
socket.off('carts_update', handleCartUpdate);
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
}, [socket, isCustomerMode]);
|
|
850
868
|
(0, _react.useEffect)(function () {
|
|
851
869
|
if (!isKiosk) {
|
|
852
870
|
Promise.all([getDeliveryOptions(), getLoyaltyPlans()].map(function (promise) {
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PaymentOptionStripeLink = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _LanguageContext = require("../../contexts/LanguageContext");
|
|
11
|
+
var _ApiContext = require("../../contexts/ApiContext");
|
|
12
|
+
var _ToastContext = require("../../contexts/ToastContext");
|
|
13
|
+
var _SessionContext = require("../../contexts/SessionContext");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
19
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
20
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
27
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
29
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
30
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
31
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
|
+
/**
|
|
33
|
+
* Component to manage payment option stripe link behavior UI component
|
|
34
|
+
*/
|
|
35
|
+
var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function PaymentOptionStripeLink(props) {
|
|
36
|
+
var UIComponent = props.UIComponent,
|
|
37
|
+
paymentURL = props.paymentURL;
|
|
38
|
+
var _useApi = (0, _ApiContext.useApi)(),
|
|
39
|
+
_useApi2 = _slicedToArray(_useApi, 1),
|
|
40
|
+
ordering = _useApi2[0];
|
|
41
|
+
var _useSession = (0, _SessionContext.useSession)(),
|
|
42
|
+
_useSession2 = _slicedToArray(_useSession, 1),
|
|
43
|
+
token = _useSession2[0].token;
|
|
44
|
+
var _useLanguage = (0, _LanguageContext.useLanguage)(),
|
|
45
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
46
|
+
t = _useLanguage2[1];
|
|
47
|
+
var _useToast = (0, _ToastContext.useToast)(),
|
|
48
|
+
_useToast2 = _slicedToArray(_useToast, 2),
|
|
49
|
+
showToast = _useToast2[1].showToast;
|
|
50
|
+
var _useState = (0, _react.useState)({
|
|
51
|
+
loading: true,
|
|
52
|
+
error: null,
|
|
53
|
+
paymentURL: null
|
|
54
|
+
}),
|
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
+
stripeLinkState = _useState2[0],
|
|
57
|
+
setStripeLinkState = _useState2[1];
|
|
58
|
+
var _useState3 = (0, _react.useState)({}),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
userInfo = _useState4[0],
|
|
61
|
+
setUserInfo = _useState4[1];
|
|
62
|
+
var handleChangeUserInfo = function handleChangeUserInfo(changes) {
|
|
63
|
+
setUserInfo(_objectSpread(_objectSpread({}, userInfo), changes));
|
|
64
|
+
};
|
|
65
|
+
var handleSendStripeLink = /*#__PURE__*/function () {
|
|
66
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(type, callback) {
|
|
67
|
+
var data, response, _yield$response$json, result, error;
|
|
68
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
|
70
|
+
case 0:
|
|
71
|
+
_context.prev = 0;
|
|
72
|
+
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
73
|
+
loading: true
|
|
74
|
+
}));
|
|
75
|
+
data = {
|
|
76
|
+
type: type,
|
|
77
|
+
provider: (ordering === null || ordering === void 0 ? void 0 : ordering.project) === 'pizzahutmexico' ? 'custom' : 'twilio',
|
|
78
|
+
country_phone_code: userInfo.country_phone_code,
|
|
79
|
+
cellphone: userInfo.cellphone,
|
|
80
|
+
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
|
+
_context.next = 5;
|
|
83
|
+
return fetch("".concat(ordering.root, "/text_messages/send"), {
|
|
84
|
+
method: 'POST',
|
|
85
|
+
headers: {
|
|
86
|
+
'Content-Type': 'application/json',
|
|
87
|
+
Authorization: "Bearer ".concat(token),
|
|
88
|
+
'X-App-X': ordering.appId
|
|
89
|
+
},
|
|
90
|
+
body: JSON.stringify(data)
|
|
91
|
+
});
|
|
92
|
+
case 5:
|
|
93
|
+
response = _context.sent;
|
|
94
|
+
_context.next = 8;
|
|
95
|
+
return response.json();
|
|
96
|
+
case 8:
|
|
97
|
+
_yield$response$json = _context.sent;
|
|
98
|
+
result = _yield$response$json.result;
|
|
99
|
+
error = _yield$response$json.error;
|
|
100
|
+
if (!error) {
|
|
101
|
+
_context.next = 14;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
105
|
+
loading: false,
|
|
106
|
+
error: result
|
|
107
|
+
}));
|
|
108
|
+
return _context.abrupt("return");
|
|
109
|
+
case 14:
|
|
110
|
+
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
111
|
+
loading: false
|
|
112
|
+
}));
|
|
113
|
+
callback && callback();
|
|
114
|
+
showToast(_ToastContext.ToastType.Success, t('MESSAGE_SENT_SUCCESSFULLY', 'The link has been sent'));
|
|
115
|
+
_context.next = 22;
|
|
116
|
+
break;
|
|
117
|
+
case 19:
|
|
118
|
+
_context.prev = 19;
|
|
119
|
+
_context.t0 = _context["catch"](0);
|
|
120
|
+
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
121
|
+
loading: false,
|
|
122
|
+
error: [_context.t0.message]
|
|
123
|
+
}));
|
|
124
|
+
case 22:
|
|
125
|
+
case "end":
|
|
126
|
+
return _context.stop();
|
|
127
|
+
}
|
|
128
|
+
}, _callee, null, [[0, 19]]);
|
|
129
|
+
}));
|
|
130
|
+
return function handleSendStripeLink(_x, _x2) {
|
|
131
|
+
return _ref.apply(this, arguments);
|
|
132
|
+
};
|
|
133
|
+
}();
|
|
134
|
+
(0, _react.useEffect)(function () {
|
|
135
|
+
if (!paymentURL) return;
|
|
136
|
+
setStripeLinkState(_objectSpread(_objectSpread({}, stripeLinkState), {}, {
|
|
137
|
+
loading: false,
|
|
138
|
+
paymentURL: paymentURL
|
|
139
|
+
}));
|
|
140
|
+
}, [paymentURL]);
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, UIComponent && /*#__PURE__*/_react.default.createElement(UIComponent, _extends({}, props, {
|
|
142
|
+
userInfo: userInfo,
|
|
143
|
+
stripeLinkState: stripeLinkState,
|
|
144
|
+
setStripeLinkState: setStripeLinkState,
|
|
145
|
+
handleSendStripeLink: handleSendStripeLink,
|
|
146
|
+
handleChangeUserInfo: handleChangeUserInfo
|
|
147
|
+
})));
|
|
148
|
+
};
|
|
149
|
+
PaymentOptionStripeLink.propTypes = {
|
|
150
|
+
/**
|
|
151
|
+
* UI Component, this must be containt all graphic elements and use parent props
|
|
152
|
+
*/
|
|
153
|
+
UIComponent: _propTypes.default.elementType
|
|
154
|
+
};
|
|
@@ -29,9 +29,10 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
29
29
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
30
30
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
31
31
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
|
+
var stripeLink = 'stripe_link';
|
|
32
33
|
var paymethodsExisting = ['stripe', 'stripe_direct', 'stripe_connect', 'paypal', 'square'];
|
|
33
34
|
var paymethodsNotAllowed = ['paypal_express', 'authorize'];
|
|
34
|
-
var paymethodsCallcenterMode = ['cash', 'card_delivery', 'ivrpay', '100_coupon'];
|
|
35
|
+
var paymethodsCallcenterMode = ['cash', 'card_delivery', 'ivrpay', '100_coupon', stripeLink];
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* Component to manage payment options behavior without UI component
|
|
@@ -59,7 +60,7 @@ var PaymentOptions = exports.PaymentOptions = function PaymentOptions(props) {
|
|
|
59
60
|
changePaymethod = _useOrder2[1].changePaymethod;
|
|
60
61
|
var _useSession = (0, _SessionContext.useSession)(),
|
|
61
62
|
_useSession2 = _slicedToArray(_useSession, 1),
|
|
62
|
-
|
|
63
|
+
device_code = _useSession2[0].device_code;
|
|
63
64
|
var orderTotal = ((_orderState$carts = orderState.carts) === null || _orderState$carts === void 0 || (_orderState$carts = _orderState$carts["businessId:".concat(businessId)]) === null || _orderState$carts === void 0 ? void 0 : _orderState$carts.total) || 0;
|
|
64
65
|
var _useState = (0, _react.useState)({
|
|
65
66
|
paymethods: [],
|
|
@@ -87,7 +88,7 @@ var PaymentOptions = exports.PaymentOptions = function PaymentOptions(props) {
|
|
|
87
88
|
var parsePaymethods = function parsePaymethods(paymethods) {
|
|
88
89
|
var _paymethods = paymethods && paymethods.filter(function (credentials) {
|
|
89
90
|
var _credentials$paymetho, _credentials$paymetho2, _credentials$paymetho3;
|
|
90
|
-
return isCustomerMode ? !paymethodsNotAllowed.includes(credentials === null || credentials === void 0 || (_credentials$paymetho = credentials.paymethod) === null || _credentials$paymetho === void 0 ? void 0 : _credentials$paymetho.gateway) && (isAlsea || paymethodsCallcenterMode.includes(credentials === null || credentials === void 0 || (_credentials$paymetho2 = credentials.paymethod) === null || _credentials$paymetho2 === void 0 ? void 0 : _credentials$paymetho2.gateway)) : !paymethodsNotAllowed.includes(credentials === null || credentials === void 0 || (_credentials$paymetho3 = credentials.paymethod) === null || _credentials$paymetho3 === void 0 ? void 0 : _credentials$paymetho3.gateway);
|
|
91
|
+
return isCustomerMode ? !paymethodsNotAllowed.includes(credentials === null || credentials === void 0 || (_credentials$paymetho = credentials.paymethod) === null || _credentials$paymetho === void 0 ? void 0 : _credentials$paymetho.gateway) && (isAlsea || paymethodsCallcenterMode.includes(credentials === null || credentials === void 0 || (_credentials$paymetho2 = credentials.paymethod) === null || _credentials$paymetho2 === void 0 ? void 0 : _credentials$paymetho2.gateway)) : ![].concat(paymethodsNotAllowed, [stripeLink]).includes(credentials === null || credentials === void 0 || (_credentials$paymetho3 = credentials.paymethod) === null || _credentials$paymetho3 === void 0 ? void 0 : _credentials$paymetho3.gateway);
|
|
91
92
|
}).map(function (credentials) {
|
|
92
93
|
return _objectSpread(_objectSpread({}, credentials === null || credentials === void 0 ? void 0 : credentials.paymethod), {}, {
|
|
93
94
|
sandbox: credentials === null || credentials === void 0 ? void 0 : credentials.sandbox,
|
|
@@ -102,23 +103,22 @@ var PaymentOptions = exports.PaymentOptions = function PaymentOptions(props) {
|
|
|
102
103
|
*/
|
|
103
104
|
var getPaymentOptions = /*#__PURE__*/function () {
|
|
104
105
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
105
|
-
var
|
|
106
|
+
var headers, _yield$ordering$busin, _yield$ordering$busin2, error, result;
|
|
106
107
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
107
108
|
while (1) switch (_context.prev = _context.next) {
|
|
108
109
|
case 0:
|
|
109
110
|
setPaymethodsList(_objectSpread(_objectSpread({}, paymethodsList), {}, {
|
|
110
111
|
loading: true
|
|
111
112
|
}));
|
|
112
|
-
deviceCode = sessionState === null || sessionState === void 0 ? void 0 : sessionState.device_code;
|
|
113
113
|
headers = {
|
|
114
|
-
'X-Physical-Device-Code-X': "".concat(
|
|
114
|
+
'X-Physical-Device-Code-X': "".concat(device_code)
|
|
115
115
|
};
|
|
116
|
-
_context.prev =
|
|
117
|
-
_context.next =
|
|
118
|
-
return ordering.businesses(businessId).get(
|
|
116
|
+
_context.prev = 2;
|
|
117
|
+
_context.next = 5;
|
|
118
|
+
return ordering.businesses(businessId).get(device_code ? {
|
|
119
119
|
headers: headers
|
|
120
120
|
} : {});
|
|
121
|
-
case
|
|
121
|
+
case 5:
|
|
122
122
|
_yield$ordering$busin = _context.sent;
|
|
123
123
|
_yield$ordering$busin2 = _yield$ordering$busin.content;
|
|
124
124
|
error = _yield$ordering$busin2.error;
|
|
@@ -131,20 +131,20 @@ var PaymentOptions = exports.PaymentOptions = function PaymentOptions(props) {
|
|
|
131
131
|
error: error ? result : null,
|
|
132
132
|
paymethods: error ? [] : parsePaymethods(result.paymethods)
|
|
133
133
|
}));
|
|
134
|
-
_context.next =
|
|
134
|
+
_context.next = 16;
|
|
135
135
|
break;
|
|
136
|
-
case
|
|
137
|
-
_context.prev =
|
|
138
|
-
_context.t0 = _context["catch"](
|
|
136
|
+
case 13:
|
|
137
|
+
_context.prev = 13;
|
|
138
|
+
_context.t0 = _context["catch"](2);
|
|
139
139
|
setPaymethodsList(_objectSpread(_objectSpread({}, paymethodsList), {}, {
|
|
140
140
|
loading: false,
|
|
141
141
|
error: [_context.t0.message]
|
|
142
142
|
}));
|
|
143
|
-
case
|
|
143
|
+
case 16:
|
|
144
144
|
case "end":
|
|
145
145
|
return _context.stop();
|
|
146
146
|
}
|
|
147
|
-
}, _callee, null, [[
|
|
147
|
+
}, _callee, null, [[2, 13]]);
|
|
148
148
|
}));
|
|
149
149
|
return function getPaymentOptions() {
|
|
150
150
|
return _ref.apply(this, arguments);
|
package/_modules/index.js
CHANGED
|
@@ -699,6 +699,12 @@ Object.defineProperty(exports, "PaymentOptionStripeDirect", {
|
|
|
699
699
|
return _PaymentOptionStripeDirect.PaymentOptionStripeDirect;
|
|
700
700
|
}
|
|
701
701
|
});
|
|
702
|
+
Object.defineProperty(exports, "PaymentOptionStripeLink", {
|
|
703
|
+
enumerable: true,
|
|
704
|
+
get: function get() {
|
|
705
|
+
return _PaymentOptionStripeLink.PaymentOptionStripeLink;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
702
708
|
Object.defineProperty(exports, "PaymentOptionStripeRedirect", {
|
|
703
709
|
enumerable: true,
|
|
704
710
|
get: function get() {
|
|
@@ -1308,6 +1314,7 @@ var _PaymentOptionCash = require("./components/PaymentOptionCash");
|
|
|
1308
1314
|
var _PaymentOptionPaypal = require("./components/PaymentOptionPaypal");
|
|
1309
1315
|
var _PaymentOptionStripe = require("./components/PaymentOptionStripe");
|
|
1310
1316
|
var _PaymentOptionStripeDirect = require("./components/PaymentOptionStripeDirect");
|
|
1317
|
+
var _PaymentOptionStripeLink = require("./components/PaymentOptionStripeLink");
|
|
1311
1318
|
var _PaymentOptionStripeRedirect = require("./components/PaymentOptionStripeRedirect");
|
|
1312
1319
|
var _PaymentOptionSquare = require("./components/PaymentOptionSquare");
|
|
1313
1320
|
var _StripeElementsForm = require("./components/StripeElementsForm");
|
package/package.json
CHANGED
|
@@ -21,7 +21,8 @@ export const Checkout = (props) => {
|
|
|
21
21
|
UIComponent,
|
|
22
22
|
isApp,
|
|
23
23
|
isKiosk,
|
|
24
|
-
isCustomerMode
|
|
24
|
+
isCustomerMode,
|
|
25
|
+
handleOrderRedirect
|
|
25
26
|
} = props
|
|
26
27
|
|
|
27
28
|
const [ordering] = useApi()
|
|
@@ -503,6 +504,21 @@ export const Checkout = (props) => {
|
|
|
503
504
|
}
|
|
504
505
|
}, [cart?.delivery_option_id])
|
|
505
506
|
|
|
507
|
+
useEffect(() => {
|
|
508
|
+
const handleCartUpdate = (cart) => {
|
|
509
|
+
if (cart?.status !== 1 || !cart?.order?.uuid) return
|
|
510
|
+
handleOrderRedirect && handleOrderRedirect(cart?.order?.uuid)
|
|
511
|
+
}
|
|
512
|
+
if (isCustomerMode && socket?.socket?._callbacks?.$carts_update) {
|
|
513
|
+
socket.on('carts_update', handleCartUpdate)
|
|
514
|
+
}
|
|
515
|
+
return () => {
|
|
516
|
+
if (isCustomerMode && socket?.socket?._callbacks?.$carts_update) {
|
|
517
|
+
socket.off('carts_update', handleCartUpdate)
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}, [socket, isCustomerMode])
|
|
521
|
+
|
|
506
522
|
useEffect(() => {
|
|
507
523
|
if (!isKiosk) {
|
|
508
524
|
Promise.all(
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import { useLanguage } from '../../contexts/LanguageContext'
|
|
4
|
+
import { useApi } from '../../contexts/ApiContext'
|
|
5
|
+
import { useToast, ToastType } from '../../contexts/ToastContext'
|
|
6
|
+
import { useSession } from '../../contexts/SessionContext'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Component to manage payment option stripe link behavior UI component
|
|
10
|
+
*/
|
|
11
|
+
export const PaymentOptionStripeLink = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
UIComponent,
|
|
14
|
+
paymentURL
|
|
15
|
+
} = props
|
|
16
|
+
|
|
17
|
+
const [ordering] = useApi()
|
|
18
|
+
const [{ token }] = useSession()
|
|
19
|
+
const [, t] = useLanguage()
|
|
20
|
+
const [, { showToast }] = useToast()
|
|
21
|
+
|
|
22
|
+
const [stripeLinkState, setStripeLinkState] = useState({ loading: true, error: null, paymentURL: null })
|
|
23
|
+
const [userInfo, setUserInfo] = useState({})
|
|
24
|
+
|
|
25
|
+
const handleChangeUserInfo = (changes) => {
|
|
26
|
+
setUserInfo({ ...userInfo, ...changes })
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const handleSendStripeLink = async (type, callback) => {
|
|
30
|
+
try {
|
|
31
|
+
setStripeLinkState({ ...stripeLinkState, loading: true })
|
|
32
|
+
const data = {
|
|
33
|
+
type,
|
|
34
|
+
provider: ordering?.project === 'pizzahutmexico' ? 'custom' : 'twilio',
|
|
35
|
+
country_phone_code: userInfo.country_phone_code,
|
|
36
|
+
cellphone: userInfo.cellphone,
|
|
37
|
+
message: t('LINK_TO_PAY_MESSAGE',
|
|
38
|
+
'Hello there _name_ _lastname_, click on the following link to complete the payment: _link_')
|
|
39
|
+
.replace('_name_', userInfo?.name)
|
|
40
|
+
.replace('_lastname_', userInfo?.lastname)
|
|
41
|
+
.replace('_link_', paymentURL)
|
|
42
|
+
}
|
|
43
|
+
const response = await fetch(`${ordering.root}/text_messages/send`, {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
Authorization: `Bearer ${token}`,
|
|
48
|
+
'X-App-X': ordering.appId
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify(data)
|
|
51
|
+
})
|
|
52
|
+
const { result, error } = await response.json()
|
|
53
|
+
if (error) {
|
|
54
|
+
setStripeLinkState({ ...stripeLinkState, loading: false, error: result })
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
setStripeLinkState({ ...stripeLinkState, loading: false })
|
|
58
|
+
callback && callback()
|
|
59
|
+
showToast(ToastType.Success, t('MESSAGE_SENT_SUCCESSFULLY', 'The link has been sent'))
|
|
60
|
+
} catch (error) {
|
|
61
|
+
setStripeLinkState({ ...stripeLinkState, loading: false, error: [error.message] })
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!paymentURL) return
|
|
67
|
+
setStripeLinkState({ ...stripeLinkState, loading: false, paymentURL })
|
|
68
|
+
}, [paymentURL])
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
{UIComponent && (
|
|
73
|
+
<UIComponent
|
|
74
|
+
{...props}
|
|
75
|
+
userInfo={userInfo}
|
|
76
|
+
stripeLinkState={stripeLinkState}
|
|
77
|
+
setStripeLinkState={setStripeLinkState}
|
|
78
|
+
handleSendStripeLink={handleSendStripeLink}
|
|
79
|
+
handleChangeUserInfo={handleChangeUserInfo}
|
|
80
|
+
/>
|
|
81
|
+
)}
|
|
82
|
+
</>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
PaymentOptionStripeLink.propTypes = {
|
|
87
|
+
/**
|
|
88
|
+
* UI Component, this must be containt all graphic elements and use parent props
|
|
89
|
+
*/
|
|
90
|
+
UIComponent: PropTypes.elementType
|
|
91
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import React, { useEffect, useState } from 'react'
|
|
2
3
|
import PropTypes from 'prop-types'
|
|
3
4
|
import { useOrder } from '../../contexts/OrderContext'
|
|
@@ -5,9 +6,10 @@ import { useApi } from '../../contexts/ApiContext'
|
|
|
5
6
|
import { useEvent } from '../../contexts/EventContext'
|
|
6
7
|
import { useSession } from '../../contexts/SessionContext'
|
|
7
8
|
|
|
9
|
+
const stripeLink = 'stripe_link'
|
|
8
10
|
const paymethodsExisting = ['stripe', 'stripe_direct', 'stripe_connect', 'paypal', 'square']
|
|
9
11
|
const paymethodsNotAllowed = ['paypal_express', 'authorize']
|
|
10
|
-
const paymethodsCallcenterMode = ['cash', 'card_delivery', 'ivrpay', '100_coupon']
|
|
12
|
+
const paymethodsCallcenterMode = ['cash', 'card_delivery', 'ivrpay', '100_coupon', stripeLink]
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Component to manage payment options behavior without UI component
|
|
@@ -28,7 +30,7 @@ export const PaymentOptions = (props) => {
|
|
|
28
30
|
const [events] = useEvent()
|
|
29
31
|
const [ordering] = useApi()
|
|
30
32
|
const [orderState, { changePaymethod }] = useOrder()
|
|
31
|
-
const [
|
|
33
|
+
const [{ device_code }] = useSession()
|
|
32
34
|
const orderTotal = orderState.carts?.[`businessId:${businessId}`]?.total || 0
|
|
33
35
|
|
|
34
36
|
const [paymethodsList, setPaymethodsList] = useState({ paymethods: [], loading: true, error: null })
|
|
@@ -42,7 +44,7 @@ export const PaymentOptions = (props) => {
|
|
|
42
44
|
.filter(credentials => isCustomerMode
|
|
43
45
|
? !paymethodsNotAllowed.includes(credentials?.paymethod?.gateway) &&
|
|
44
46
|
(isAlsea || paymethodsCallcenterMode.includes(credentials?.paymethod?.gateway))
|
|
45
|
-
: !paymethodsNotAllowed.includes(credentials?.paymethod?.gateway))
|
|
47
|
+
: ![...paymethodsNotAllowed, stripeLink].includes(credentials?.paymethod?.gateway))
|
|
46
48
|
.map(credentials => {
|
|
47
49
|
return {
|
|
48
50
|
...credentials?.paymethod,
|
|
@@ -58,14 +60,13 @@ export const PaymentOptions = (props) => {
|
|
|
58
60
|
*/
|
|
59
61
|
const getPaymentOptions = async () => {
|
|
60
62
|
setPaymethodsList({ ...paymethodsList, loading: true })
|
|
61
|
-
const deviceCode = sessionState?.device_code
|
|
62
63
|
|
|
63
64
|
const headers = {
|
|
64
|
-
'X-Physical-Device-Code-X': `${
|
|
65
|
+
'X-Physical-Device-Code-X': `${device_code}`
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
try {
|
|
68
|
-
const { content: { error, result } } = await ordering.businesses(businessId).get(
|
|
69
|
+
const { content: { error, result } } = await ordering.businesses(businessId).get(device_code ? { headers } : {})
|
|
69
70
|
if (!error) {
|
|
70
71
|
paymethodsList.paymethods = parsePaymethods(result.paymethods)
|
|
71
72
|
}
|
package/src/index.js
CHANGED
|
@@ -115,6 +115,7 @@ import { PaymentOptionCash } from './components/PaymentOptionCash'
|
|
|
115
115
|
import { PaymentOptionPaypal } from './components/PaymentOptionPaypal'
|
|
116
116
|
import { PaymentOptionStripe } from './components/PaymentOptionStripe'
|
|
117
117
|
import { PaymentOptionStripeDirect } from './components/PaymentOptionStripeDirect'
|
|
118
|
+
import { PaymentOptionStripeLink } from './components/PaymentOptionStripeLink'
|
|
118
119
|
import { PaymentOptionStripeRedirect } from './components/PaymentOptionStripeRedirect'
|
|
119
120
|
import { PaymentOptionSquare } from './components/PaymentOptionSquare'
|
|
120
121
|
import { StripeElementsForm } from './components/StripeElementsForm'
|
|
@@ -265,6 +266,7 @@ export {
|
|
|
265
266
|
PaymentOptionPaypal,
|
|
266
267
|
PaymentOptionStripe,
|
|
267
268
|
PaymentOptionStripeDirect,
|
|
269
|
+
PaymentOptionStripeLink,
|
|
268
270
|
PaymentOptionStripeRedirect,
|
|
269
271
|
PaymentOptionSquare,
|
|
270
272
|
PhoneAutocomplete,
|