@medipass/web-sdk 11.40.5-chore-eclipse-draft-endpoints.0 → 11.40.6-chore-add-new-sdk-function-and-test.0

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/index.js +1 -1
  3. package/lib/resources/accounts.js +1 -1
  4. package/lib/resources/actions.js +1 -1
  5. package/lib/resources/api-keys.js +1 -1
  6. package/lib/resources/applications.js +1 -1
  7. package/lib/resources/attachments.js +1 -1
  8. package/lib/resources/auth.js +1 -1
  9. package/lib/resources/bulk-submits.js +1 -1
  10. package/lib/resources/bulk-uploads.js +1 -1
  11. package/lib/resources/business-profiles.js +1 -1
  12. package/lib/resources/businesses.js +1 -1
  13. package/lib/resources/claim-items.js +1 -1
  14. package/lib/resources/devices.js +1 -1
  15. package/lib/resources/doc-accounts.js +1 -1
  16. package/lib/resources/documents.js +1 -1
  17. package/lib/resources/emails.js +1 -1
  18. package/lib/resources/form-application-templates.js +1 -1
  19. package/lib/resources/form-applications.js +1 -1
  20. package/lib/resources/forms.js +1 -1
  21. package/lib/resources/funder-services.js +1 -1
  22. package/lib/resources/funder-settings.js +1 -1
  23. package/lib/resources/funders.js +1 -1
  24. package/lib/resources/futures.js +1 -1
  25. package/lib/resources/health-fund-accounts.js +1 -1
  26. package/lib/resources/health-fund-settings.js +1 -1
  27. package/lib/resources/healthfunds.js +1 -1
  28. package/lib/resources/icditems.js +1 -1
  29. package/lib/resources/invoice-scans.js +1 -1
  30. package/lib/resources/jhcs.js +1 -1
  31. package/lib/resources/kyc.js +1 -1
  32. package/lib/resources/logs.js +1 -1
  33. package/lib/resources/members.js +1 -1
  34. package/lib/resources/message-mappings.js +1 -1
  35. package/lib/resources/minions.js +1 -1
  36. package/lib/resources/modalities.js +1 -1
  37. package/lib/resources/notes.js +1 -1
  38. package/lib/resources/onboarding-applications.js +1 -1
  39. package/lib/resources/onboarding-requests.js +1 -1
  40. package/lib/resources/ops.js +1 -1
  41. package/lib/resources/organisations.js +1 -1
  42. package/lib/resources/partners.js +1 -1
  43. package/lib/resources/patients.d.ts +8 -0
  44. package/lib/resources/patients.js +2 -1
  45. package/lib/resources/payments.d.ts +9 -1
  46. package/lib/resources/payments.js +2 -1
  47. package/lib/resources/pms.js +1 -1
  48. package/lib/resources/practice-profiles.js +1 -1
  49. package/lib/resources/practice-types.js +1 -1
  50. package/lib/resources/practices.js +1 -1
  51. package/lib/resources/products.js +1 -1
  52. package/lib/resources/professional-categories.js +1 -1
  53. package/lib/resources/provider-number-types.js +1 -1
  54. package/lib/resources/provider-registration-types.js +1 -1
  55. package/lib/resources/provider-requests.js +1 -1
  56. package/lib/resources/provider-types.js +1 -1
  57. package/lib/resources/ref-sources.js +1 -1
  58. package/lib/resources/risk.js +1 -1
  59. package/lib/resources/rnas.js +1 -1
  60. package/lib/resources/roles.js +1 -1
  61. package/lib/resources/self-checkout-sessions.js +1 -1
  62. package/lib/resources/services.js +1 -1
  63. package/lib/resources/settlements.js +1 -1
  64. package/lib/resources/sign-up.js +1 -1
  65. package/lib/resources/specialties.js +1 -1
  66. package/lib/resources/staff-profiles.js +1 -1
  67. package/lib/resources/staff.js +1 -1
  68. package/lib/resources/statistics.js +1 -1
  69. package/lib/resources/subscriptions.js +1 -1
  70. package/lib/resources/terminals.js +1 -1
  71. package/lib/resources/transaction-export.js +1 -1
  72. package/lib/resources/transactions.js +1 -1
  73. package/lib/resources/triggers.js +1 -1
  74. package/lib/resources/vendors.js +1 -1
  75. package/lib/resources/verify.js +1 -1
  76. package/lib/resources/workers.js +1 -1
  77. package/lib/resources/workflow-exceptions.js +1 -1
  78. package/lib/services/aws.js +1 -1
  79. package/lib/services/version.js +1 -1
  80. package/lib/{staff-0ea83917.js → staff-f9c0c953.js} +203 -109
  81. package/lib/utils/application.js +1 -1
  82. package/lib/utils/professions.js +1 -1
  83. package/lib/utils/request.js +1 -1
  84. package/lib/utils/staff.js +1 -1
  85. package/package.json +3 -3
