oro-sdk-apis 1.9.0 → 1.11.1-dev1

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.
@@ -2296,6 +2296,70 @@ var GuardService = /*#__PURE__*/function () {
2296
2296
  }
2297
2297
 
2298
2298
  return identitySendConfirmEmail;
2299
+ }()
2300
+ /**
2301
+ * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)
2302
+ *
2303
+ * @param email the customer email
2304
+ * @returns IdentityResponse
2305
+ */
2306
+ ;
2307
+
2308
+ _proto.identityGetByCustomerEmail =
2309
+ /*#__PURE__*/
2310
+ function () {
2311
+ var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(email) {
2312
+ return runtime_1.wrap(function _callee11$(_context11) {
2313
+ while (1) {
2314
+ switch (_context11.prev = _context11.next) {
2315
+ case 0:
2316
+ return _context11.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2317
+
2318
+ case 1:
2319
+ case "end":
2320
+ return _context11.stop();
2321
+ }
2322
+ }
2323
+ }, _callee11, this);
2324
+ }));
2325
+
2326
+ function identityGetByCustomerEmail(_x13) {
2327
+ return _identityGetByCustomerEmail.apply(this, arguments);
2328
+ }
2329
+
2330
+ return identityGetByCustomerEmail;
2331
+ }()
2332
+ /**
2333
+ * Get an identity using a base64 hash
2334
+ *
2335
+ * @param b64Hash base64 hash of the identity
2336
+ * @returns IdentityResponse
2337
+ */
2338
+ ;
2339
+
2340
+ _proto.identityGetByHash =
2341
+ /*#__PURE__*/
2342
+ function () {
2343
+ var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(b64Hash) {
2344
+ return runtime_1.wrap(function _callee12$(_context12) {
2345
+ while (1) {
2346
+ switch (_context12.prev = _context12.next) {
2347
+ case 0:
2348
+ return _context12.abrupt("return", this.identityGet(b64Hash.replace('+', '-').replace('/', '_')));
2349
+
2350
+ case 1:
2351
+ case "end":
2352
+ return _context12.stop();
2353
+ }
2354
+ }
2355
+ }, _callee12, this);
2356
+ }));
2357
+
2358
+ function identityGetByHash(_x14) {
2359
+ return _identityGetByHash.apply(this, arguments);
2360
+ }
2361
+
2362
+ return identityGetByHash;
2299
2363
  }();
2300
2364
 
2301
2365
  return GuardService;
@@ -2448,13 +2512,26 @@ var PracticeService = /*#__PURE__*/function () {
2448
2512
 
2449
2513
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2450
2514
  return Buffer.from(sha256().update(email.toLowerCase()).digest('hex'), 'hex').toString('base64');
2451
- };
2515
+ }
2516
+ /**
2517
+ * Creates a PracticePaymentIntent
2518
+ * @param practiceUuid the uuid of the practice
2519
+ * @param planId the plan id to use
2520
+ * @param userEmail the email address of the user
2521
+ * @param isoLocality (optional) the desired locality
2522
+ * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
2523
+ * @param promotionCode (optional) promotion code to apply
2524
+ * @param consultRequest (optional) consult request to use. If defined, when payment service call our hooks in practice, it will try to create a consult with these infos.
2525
+ * @returns
2526
+ */
2527
+ ;
2452
2528
 
2453
- _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, promotionCode) {
2529
+ _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, promotionCode, consultRequest) {
2454
2530
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2455
2531
  idPlan: planId,
2456
2532
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
2457
- isoLocality: isoLocality
2533
+ isoLocality: isoLocality,
2534
+ consultRequest: consultRequest
2458
2535
  }, {
2459
2536
  params: {
2460
2537
  url_subdomain: url_subdomain,