@paypal/merchant-onboarding-sdk 1.0.0 → 1.0.2

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.
@@ -48134,11 +48134,11 @@ var LoadingWrapper = function LoadingWrapper(props) {
48134
48134
  return /*#__PURE__*/index_js_eager_default().createElement((index_js_eager_default()).Fragment, null, isLoading && /*#__PURE__*/index_js_eager_default().createElement("div", {
48135
48135
  id: "loadingWrapper",
48136
48136
  style: {
48137
- width: "100%",
48138
- height: "100%",
48139
- display: "flex",
48140
- justifyContent: "center",
48141
- alignItems: "center"
48137
+ width: '100%',
48138
+ height: '100%',
48139
+ display: 'flex',
48140
+ justifyContent: 'center',
48141
+ alignItems: 'center'
48142
48142
  }
48143
48143
  }, /*#__PURE__*/index_js_eager_default().createElement(pp_react_loading_spinner_esm_LoadingSpinner, {
48144
48144
  size: "lg"
@@ -48196,6 +48196,9 @@ var trackActivity = function trackActivity(eventName) {
48196
48196
  });
48197
48197
  ;// ./src/components/ErrorBoundary.js
48198
48198
  function ErrorBoundary_typeof(o) { "@babel/helpers - typeof"; return ErrorBoundary_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; }, ErrorBoundary_typeof(o); }
48199
+ function ErrorBoundary_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ErrorBoundary_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" == ErrorBoundary_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(ErrorBoundary_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; }
48200
+ function ErrorBoundary_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); }
48201
+ function ErrorBoundary_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ErrorBoundary_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ErrorBoundary_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
48199
48202
  function ErrorBoundary_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
48200
48203
  function ErrorBoundary_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ErrorBoundary_toPropertyKey(o.key), o); } }