@@ -9306,6 +9306,35 @@ var pathBusinessPatient = function pathBusinessPatient(businessId, patientId) {
9306
9306
  var pathBusinessPatientByRefId = function pathBusinessPatientByRefId(businessId, refId) {
9307
9307
  return "/businesses/" + businessId + "/patients/ref/" + refId;
9308
9308
  };
9309
+
9310
+ var pathRequestUpdatePatientPaymentMethod = function pathRequestUpdatePatientPaymentMethod(businessId, patientId) {
9311
+ return "/businesses/" + businessId + "/patients/" + patientId + "/paymentmethods/updaterequests";
9312
+ };
9313
+ /**
9314
+ * Update patient payment information by SMS or Link
9315
+ * @param {String} businessId - Business ID
9316
+ * @param {String} patientId - Patient ID
9317
+ * @param {Object} body - Request body
9318
+ * @param {Object} opts - Additional options
9319
+ */
9320
+
9321
+
9322
+ var requestUpdatePatientPaymentMethod = function requestUpdatePatientPaymentMethod(businessId, patientId, body, opts) {
9323
+ if (opts === void 0) {
9324
+ opts = {};
9325
+ }
9326
+
9327
+ doesParamExist.default({
9328
+ businessId: businessId,
9329
+ patientId: patientId
9330
+ }, opts.hyperMediaEndpoint);
9331
+ return request(_objectSpread$F({}, opts, {
9332
+ path: pathRequestUpdatePatientPaymentMethod(businessId, patientId)
9333
+ }), {
9334
+ method: 'post',
9335
+ data: body
9336
+ });
9337
+ };
9309
9338
  /**
9310
9339
  * Create a business patient
9311
9340
  * @param {String} businessId - Business ID
@@ -9313,7 +9342,6 @@ var pathBusinessPatientByRefId = function pathBusinessPatientByRefId(businessId,
9313
9342
  * @param {Object} opts - Additional options
9314
9343
  */
9315
9344
 
9316
-
9317
9345
  var createBusinessPatient = /*#__PURE__*/function () {
9318
9346
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(businessId, body, opts) {
9319
9347
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -9547,6 +9575,7 @@ var deleteBusinessPatient = /*#__PURE__*/function () {
9547
9575
 
9548
9576
  var patients = /*#__PURE__*/Object.freeze({
9549
9577
  __proto__: null,
9578
+ requestUpdatePatientPaymentMethod: requestUpdatePatientPaymentMethod,
9550
9579
  createBusinessPatient: createBusinessPatient,
9551
9580
  getBusinessPatients: getBusinessPatients,
9552
9581
  getBusinessPatient: getBusinessPatient,
@@ -9595,6 +9624,10 @@ var pathBusinessPatientPaymentMethod = function pathBusinessPatientPaymentMethod
9595
9624
  var pathBusinessSalesClientToken = function pathBusinessSalesClientToken(businessId) {
9596
9625
  return "/businesses/" + businessId + "/sales/clienttoken";
9597
9626
  };
9627
+
9628
+ var pathBusinessPaymentClientToken = function pathBusinessPaymentClientToken(businessId, patientId) {
9629
+ return "/businesses/" + businessId + "/patients/" + patientId + "/sales/clienttoken";
9630
+ };
9598
9631
  /**
9599
9632
  * Create an account's payment method
9600
9633
  * @param {String} accountId - Account ID
@@ -10173,14 +10206,15 @@ var getBusinessClientToken = /*#__PURE__*/function () {
10173
10206
  };
10174
10207
  }();
10175
10208
  /**
10176
- * Get business sales client token
10209
+ * Get business payment client token
10177
10210
  * @param {String} businessId - Business ID
10211
+ * @param {String} patientId - Patient ID
10178
10212
  * @param {Object} opts - Additional options
10179
10213
  * @returns {Object} The device data
10180
10214
  */
10181
10215
 
10182
- var getBusinessSalesClientToken = /*#__PURE__*/function () {
10183
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(businessId, opts) {
10216
+ var getBusinessPaymentClientToken = /*#__PURE__*/function () {
10217
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(businessId, patientId, opts) {
10184
10218
  return _regeneratorRuntime.wrap(function _callee15$(_context15) {
10185
10219
  while (1) {
10186
10220
  switch (_context15.prev = _context15.next) {
@@ -10190,10 +10224,11 @@ var getBusinessSalesClientToken = /*#__PURE__*/function () {
10190
10224
  }
10191
10225
 
10192
10226
  doesParamExist.default({
10193
- businessId: businessId
10227
+ businessId: businessId,
10228
+ patientId: patientId
10194
10229
  }, opts.hyperMediaEndpoint);
10195
10230
  return _context15.abrupt("return", request(_objectSpread$G({}, opts, {
10196
- path: pathBusinessSalesClientToken(businessId)
10231
+ path: pathBusinessPaymentClientToken(businessId, patientId)
10197
10232
  }), {
10198
10233
  method: 'get'
10199
10234
  }));
@@ -10206,10 +10241,48 @@ var getBusinessSalesClientToken = /*#__PURE__*/function () {
10206
10241
  }, _callee15);
10207
10242
  }));
10208
10243
 
10209
- return function getBusinessSalesClientToken(_x47, _x48) {
10244
+ return function getBusinessPaymentClientToken(_x47, _x48, _x49) {
10210
10245
  return _ref15.apply(this, arguments);
10211
10246
  };
10212
10247
  }();
10248
+ /**
10249
+ * Get business sales client token
10250
+ * @param {String} businessId - Business ID
10251
+ * @param {Object} opts - Additional options
10252
+ * @returns {Object} The device data
10253
+ */
10254
+
10255
+ var getBusinessSalesClientToken = /*#__PURE__*/function () {
10256
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(businessId, opts) {
10257
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
10258
+ while (1) {
10259
+ switch (_context16.prev = _context16.next) {
10260
+ case 0:
10261
+ if (opts === void 0) {
10262
+ opts = {};
10263
+ }
10264
+
10265
+ doesParamExist.default({
10266
+ businessId: businessId
10267
+ }, opts.hyperMediaEndpoint);
10268
+ return _context16.abrupt("return", request(_objectSpread$G({}, opts, {
10269
+ path: pathBusinessSalesClientToken(businessId)
10270
+ }), {
10271
+ method: 'get'
10272
+ }));
10273
+
10274
+ case 3:
10275
+ case "end":
10276
+ return _context16.stop();
10277
+ }
10278
+ }
10279
+ }, _callee16);
10280
+ }));
10281
+
10282
+ return function getBusinessSalesClientToken(_x50, _x51) {
10283
+ return _ref16.apply(this, arguments);
10284
+ };
10285
+ }();
10213
10286
  /**
10214
10287
  * Get client token
10215
10288
  * @param {String} source - Source of payment
@@ -10218,10 +10291,10 @@ var getBusinessSalesClientToken = /*#__PURE__*/function () {
10218
10291
  */
10219
10292
 
10220
10293
  var getClientToken = /*#__PURE__*/function () {
10221
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(source, opts) {
10222
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
10294
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(source, opts) {
10295
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
10223
10296
  while (1) {
10224
- switch (_context16.prev = _context16.next) {
10297
+ switch (_context17.prev = _context17.next) {
10225
10298
  case 0:
10226
10299
  if (opts === void 0) {
10227
10300
  opts = {
@@ -10232,7 +10305,7 @@ var getClientToken = /*#__PURE__*/function () {
10232
10305
  doesParamExist.default({
10233
10306
  source: source
10234
10307
  }, opts.hyperMediaEndpoint);
10235
- return _context16.abrupt("return", request(_objectSpread$G({}, opts, {
10308
+ return _context17.abrupt("return", request(_objectSpread$G({}, opts, {
10236
10309
  path: PATH__PAYMENTS + "/clienttoken"
10237
10310
  }), {
10238
10311
  method: 'get',
@@ -10244,14 +10317,14 @@ var getClientToken = /*#__PURE__*/function () {
10244
10317
 
10245
10318
  case 3:
10246
10319
  case "end":
10247
- return _context16.stop();
10320
+ return _context17.stop();
10248
10321
  }
10249
10322
  }
10250
- }, _callee16);
10323
+ }, _callee17);
10251
10324
  }));
10252
10325
 
10253
- return function getClientToken(_x49, _x50) {
10254
- return _ref16.apply(this, arguments);
10326
+ return function getClientToken(_x52, _x53) {
10327
+ return _ref17.apply(this, arguments);
10255
10328
  };
10256
10329
  }();
10257
10330
  /**
@@ -10263,10 +10336,10 @@ var getClientToken = /*#__PURE__*/function () {
10263
10336
  */
10264
10337
 
10265
10338
  var updateAccountPaymentMethod = /*#__PURE__*/function () {
10266
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(accountId, paymentMethodId, body, opts) {
10267
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
10339
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(accountId, paymentMethodId, body, opts) {
10340
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
10268
10341
  while (1) {
10269
- switch (_context17.prev = _context17.next) {
10342
+ switch (_context18.prev = _context18.next) {
10270
10343
  case 0:
10271
10344
  if (opts === void 0) {
10272
10345
  opts = {};
@@ -10276,7 +10349,7 @@ var updateAccountPaymentMethod = /*#__PURE__*/function () {
10276
10349
  accountId: accountId,
10277
10350
  paymentMethodId: paymentMethodId
10278
10351
  }, opts.hyperMediaEndpoint);
10279
- return _context17.abrupt("return", request(_objectSpread$G({}, opts, {
10352
+ return _context18.abrupt("return", request(_objectSpread$G({}, opts, {
10280
10353
  path: pathAccountPaymentMethod(accountId, paymentMethodId)
10281
10354
  }), {
10282
10355
  data: body,
@@ -10285,14 +10358,14 @@ var updateAccountPaymentMethod = /*#__PURE__*/function () {
10285
10358
 
10286
10359
  case 3:
10287
10360
  case "end":
10288
- return _context17.stop();
10361
+ return _context18.stop();
10289
10362
  }
10290
10363
  }
10291
- }, _callee17);
10364
+ }, _callee18);
10292
10365
  }));
10293
10366
 
10294
- return function updateAccountPaymentMethod(_x51, _x52, _x53, _x54) {
10295
- return _ref17.apply(this, arguments);
10367
+ return function updateAccountPaymentMethod(_x54, _x55, _x56, _x57) {
10368
+ return _ref18.apply(this, arguments);
10296
10369
  };
10297
10370
  }();
10298
10371
  /**
@@ -10304,10 +10377,10 @@ var updateAccountPaymentMethod = /*#__PURE__*/function () {
10304
10377
  */
10305
10378
 
10306
10379
  var updateBusinessPaymentMethod = /*#__PURE__*/function () {
10307
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(businessId, paymentMethodId, body, opts) {
10308
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
10380
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(businessId, paymentMethodId, body, opts) {
10381
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
10309
10382
  while (1) {
10310
- switch (_context18.prev = _context18.next) {
10383
+ switch (_context19.prev = _context19.next) {
10311
10384
  case 0:
10312
10385
  if (opts === void 0) {
10313
10386
  opts = {};
@@ -10317,7 +10390,7 @@ var updateBusinessPaymentMethod = /*#__PURE__*/function () {
10317
10390
  businessId: businessId,
10318
10391
  paymentMethodId: paymentMethodId
10319
10392
  }, opts.hyperMediaEndpoint);
10320
- return _context18.abrupt("return", request(_objectSpread$G({}, opts, {
10393
+ return _context19.abrupt("return", request(_objectSpread$G({}, opts, {
10321
10394
  path: pathBusinessPaymentMethod(businessId, paymentMethodId)
10322
10395
  }), {
10323
10396
  data: body,
@@ -10326,14 +10399,14 @@ var updateBusinessPaymentMethod = /*#__PURE__*/function () {
10326
10399
 
10327
10400
  case 3:
10328
10401
  case "end":
10329
- return _context18.stop();
10402
+ return _context19.stop();
10330
10403
  }
10331
10404
  }
10332
- }, _callee18);
10405
+ }, _callee19);
10333
10406
  }));
10334
10407
 
10335
- return function updateBusinessPaymentMethod(_x55, _x56, _x57, _x58) {
10336
- return _ref18.apply(this, arguments);
10408
+ return function updateBusinessPaymentMethod(_x58, _x59, _x60, _x61) {
10409
+ return _ref19.apply(this, arguments);
10337
10410
  };
10338
10411
  }();
10339
10412
  /**
@@ -10345,10 +10418,10 @@ var updateBusinessPaymentMethod = /*#__PURE__*/function () {
10345
10418
  */
10346
10419
 
10347
10420
  var updateBusinessPatientPaymentMethod = /*#__PURE__*/function () {
10348
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(businessId, patientId, paymentMethodId, body, opts) {
10349
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
10421
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(businessId, patientId, paymentMethodId, body, opts) {
10422
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
10350
10423
  while (1) {
10351
- switch (_context19.prev = _context19.next) {
10424
+ switch (_context20.prev = _context20.next) {
10352
10425
  case 0:
10353
10426
  if (opts === void 0) {
10354
10427
  opts = {};
@@ -10359,7 +10432,7 @@ var updateBusinessPatientPaymentMethod = /*#__PURE__*/function () {
10359
10432
  patientId: patientId,
10360
10433
  paymentMethodId: paymentMethodId
10361
10434
  }, opts.hyperMediaEndpoint);
10362
- return _context19.abrupt("return", request(_objectSpread$G({}, opts, {
10435
+ return _context20.abrupt("return", request(_objectSpread$G({}, opts, {
10363
10436
  path: pathBusinessPatientPaymentMethod(businessId, patientId, paymentMethodId)
10364
10437
  }), {
10365
10438
  data: body,
@@ -10368,14 +10441,14 @@ var updateBusinessPatientPaymentMethod = /*#__PURE__*/function () {
10368
10441
 
10369
10442
  case 3:
10370
10443
  case "end":
10371
- return _context19.stop();
10444
+ return _context20.stop();
10372
10445
  }
10373
10446
  }
10374
- }, _callee19);
10447
+ }, _callee20);
10375
10448
  }));
10376
10449
 
10377
- return function updateBusinessPatientPaymentMethod(_x59, _x60, _x61, _x62, _x63) {
10378
- return _ref19.apply(this, arguments);
10450
+ return function updateBusinessPatientPaymentMethod(_x62, _x63, _x64, _x65, _x66) {
10451
+ return _ref20.apply(this, arguments);
10379
10452
  };
10380
10453
  }(); //////////////////////////////////////////////////////////////
10381
10454
 
@@ -10396,65 +10469,83 @@ var getPaymentGatewayError = function getPaymentGatewayError(sessionResponse) {
10396
10469
  */
10397
10470
 
10398
10471
  var getNonce = /*#__PURE__*/function () {
10399
- var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref20, opts) {
10400
- var amount, businessId, _cardNumber, expiry, cvc, _ref20$paymentProvide, paymentProvider, _ref20$isSales, isSales, isSelfCheckoutSession, _ref20$source, source, cardNumber, cardExpiryMonth, cardExpiryYear, cardSecurityCode, clientToken, paymentSession, updateSessionResponse, clientInstance, sourceResponse, paymentsClient, googlePaymentInstance, response, paymentDataRequest, cardPaymentMethod, paymentData, applePayInstance, paymentRequest, canMakeApplePayment;
10472
+ var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref21, opts) {
10473
+ var amount, businessId, patientId, _cardNumber, expiry, cvc, _ref21$paymentProvide, paymentProvider, _ref21$isSales, isSales, isSelfCheckoutSession, _ref21$source, source, cardNumber, cardExpiryMonth, cardExpiryYear, cardSecurityCode, clientToken, paymentSession, updateSessionResponse, clientInstance, sourceResponse, paymentsClient, googlePaymentInstance, response, paymentDataRequest, cardPaymentMethod, paymentData, applePayInstance, paymentRequest, canMakeApplePayment;
10401
10474
 
10402
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
10475
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
10403
10476
  while (1) {
10404
- switch (_context20.prev = _context20.next) {
10477
+ switch (_context21.prev = _context21.next) {
10405
10478
  case 0:
10406
- amount = _ref20.amount, businessId = _ref20.businessId, _cardNumber = _ref20.cardNumber, expiry = _ref20.expiry, cvc = _ref20.cvc, _ref20$paymentProvide = _ref20.paymentProvider, paymentProvider = _ref20$paymentProvide === void 0 ? constants.PAYMENT_PROVIDERS.PAYMENT_CARD : _ref20$paymentProvide, _ref20$isSales = _ref20.isSales, isSales = _ref20$isSales === void 0 ? true : _ref20$isSales, isSelfCheckoutSession = _ref20.isSelfCheckoutSession, _ref20$source = _ref20.source, source = _ref20$source === void 0 ? 'mastercard' : _ref20$source;
10479
+ amount = _ref21.amount, businessId = _ref21.businessId, patientId = _ref21.patientId, _cardNumber = _ref21.cardNumber, expiry = _ref21.expiry, cvc = _ref21.cvc, _ref21$paymentProvide = _ref21.paymentProvider, paymentProvider = _ref21$paymentProvide === void 0 ? constants.PAYMENT_PROVIDERS.PAYMENT_CARD : _ref21$paymentProvide, _ref21$isSales = _ref21.isSales, isSales = _ref21$isSales === void 0 ? true : _ref21$isSales, isSelfCheckoutSession = _ref21.isSelfCheckoutSession, _ref21$source = _ref21.source, source = _ref21$source === void 0 ? 'mastercard' : _ref21$source;
10407
10480
 
10408
10481
  cardNumber = _cardNumber ? _cardNumber.replace(/\s/g, '') : '';
10409
10482
  cardExpiryMonth = expiry ? expiry.split('/')[0].trim() : '';
10410
10483
  cardExpiryYear = expiry ? expiry.split('/')[1].trim() : '';
10411
10484
  cardSecurityCode = cvc;
10412
10485
 
10413
- if (!(businessId && isSales)) {
10414
- _context20.next = 12;
10486
+ if (!(businessId && isSales && !patientId)) {
10487
+ _context21.next = 12;
10415
10488
  break;
10416
10489
  }
10417
10490
 
10418
- _context20.next = 9;
10491
+ _context21.next = 9;
10419
10492
  return getBusinessSalesClientToken(businessId, isSelfCheckoutSession ? {
10420
10493
  tokenType: 'session'
10421
10494
  } : {});
10422
10495
 
10423
10496
  case 9:
10424
- clientToken = _context20.sent;
10425
- _context20.next = 21;
10497
+ clientToken = _context21.sent;
10498
+ _context21.next = 27;
10426
10499
  break;
10427
10500
 
10428
10501
  case 12:
10429
- if (!businessId) {
10430
- _context20.next = 18;
10502
+ if (!(businessId && !patientId)) {
10503
+ _context21.next = 18;
10431
10504
  break;
10432
10505
  }
10433
10506
 
10434
- _context20.next = 15;
10507
+ _context21.next = 15;
10435
10508
  return getBusinessClientToken(businessId, source, isSelfCheckoutSession ? {
10436
10509
  tokenType: 'session'
10437
10510
  } : {});
10438
10511
 
10439
10512
  case 15:
10440
- clientToken = _context20.sent;
10441
- _context20.next = 21;
10513
+ clientToken = _context21.sent;
10514
+ _context21.next = 27;
10442
10515
  break;
10443
10516
 
10444
10517
  case 18:
10445
- _context20.next = 20;
10518
+ if (!(businessId && patientId)) {
10519
+ _context21.next = 24;
10520
+ break;
10521
+ }
10522
+
10523
+ _context21.next = 21;
10524
+ return getBusinessPaymentClientToken(businessId, patientId, {
10525
+ requestConfig: {
10526
+ tokenType: 'session'
10527
+ }
10528
+ });
10529
+
10530
+ case 21:
10531
+ clientToken = _context21.sent;
10532
+ _context21.next = 27;
10533
+ break;
10534
+
10535
+ case 24:
10536
+ _context21.next = 26;
10446
10537
  return getClientToken(source, isSelfCheckoutSession ? {
10447
10538
  tokenType: 'session'
10448
10539
  } : {});
10449
10540
 
10450
- case 20:
10451
- clientToken = _context20.sent;
10541
+ case 26:
10542
+ clientToken = _context21.sent;
10452
10543
 
10453
- case 21:
10544
+ case 27:
10454
10545
  if (!clientToken.source) clientToken.source = source;
10455
10546
 
10456
10547
  if (!(clientToken.source === 'mastercard')) {
10457
- _context20.next = 33;
10548
+ _context21.next = 39;
10458
10549
  break;
10459
10550
  }
10460
10551
 
@@ -10462,15 +10553,15 @@ var getNonce = /*#__PURE__*/function () {
10462
10553
  paymentSession = HostedForm; // eslint-disable-line no-undef
10463
10554
 
10464
10555
  if (paymentSession) {
10465
- _context20.next = 26;
10556
+ _context21.next = 32;
10466
10557
  break;
10467
10558
  }
10468
10559
 
10469
10560
  throw new Error(constants.ERROR_MESSAGES.PAYMENT_GATEWAY_ERROR);
10470
10561
 
10471
- case 26:
10562
+ case 32:
10472
10563
  paymentSession.setMerchant(clientToken.merchantId);
10473
- _context20.next = 29;
10564
+ _context21.next = 35;
10474
10565
  return pify(paymentSession.updateSession, {
10475
10566
  errorFirst: false
10476
10567
  })(clientToken.clientToken, {
@@ -10480,43 +10571,43 @@ var getNonce = /*#__PURE__*/function () {
10480
10571
  cardSecurityCode: cardSecurityCode
10481
10572
  });
10482
10573
 
10483
- case 29:
10484
- updateSessionResponse = _context20.sent;
10574
+ case 35:
10575
+ updateSessionResponse = _context21.sent;
10485
10576
 
10486
10577
  if (!getPaymentGatewayError(updateSessionResponse)) {
10487
- _context20.next = 32;
10578
+ _context21.next = 38;
10488
10579
  break;
10489
10580
  }
10490
10581
 
10491
10582
  throw new Error(getPaymentGatewayError(updateSessionResponse));
10492
10583
 
10493
- case 32:
10494
- return _context20.abrupt("return", _objectSpread$G({}, clientToken, {
10584
+ case 38:
10585
+ return _context21.abrupt("return", _objectSpread$G({}, clientToken, {
10495
10586
  nonce: clientToken.clientToken,
10496
10587
  sourceResponse: updateSessionResponse
10497
10588
  }));
10498
10589
 
10499
- case 33:
10590
+ case 39:
10500
10591
  if (!(clientToken.source === 'braintree')) {
10501
- _context20.next = 71;
10592
+ _context21.next = 77;
10502
10593
  break;
10503
10594
  }
10504
10595
 
10505
- _context20.next = 36;
10596
+ _context21.next = 42;
10506
10597
  return braintreeClient.create({
10507
10598
  authorization: clientToken.clientToken
10508
10599
  });
10509
10600
 
10510
- case 36:
10511
- clientInstance = _context20.sent;
10601
+ case 42:
10602
+ clientInstance = _context21.sent;
10512
10603
  sourceResponse = {};
10513
10604
 
10514
10605
  if (!(paymentProvider === constants.PAYMENT_PROVIDERS.PAYMENT_CARD)) {
10515
- _context20.next = 43;
10606
+ _context21.next = 49;
10516
10607
  break;
10517
10608
  }
10518
10609
 
10519
- _context20.next = 41;
10610
+ _context21.next = 47;
10520
10611
  return clientInstance.request({
10521
10612
  endpoint: 'payment_methods/credit_cards',
10522
10613
  method: 'post',
@@ -10532,43 +10623,43 @@ var getNonce = /*#__PURE__*/function () {
10532
10623
  }
10533
10624
  });
10534
10625
 
10535
- case 41:
10536
- sourceResponse = _context20.sent;
10537
- return _context20.abrupt("return", _objectSpread$G({}, clientToken, {
10626
+ case 47:
10627
+ sourceResponse = _context21.sent;
10628
+ return _context21.abrupt("return", _objectSpread$G({}, clientToken, {
10538
10629
  nonce: _get(sourceResponse, 'creditCards[0].nonce'),
10539
10630
  sourceResponse: sourceResponse
10540
10631
  }));
10541
10632
 
10542
- case 43:
10633
+ case 49:
10543
10634
  if (!(paymentProvider === constants.PAYMENT_PROVIDERS.GOOGLE_PAY && amount && _get(window, 'google.payments.api'))) {
10544
- _context20.next = 62;
10635
+ _context21.next = 68;
10545
10636
  break;
10546
10637
  }
10547
10638
 
10548
10639
  paymentsClient = new window.google.payments.api.PaymentsClient({
10549
10640
  environment: env.ENV_NAME === 'prod' || env.ENV_NAME === 'pre-prod' ? 'PRODUCTION' : 'TEST'
10550
10641
  });
10551
- _context20.next = 47;
10642
+ _context21.next = 53;
10552
10643
  return braintreeGooglePayment.create({
10553
10644
  client: clientInstance,
10554
10645
  googlePayVersion: 2,
10555
10646
  googleMerchantId: env.GOOGLE_MERCHANT_ID
10556
10647
  });
10557
10648
 
10558
- case 47:
10559
- googlePaymentInstance = _context20.sent;
10560
- _context20.next = 50;
10649
+ case 53:
10650
+ googlePaymentInstance = _context21.sent;
10651
+ _context21.next = 56;
10561
10652
  return paymentsClient.isReadyToPay({
10562
10653
  apiVersion: 2,
10563
10654
  apiVersionMinor: 0,
10564
10655
  allowedPaymentMethods: googlePaymentInstance.createPaymentDataRequest().allowedPaymentMethods
10565
10656
  });
10566
10657
 
10567
- case 50:
10568
- response = _context20.sent;
10658
+ case 56:
10659
+ response = _context21.sent;
10569
10660
 
10570
10661
  if (!response.result) {
10571
- _context20.next = 62;
10662
+ _context21.next = 68;
10572
10663
  break;
10573
10664
  }
10574
10665
 
@@ -10581,34 +10672,34 @@ var getNonce = /*#__PURE__*/function () {
10581
10672
  });
10582
10673
  cardPaymentMethod = paymentDataRequest.allowedPaymentMethods[0];
10583
10674
  cardPaymentMethod.parameters.billingAddressRequired = false;
10584
- _context20.next = 57;
10675
+ _context21.next = 63;
10585
10676
  return paymentsClient.loadPaymentData(paymentDataRequest);
10586
10677
 
10587
- case 57:
10588
- paymentData = _context20.sent;
10589
- _context20.next = 60;
10678
+ case 63:
10679
+ paymentData = _context21.sent;
10680
+ _context21.next = 66;
10590
10681
  return googlePaymentInstance.parseResponse(paymentData);
10591
10682
 
10592
- case 60:
10593
- sourceResponse = _context20.sent;
10594
- return _context20.abrupt("return", _objectSpread$G({}, clientToken, {
10683
+ case 66:
10684
+ sourceResponse = _context21.sent;
10685
+ return _context21.abrupt("return", _objectSpread$G({}, clientToken, {
10595
10686
  nonce: sourceResponse.nonce,
10596
10687
  sourceResponse: sourceResponse
10597
10688
  }));
10598
10689
 
10599
- case 62:
10690
+ case 68:
10600
10691
  if (!(paymentProvider === constants.PAYMENT_PROVIDERS.APPLE_PAY)) {
10601
- _context20.next = 71;
10692
+ _context21.next = 77;
10602
10693
  break;
10603
10694
  }
10604
10695
 
10605
- _context20.next = 65;
10696
+ _context21.next = 71;
10606
10697
  return braintreeApplePay.create({
10607
10698
  client: clientInstance
10608
10699
  });
10609
10700
 
10610
- case 65:
10611
- applePayInstance = _context20.sent;
10701
+ case 71:
10702
+ applePayInstance = _context21.sent;
10612
10703
  paymentRequest = applePayInstance.createPaymentRequest({
10613
10704
  total: {
10614
10705
  label: 'Medipass Payment',
@@ -10616,30 +10707,30 @@ var getNonce = /*#__PURE__*/function () {
10616
10707
  }
10617
10708
  }); // @ts-expect-error TS(2339): Property 'ApplePaySession' does not exist on type ... Remove this comment to see the full error message
10618
10709
 
10619
- _context20.next = 69;
10710
+ _context21.next = 75;
10620
10711
  return window.ApplePaySession.canMakePaymentsWithActiveCard(applePayInstance.merchantIdentifier);
10621
10712
 
10622
- case 69:
10623
- canMakeApplePayment = _context20.sent;
10624
- return _context20.abrupt("return", _objectSpread$G({}, clientToken, {
10713
+ case 75:
10714
+ canMakeApplePayment = _context21.sent;
10715
+ return _context21.abrupt("return", _objectSpread$G({}, clientToken, {
10625
10716
  applePayInstance: applePayInstance,
10626
10717
  canMakeApplePayment: canMakeApplePayment,
10627
10718
  paymentRequest: paymentRequest
10628
10719
  }));
10629
10720
 
10630
- case 71:
10631
- return _context20.abrupt("return", clientToken);
10721
+ case 77:
10722
+ return _context21.abrupt("return", clientToken);
10632
10723
 
10633
- case 72:
10724
+ case 78:
10634
10725
  case "end":
10635
- return _context20.stop();
10726
+ return _context21.stop();
10636
10727
  }
10637
10728
  }
10638
- }, _callee20);
10729
+ }, _callee21);
10639
10730
  }));
10640
10731
 
10641
- return function getNonce(_x64, _x65) {
10642
- return _ref21.apply(this, arguments);
10732
+ return function getNonce(_x67, _x68) {
10733
+ return _ref22.apply(this, arguments);
10643
10734
  };
10644
10735
  }();
10645
10736
 
@@ -10659,6 +10750,7 @@ var payments = /*#__PURE__*/Object.freeze({
10659
10750
  getBusinessPaymentMethod: getBusinessPaymentMethod,
10660
10751
  getBusinessPatientPaymentMethod: getBusinessPatientPaymentMethod,
10661
10752
  getBusinessClientToken: getBusinessClientToken,
10753
+ getBusinessPaymentClientToken: getBusinessPaymentClientToken,
10662
10754
  getBusinessSalesClientToken: getBusinessSalesClientToken,
10663
10755
  getClientToken: getClientToken,
10664
10756
  updateAccountPaymentMethod: updateAccountPaymentMethod,
@@ -21848,6 +21940,7 @@ exports.getBusinessPatientPaymentMethod = getBusinessPatientPaymentMethod;
21848
21940
  exports.getBusinessPatientPaymentMethods = getBusinessPatientPaymentMethods;
21849
21941
  exports.getBusinessPatientPaymentMethodsByRefId = getBusinessPatientPaymentMethodsByRefId;
21850
21942
  exports.getBusinessPatients = getBusinessPatients;
21943
+ exports.getBusinessPaymentClientToken = getBusinessPaymentClientToken;
21851
21944
  exports.getBusinessPaymentMethod = getBusinessPaymentMethod;
21852
21945
  exports.getBusinessPaymentMethods = getBusinessPaymentMethods;
21853
21946
  exports.getBusinessPractice = getBusinessPractice;
@@ -22232,6 +22325,7 @@ exports.requestOtk$1 = requestOtk$1;
22232
22325
  exports.requestPasswordReset = requestPasswordReset;
22233
22326
  exports.requestToAddProviderToPractice = requestToAddProviderToPractice;
22234
22327
  exports.requestToVerifyAccount = requestToVerifyAccount;
22328
+ exports.requestUpdatePatientPaymentMethod = requestUpdatePatientPaymentMethod;
22235
22329
  exports.requestVerificationSupport = requestVerificationSupport;
22236
22330
  exports.resetAccount = resetAccount;
22237
22331
  exports.resetMobile = resetMobile;
@@ -18,7 +18,7 @@ require('./param-error.js');
18
18
  require('./does-param-exist.js');
19
19
  require('@medipass/utils/sentry');
20
20
  require('./get-axios-error.js');
21
- var request = require('../staff-0ea83917.js');
21
+ var request = require('../staff-f9c0c953.js');
22
22
  require('lodash/omitBy');
23
23
  require('lodash/isEmpty');
24
24
  require('store/src/store-engine');