48201
48204
  function ErrorBoundary_createClass(e, r, t) { return r && ErrorBoundary_defineProperties(e.prototype, r), t && ErrorBoundary_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -48243,9 +48246,24 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
48243
48246
  console.log(JSON.stringify(this.state.errorInfo));
48244
48247
  var buttonOptions = {
48245
48248
  title: 'Try Again',
48246
- onClick: function onClick() {
48247
- window.Paypal.onboard.onSDKError(_this2.state.error, _this2.state.errorInfo);
48248
- }
48249
+ onClick: function () {
48250
+ var _onClick = ErrorBoundary_asyncToGenerator(/*#__PURE__*/ErrorBoundary_regeneratorRuntime().mark(function _callee() {
48251
+ return ErrorBoundary_regeneratorRuntime().wrap(function _callee$(_context) {
48252
+ while (1) switch (_context.prev = _context.next) {
48253
+ case 0:
48254
+ _context.next = 2;
48255
+ return window.Paypal.onboard.onSDKError(_this2.state.error, _this2.state.errorInfo);
48256
+ case 2:
48257
+ case "end":
48258
+ return _context.stop();
48259
+ }
48260
+ }, _callee);
48261
+ }));
48262
+ function onClick() {
48263
+ return _onClick.apply(this, arguments);
48264
+ }
48265
+ return onClick;
48266
+ }()
48249
48267
  };
48250
48268
  tracking.trackActivity('onboarding_sdk_error_boundary', {
48251
48269
  message: String(this.state.error.message)
@@ -48773,160 +48791,195 @@ var onboard = {
48773
48791
  return this;
48774
48792
  },
48775
48793
  onProgress: function onProgress(progress) {
48776
- /**
48777
- * This is executed as we're going on the flow
48778
- * The partner can:
48779
- * - send webhooks
48780
- * - update UI with progress bar
48781
- *
48782
- * TODO: define structure of progress object
48783
- */
48784
- if (typeof this.options.onProgress === 'function') {
48785
- tracking.trackActivity('onboarding_sdk_on_progress_callback', {
48786
- message: progress
48787
- });
48788
- this.options.onProgress(progress);
48789
- }
48790
- },
48791
- onComplete: function onComplete() {
48792
- /**
48793
- * This is executed after onboarding is done
48794
- * The partner can:
48795
- * - send webhooks
48796
- * - redirect
48797
- *
48798
- */
48799
- //TODO we may want to add a parameter with the done page status/ products + statuses
48800
- if (typeof this.options.onComplete === 'function') {
48801
- tracking.trackActivity('onboarding_sdk_on_complete_callback');
48802
- this.options.onComplete();
48803
- }
48804
- },
48805
- onAccessTokenExpiry: function onAccessTokenExpiry() {
48806
48794
  var _this = this;
48807
48795
  return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee() {
48808
48796
  return src_regeneratorRuntime().wrap(function _callee$(_context) {
48809
48797
  while (1) switch (_context.prev = _context.next) {
48810
48798
  case 0:
48811
- if (!(typeof _this.options.onAccessTokenExpiry === 'function')) {
48812
- _context.next = 5;
48799
+ if (!(typeof _this.options.onProgress === 'function')) {
48800
+ _context.next = 4;
48813
48801
  break;
48814
48802
  }
48815
- tracking.trackActivity('onboarding_sdk_on_access_token_expiry_callback');
48803
+ tracking.trackActivity('onboarding_sdk_on_progress_callback', {
48804
+ message: progress
48805
+ });
48816
48806
  _context.next = 4;
48817
- return _this.options.onAccessTokenExpiry();
48807
+ return _this.options.onProgress(progress);
48818
48808
  case 4:
48819
- return _context.abrupt("return", _context.sent);
48820
- case 5:
48821
48809
  case "end":
48822
48810
  return _context.stop();
48823
48811
  }
48824
48812
  }, _callee);
48825
48813
  }))();
48826
48814
  },
48815
+ onComplete: function onComplete() {
48816
+ var _this2 = this;
48817
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee2() {
48818
+ return src_regeneratorRuntime().wrap(function _callee2$(_context2) {
48819
+ while (1) switch (_context2.prev = _context2.next) {
48820
+ case 0:
48821
+ if (!(typeof _this2.options.onComplete === 'function')) {
48822
+ _context2.next = 4;
48823
+ break;
48824
+ }
48825
+ tracking.trackActivity('onboarding_sdk_on_complete_callback');
48826
+ _context2.next = 4;
48827
+ return _this2.options.onComplete();
48828
+ case 4:
48829
+ case "end":
48830
+ return _context2.stop();
48831
+ }
48832
+ }, _callee2);
48833
+ }))();
48834
+ },
48835
+ onAccessTokenExpiry: function onAccessTokenExpiry() {
48836
+ var _this3 = this;
48837
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee3() {
48838
+ return src_regeneratorRuntime().wrap(function _callee3$(_context3) {
48839
+ while (1) switch (_context3.prev = _context3.next) {
48840
+ case 0:
48841
+ if (!(typeof _this3.options.onAccessTokenExpiry === 'function')) {
48842
+ _context3.next = 5;
48843
+ break;
48844
+ }
48845
+ tracking.trackActivity('onboarding_sdk_on_access_token_expiry_callback');
48846
+ _context3.next = 4;
48847
+ return _this3.options.onAccessTokenExpiry();
48848
+ case 4:
48849
+ return _context3.abrupt("return", _context3.sent);
48850
+ case 5:
48851
+ case "end":
48852
+ return _context3.stop();
48853
+ }
48854
+ }, _callee3);
48855
+ }))();
48856
+ },
48827
48857
  onReferralTokenExpiry: function onReferralTokenExpiry() {
48828
- /**
48829
- * This is executed when the partner referral token expires.
48830
- * It is partner responsibility to provide a new actionUrl with the referral token
48831
- * It is sdk responsibility to update the PayPal object
48832
- *
48833
- */
48834
- if (typeof this.options.onReferralTokenExpiry === 'function') {
48835
- tracking.trackActivity('onboarding_sdk_on_referral_token_expiry_callback');
48836
- this.options.onReferralTokenExpiry();
48837
- }
48838
- //TODO update referral token and retry
48858
+ var _this4 = this;
48859
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee4() {
48860
+ return src_regeneratorRuntime().wrap(function _callee4$(_context4) {
48861
+ while (1) switch (_context4.prev = _context4.next) {
48862
+ case 0:
48863
+ if (!(typeof _this4.options.onReferralTokenExpiry === 'function')) {
48864
+ _context4.next = 4;
48865
+ break;
48866
+ }
48867
+ tracking.trackActivity('onboarding_sdk_on_referral_token_expiry_callback');
48868
+ _context4.next = 4;
48869
+ return _this4.options.onReferralTokenExpiry();
48870
+ case 4:
48871
+ case "end":
48872
+ return _context4.stop();
48873
+ }
48874
+ }, _callee4);
48875
+ }))();
48839
48876
  },
48840
48877
  onCancel: function onCancel() {
48841
- /**
48842
- * This is executed after cancelling midway through onboarding process.This event won't be triggered if the user close the window or the session expires
48843
- * The partner can:
48844
- * - send webhooks
48845
- * - redirect
48846
- *
48847
- */
48848
- if (typeof this.options.onCancel === 'function') {
48849
- tracking.trackActivity('onboarding_sdk_on_cancel_callback');
48850
- this.options.onCancel();
48851
- }
48878
+ var _this5 = this;
48879
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee5() {
48880
+ return src_regeneratorRuntime().wrap(function _callee5$(_context5) {
48881
+ while (1) switch (_context5.prev = _context5.next) {
48882
+ case 0:
48883
+ if (!(typeof _this5.options.onCancel === 'function')) {
48884
+ _context5.next = 4;
48885
+ break;
48886
+ }
48887
+ tracking.trackActivity('onboarding_sdk_on_cancel_callback');
48888
+ _context5.next = 4;
48889
+ return _this5.options.onCancel();
48890
+ case 4:
48891
+ case "end":
48892
+ return _context5.stop();
48893
+ }
48894
+ }, _callee5);
48895
+ }))();
48852
48896
  },
48853
48897
  onError: function onError(error, errorInfo) {
48854
- /**
48855
- * Possible errors we are going to handle here:
48856
- * - terminal error after reaching retry attempts on retry page on EOP.
48857
- * - invalid referral token
48858
- * - invalid access token
48859
- *
48860
- * The partner can:
48861
- * - send webhooks
48862
- * - redirect
48863
- * - refresh the page
48864
- *
48865
- */
48866
- //TODO set a default behaviour in case the user doesn't define anything. Maybe refresh the page (window.location.reload())?
48867
- if (typeof this.options.onError === 'function') {
48868
- tracking.trackActivity('onboarding_sdk_on_error_callback', {
48869
- message: error
48870
- });
48871
- this.options.onError(error, errorInfo);
48872
- }
48898
+ var _this6 = this;
48899
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee6() {
48900
+ return src_regeneratorRuntime().wrap(function _callee6$(_context6) {
48901
+ while (1) switch (_context6.prev = _context6.next) {
48902
+ case 0:
48903
+ if (!(typeof _this6.options.onError === 'function')) {
48904
+ _context6.next = 4;
48905
+ break;
48906
+ }
48907
+ tracking.trackActivity('onboarding_sdk_on_error_callback', {
48908
+ message: error
48909
+ });
48910
+ _context6.next = 4;
48911
+ return _this6.options.onError(error, errorInfo);
48912
+ case 4:
48913
+ case "end":
48914
+ return _context6.stop();
48915
+ }
48916
+ }, _callee6);
48917
+ }))();
48873
48918
  },
48874
48919
  onSDKError: function onSDKError(error, errorInfo) {
48875
- /**
48876
- * Possible errors we are going to handle here:
48877
- * - error when using module federation
48878
- *
48879
- * By default, the SDK will show an errorPage so the user can retry. Here you will set the action when you click on the retry button
48880
- * The partner can:
48881
- * - send webhooks
48882
- * - redirect
48883
- * - refresh the page
48884
- *
48885
- */
48886
- //TODO set a default behaviour in case the user doesn't define anything. Maybe refresh the page (window.location.reload())?
48887
- if (typeof this.options.onSDKError === 'function') {
48888
- tracking.trackActivity('onboarding_sdk_on_sdk_error_callback', {
48889
- message: error
48890
- });
48891
- this.options.onSDKError(error, errorInfo);
48892
- }
48920
+ var _this7 = this;
48921
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee7() {
48922
+ return src_regeneratorRuntime().wrap(function _callee7$(_context7) {
48923
+ while (1) switch (_context7.prev = _context7.next) {
48924
+ case 0:
48925
+ if (!(typeof _this7.options.onSDKError === 'function')) {
48926
+ _context7.next = 4;
48927
+ break;
48928
+ }
48929
+ tracking.trackActivity('onboarding_sdk_on_sdk_error_callback', {
48930
+ message: error
48931
+ });
48932
+ _context7.next = 4;
48933
+ return _this7.options.onSDKError(error, errorInfo);
48934
+ case 4:
48935
+ case "end":
48936
+ return _context7.stop();
48937
+ }
48938
+ }, _callee7);
48939
+ }))();
48893
48940
  },
48894
48941
  onContactUs: function onContactUs() {
48895
- /**
48896
- * This is executed after onboarding gets declined or cancelled in the done page and the user should contact Paypal/partner for support
48897
- * The partner can:
48898
- * - send webhooks
48899
- * - redirect
48900
- *
48901
- */
48902
- // TODO check https://www.figma.com/design/ApGBMh9f6I28xqXDqQ3RDw/Merchant-Onboarding-5.0?node-id=834-67535&p=f&t=cx5exeAYntDi1egO-0
48903
- if (typeof this.options.onContactUs === 'function') {
48904
- tracking.trackActivity('onboarding_sdk_on_contact_us_callback');
48905
- this.options.onContactUs();
48906
- }
48942
+ var _this8 = this;
48943
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee8() {
48944
+ return src_regeneratorRuntime().wrap(function _callee8$(_context8) {
48945
+ while (1) switch (_context8.prev = _context8.next) {
48946
+ case 0:
48947
+ if (!(typeof _this8.options.onContactUs === 'function')) {
48948
+ _context8.next = 4;
48949
+ break;
48950
+ }
48951
+ tracking.trackActivity('onboarding_sdk_on_contact_us_callback');
48952
+ _context8.next = 4;
48953
+ return _this8.options.onContactUs();
48954
+ case 4:
48955
+ case "end":
48956
+ return _context8.stop();
48957
+ }
48958
+ }, _callee8);
48959
+ }))();
48907
48960
  },
48908
48961
  onLoginRequested: function onLoginRequested(spokePayerId) {
48909
- var _this2 = this;
48910
- return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee2() {
48911
- return src_regeneratorRuntime().wrap(function _callee2$(_context2) {
48912
- while (1) switch (_context2.prev = _context2.next) {
48962
+ var _this9 = this;
48963
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee9() {
48964
+ return src_regeneratorRuntime().wrap(function _callee9$(_context9) {
48965
+ while (1) switch (_context9.prev = _context9.next) {
48913
48966
  case 0:
48914
- if (!(typeof _this2.options.onLoginRequested === 'function')) {
48915
- _context2.next = 5;
48967
+ if (!(typeof _this9.options.onLoginRequested === 'function')) {
48968
+ _context9.next = 5;
48916
48969
  break;
48917
48970
  }
48918
48971
  tracking.trackActivity('onboarding_sdk_on_login_requested_callback', {
48919
48972
  message: spokePayerId
48920
48973
  });
48921
- _context2.next = 4;
48922
- return _this2.options.onLoginRequested(spokePayerId);
48974
+ _context9.next = 4;
48975
+ return _this9.options.onLoginRequested(spokePayerId);
48923
48976
  case 4:
48924
- return _context2.abrupt("return", _context2.sent);
48977
+ return _context9.abrupt("return", _context9.sent);
48925
48978
  case 5:
48926
48979
  case "end":
48927
- return _context2.stop();
48980
+ return _context9.stop();
48928
48981
  }
48929
- }, _callee2);
48982
+ }, _callee9);
48930
48983
  }))();
48931
48984
  },
48932
48985
  render: function render(elementId) {
@@ -48941,43 +48994,43 @@ var onboard = {
48941
48994
  * directly by external code.
48942
48995
  */
48943
48996
  _getClientToken: function _getClientToken() {
48944
- var _this3 = this;
48945
- return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee3() {
48997
+ var _this0 = this;
48998
+ return src_asyncToGenerator(/*#__PURE__*/src_regeneratorRuntime().mark(function _callee0() {
48946
48999
  var accessToken, _ref, message, stack, name;
48947
- return src_regeneratorRuntime().wrap(function _callee3$(_context3) {
48948
- while (1) switch (_context3.prev = _context3.next) {
49000
+ return src_regeneratorRuntime().wrap(function _callee0$(_context0) {
49001
+ while (1) switch (_context0.prev = _context0.next) {
48949
49002
  case 0:
48950
- _context3.prev = 0;
48951
- if (!isTokenExpired(_this3.options.accessToken)) {
48952
- _context3.next = 6;
49003
+ _context0.prev = 0;
49004
+ if (!isTokenExpired(_this0.options.accessToken)) {
49005
+ _context0.next = 6;
48953
49006
  break;
48954
49007
  }
48955
- _context3.next = 4;
48956
- return _this3.options.onAccessTokenExpiry();
49008
+ _context0.next = 4;
49009
+ return _this0.options.onAccessTokenExpiry();
48957
49010
  case 4:
48958
- accessToken = _context3.sent;
48959
- _this3.options.accessToken = accessToken;
49011
+ accessToken = _context0.sent;
49012
+ _this0.options.accessToken = accessToken;
48960
49013
  case 6:
48961
49014
  tracking.trackActivity('onboarding_sdk_get_client_token');
48962
- return _context3.abrupt("return", _this3.options.accessToken);
49015
+ return _context0.abrupt("return", _this0.options.accessToken);
48963
49016
  case 10:
48964
- _context3.prev = 10;
48965
- _context3.t0 = _context3["catch"](0);
48966
- _ref = _context3.t0 || {}, message = _ref.message, stack = _ref.stack, name = _ref.name;
49017
+ _context0.prev = 10;
49018
+ _context0.t0 = _context0["catch"](0);
49019
+ _ref = _context0.t0 || {}, message = _ref.message, stack = _ref.stack, name = _ref.name;
48967
49020
  console.log('merchant-onboarding-sdk::error_getting_client_token', {
48968
49021
  message: message,
48969
49022
  stack: stack,
48970
49023
  name: name
48971
49024
  });
48972
49025
  tracking.trackActivity('onboarding_sdk_get_client_token_error', {
48973
- message: _context3.t0
49026
+ message: _context0.t0
48974
49027
  });
48975
- throw _context3.t0;
49028
+ throw _context0.t0;
48976
49029
  case 16:
48977
49030
  case "end":
48978
- return _context3.stop();
49031
+ return _context0.stop();
48979
49032
  }
48980
- }, _callee3, null, [[0, 10]]);
49033
+ }, _callee0, null, [[0, 10]]);
48981
49034
  }))();
48982
49035
  }
48983
49036
  };