@apextelemed/partner-core 0.16.0-dev.45 → 0.16.0-dev.46

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 (42) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/index.jsx +3 -3
  4. package/dist/chunk/{HYN2BVTH.jsx → 3XQSYLFD.jsx} +6 -6
  5. package/dist/chunk/{MMPKHKIU.jsx → 4YJF3J74.jsx} +2 -2
  6. package/dist/chunk/{2RWPQQ4A.jsx → A43EPOTF.jsx} +7 -6
  7. package/dist/chunk/{46MIDHRD.js → ATSYHZSR.js} +3 -3
  8. package/dist/chunk/{46MIDHRD.js.map → ATSYHZSR.js.map} +1 -1
  9. package/dist/chunk/{RGFD2T3K.js → B5722F4T.js} +3 -3
  10. package/dist/chunk/{RGFD2T3K.js.map → B5722F4T.js.map} +1 -1
  11. package/dist/chunk/{CXMAV5SC.js → GYEK4TSP.js} +3 -3
  12. package/dist/chunk/{CXMAV5SC.js.map → GYEK4TSP.js.map} +1 -1
  13. package/dist/chunk/{AM5HSKWG.js → IPDABIXO.js} +8 -7
  14. package/dist/chunk/IPDABIXO.js.map +1 -0
  15. package/dist/chunk/{RF6RWN3P.jsx → IXT445LX.jsx} +2 -2
  16. package/dist/chunk/{AO3N6VTS.jsx → MH43RC7G.jsx} +9 -1
  17. package/dist/chunk/{NEV5KNPS.js → U426ASG4.js} +10 -2
  18. package/dist/chunk/U426ASG4.js.map +1 -0
  19. package/dist/chunk/{ONYGQYUN.jsx → VLVSEATQ.jsx} +79 -11
  20. package/dist/chunk/{KK36ZETG.jsx → XEWZ4OIT.jsx} +2 -2
  21. package/dist/chunk/{MPW4IVPB.js → XNP3VLLY.js} +7 -7
  22. package/dist/chunk/XNP3VLLY.js.map +1 -0
  23. package/dist/chunk/{E6KLEFN3.js → YK2Y76A4.js} +80 -12
  24. package/dist/chunk/YK2Y76A4.js.map +1 -0
  25. package/dist/{client-oZcZn-HB.d.ts → client-DoCsuJj3.d.ts} +5 -0
  26. package/dist/flows/index.d.ts +1 -1
  27. package/dist/flows/index.js +6 -6
  28. package/dist/flows/index.jsx +6 -6
  29. package/dist/index/index.d.ts +1 -1
  30. package/dist/index/index.js +7 -7
  31. package/dist/index/index.jsx +7 -7
  32. package/dist/pages/index.d.ts +1 -1
  33. package/dist/pages/index.js +5 -5
  34. package/dist/pages/index.jsx +5 -5
  35. package/dist/stores/index.d.ts +1 -1
  36. package/dist/stores/index.js +2 -2
  37. package/dist/stores/index.jsx +2 -2
  38. package/package.json +1 -1
  39. package/dist/chunk/AM5HSKWG.js.map +0 -1
  40. package/dist/chunk/E6KLEFN3.js.map +0 -1
  41. package/dist/chunk/MPW4IVPB.js.map +0 -1
  42. package/dist/chunk/NEV5KNPS.js.map +0 -1
@@ -6,13 +6,13 @@ import {
6
6
  readResumeToken,
7
7
  saveFunnelDraft,
8
8
  stripResumeToken
9
- } from "./MMPKHKIU.jsx";
9
+ } from "./4YJF3J74.jsx";
10
10
  import {
11
11
  affiliateAuth_default,
12
12
  auth_default,
13
13
  cart_default,
14
14
  medication_default
15
- } from "./KK36ZETG.jsx";
15
+ } from "./XEWZ4OIT.jsx";
16
16
  import {
17
17
  ApiError,
18
18
  addressesApi,
@@ -32,7 +32,7 @@ import {
32
32
  subscriptionsApi,
33
33
  supportApi,
34
34
  usersApi
35
- } from "./AO3N6VTS.jsx";
35
+ } from "./MH43RC7G.jsx";
36
36
  import {
37
37
  getConfig
38
38
  } from "./QVZ7BRNO.jsx";
@@ -856,7 +856,7 @@ function useCardTokenizer() {
856
856
  const ready = () => {
857
857
  const cfg = config();
858
858
  if (!cfg) return false;
859
- return cfg.provider === "quickbooks" ? true : scriptLoaded();
859
+ return cfg.provider === "authorizenet" ? scriptLoaded() : true;
860
860
  };
861
861
  const status = () => error() ? "failed" : ready() ? "ready" : "loading";
862
862
  function fail(userMessage, logDetail) {
@@ -874,6 +874,10 @@ function useCardTokenizer() {
874
874
  setConfig({ provider: "quickbooks", tokenizeUrl: raw.tokenizeUrl });
875
875
  return;
876
876
  }
877
+ if (raw.provider === "mxmerchant") {
878
+ setConfig({ provider: "mxmerchant" });
879
+ return;
880
+ }
877
881
  if (!raw.apiLoginId || !raw.clientKey) {
878
882
  fail("Payments are not fully configured for this site yet. Please contact support.");
879
883
  return;
@@ -937,13 +941,34 @@ function useCardTokenizer() {
937
941
  );
938
942
  });
939
943
  }
944
+ function requireBillingAddress(card) {
945
+ const street = card.billing?.street?.trim() ?? "";
946
+ const zip = card.billing?.zip?.trim() ?? "";
947
+ if (!street || !zip) throw new Error("Enter your billing street address and ZIP code.");
948
+ return { street, zip };
949
+ }
940
950
  async function tokenizeQuickBooks(card, cfg) {
941
951
  const { month, year } = splitExpiry(card.expiry);
952
+ const { street, zip } = requireBillingAddress(card);
953
+ const name = [card.billing?.firstName?.trim(), card.billing?.lastName?.trim()].filter(Boolean).join(" ");
942
954
  const res = await fetch(cfg.tokenizeUrl, {
943
955
  method: "POST",
944
956
  headers: { "Content-Type": "application/json" },
945
957
  body: JSON.stringify({
946
- card: { number: card.cardNumber.replace(/\s/g, ""), expMonth: month, expYear: year, cvc: card.cvv }
958
+ card: {
959
+ number: card.cardNumber.replace(/\s/g, ""),
960
+ expMonth: month,
961
+ expYear: year,
962
+ cvc: card.cvv,
963
+ ...name ? { name } : {},
964
+ address: {
965
+ streetAddress: street,
966
+ ...card.billing?.city?.trim() ? { city: card.billing.city.trim() } : {},
967
+ ...card.billing?.state?.trim() ? { region: card.billing.state.trim() } : {},
968
+ country: "US",
969
+ postalCode: zip
970
+ }
971
+ }
947
972
  })
948
973
  });
949
974
  if (!res.ok) {
@@ -955,9 +980,47 @@ function useCardTokenizer() {
955
980
  if (!token) throw new Error("Card tokenization returned no token.");
956
981
  return { token };
957
982
  }
983
+ let lastMxCard = null;
984
+ async function mxCardKey(number, month, year, cvv, street, zip) {
985
+ const bytes = new TextEncoder().encode(`${number}|${month}|${year}|${cvv}|${street}|${zip}`);
986
+ const digest = await crypto.subtle.digest("SHA-256", bytes);
987
+ return Array.from(new Uint8Array(digest), (b) => b.toString(16).padStart(2, "0")).join("");
988
+ }
989
+ async function tokenizeMxMerchant(card) {
990
+ const { month, year } = splitExpiry(card.expiry);
991
+ const expiryYear = year.slice(-2);
992
+ const number = card.cardNumber.replace(/\s/g, "");
993
+ const { street, zip } = requireBillingAddress(card);
994
+ const key = await mxCardKey(number, month, year, card.cvv, street, zip);
995
+ if (lastMxCard?.key === key) return lastMxCard.token;
996
+ let session;
997
+ try {
998
+ session = await paymentsApi.createTokenizationSession();
999
+ } catch (err) {
1000
+ throw new Error(err instanceof Error && err.message ? err.message : "Payment setup is unavailable right now. Please try again.");
1001
+ }
1002
+ if (typeof session?.vaultUrl !== "string") throw new Error("Payment setup is unavailable right now. Please try again.");
1003
+ const res = await fetch(session.vaultUrl, {
1004
+ method: "POST",
1005
+ headers: { "Content-Type": "application/json" },
1006
+ body: JSON.stringify({
1007
+ firstName: card.billing?.firstName?.trim() || "Card",
1008
+ lastName: card.billing?.lastName?.trim() || "Holder",
1009
+ cardAccount: { number, expiryMonth: month, expiryYear, cvv: card.cvv, avsStreet: street, avsZip: zip }
1010
+ })
1011
+ });
1012
+ const body = await res.json().catch(() => ({}));
1013
+ if (!res.ok) throw new Error(body.details?.[0] || body.message || "Card processing failed.");
1014
+ const cardToken = body.cardAccount?.token;
1015
+ if (body.id == null || !cardToken) throw new Error("Card tokenization returned no token.");
1016
+ const token = { customerId: String(body.id), cardToken };
1017
+ lastMxCard = { key, token };
1018
+ return token;
1019
+ }
958
1020
  function tokenize(card) {
959
1021
  const cfg = config();
960
1022
  if (!cfg) return Promise.reject(new Error("Payment configuration not loaded. Please refresh."));
1023
+ if (cfg.provider === "mxmerchant") return tokenizeMxMerchant(card);
961
1024
  return cfg.provider === "quickbooks" ? tokenizeQuickBooks(card, cfg) : tokenizeAcceptJs(card, cfg);
962
1025
  }
963
1026
  return { ready, status, error, tokenize };
@@ -1169,7 +1232,8 @@ function useCheckoutFlow(options = {}) {
1169
1232
  opaqueData = await accept.tokenize({
1170
1233
  cardNumber: cardNumberRaw(),
1171
1234
  expiry: expiryRaw(),
1172
- cvv: cvvRaw()
1235
+ cvv: cvvRaw(),
1236
+ billing: address.effectiveBilling()
1173
1237
  });
1174
1238
  }
1175
1239
  const attemptScope = `${rx.requestId ?? "rx"}:${rx.drugId}`;
@@ -1408,7 +1472,8 @@ function useCartCheckoutFlow() {
1408
1472
  const opaqueData = await accept.tokenize({
1409
1473
  cardNumber: cardNumberRaw(),
1410
1474
  expiry: expiryRaw(),
1411
- cvv: cvvRaw()
1475
+ cvv: cvvRaw(),
1476
+ billing: address.effectiveBilling()
1412
1477
  });
1413
1478
  let idempotencyKey = readAttemptKey(ATTEMPT_SCOPE);
1414
1479
  if (!idempotencyKey) {
@@ -1638,7 +1703,8 @@ function useSignupFlow(options) {
1638
1703
  const opaque = await accept.tokenize({
1639
1704
  cardNumber: cardNumberRaw(),
1640
1705
  expiry: expiryRaw(),
1641
- cvv: cvvRaw()
1706
+ cvv: cvvRaw(),
1707
+ billing: { firstName: firstName().trim(), lastName: lastName().trim(), street: street().trim(), city: city().trim(), state: state(), zip: zip().trim() }
1642
1708
  });
1643
1709
  setTokenizedData(opaque);
1644
1710
  } catch (e) {
@@ -2226,7 +2292,8 @@ function useSubscribeFlow(options) {
2226
2292
  const opaque = await accept.tokenize({
2227
2293
  cardNumber: cardNumberRaw(),
2228
2294
  expiry: expiryRaw(),
2229
- cvv: cvvRaw()
2295
+ cvv: cvvRaw(),
2296
+ billing: { street: street().trim(), city: city().trim(), state: state(), zip: zip().trim() }
2230
2297
  });
2231
2298
  const products = cart_default.items().map((i) => ({
2232
2299
  productId: i.productId,
@@ -3484,7 +3551,8 @@ function useUpdatePaymentMethodFlow(subscriptionId) {
3484
3551
  const opaqueData = await accept.tokenize({
3485
3552
  cardNumber: cardNumber(),
3486
3553
  expiry: expiry(),
3487
- cvv: cvv()
3554
+ cvv: cvv(),
3555
+ billing: billing.shipping()
3488
3556
  });
3489
3557
  await subscriptionsApi.updatePaymentMethod(id, { opaqueData, billingAddress: billing.shipping() });
3490
3558
  return true;
@@ -6021,4 +6089,4 @@ export {
6021
6089
  hasConversion,
6022
6090
  useCatalogConversion
6023
6091
  };
6024
- //# sourceMappingURL=ONYGQYUN.jsx.map
6092
+ //# sourceMappingURL=VLVSEATQ.jsx.map
@@ -12,7 +12,7 @@ import {
12
12
  setAffiliateTokens,
13
13
  setTokens,
14
14
  usersApi
15
- } from "./AO3N6VTS.jsx";
15
+ } from "./MH43RC7G.jsx";
16
16
  import {
17
17
  getConfig,
18
18
  onConfigured
@@ -414,4 +414,4 @@ export {
414
414
  affiliateAuth_default,
415
415
  medication_default
416
416
  };
417
- //# sourceMappingURL=KK36ZETG.jsx.map
417
+ //# sourceMappingURL=XEWZ4OIT.jsx.map
@@ -1,9 +1,9 @@
1
1
  import { disqualificationReasonText, qualifiedDrugIds } from './LZWA44KD.js';
2
- import { SUPPORT_CATEGORIES, useSurveyFlow, reconcileCartAgainstCatalog, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, availableStateOptions, US_STATE_OPTIONS, useCheckoutFlow, catalogUnavailableMessage, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, isCatalogItemId, subscribeToSupportTopic, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, intakeEvidence, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, classifyCatalogError, groupDrugsByPharmacy, useProductCatalogEditor, skuBindingModeFor, isCssColorValue, categoryLabel, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, createCatalogProduct, addCatalogItemAsProduct, applyPriceDrafts, resolveStrengthPrices, invalidDraftKeys, orphanKey, ORPHAN_REASON, READINESS_LABEL, canOfferConversion, useCatalogConversion, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, offerSummaryText, LIFECYCLE_TONE, buildTrackingUrl, buildStrengthRows, isImageAttachment, buildRefillView, toTrackerRequest, MATCH_DEPENDENT_WARNINGS, SOURCE_FIELD_NOTE, MATCH_HOW_LABEL, explainFinding } from './E6KLEFN3.js';
3
- import { fetchFunnelConfig } from './CXMAV5SC.js';
2
+ import { SUPPORT_CATEGORIES, useSurveyFlow, reconcileCartAgainstCatalog, resolveSurveyV2DrugIntent, emailGateAnswered, redeemResumeLink, useSurveyV2Flow, US_STATE_OPTIONS, availableStateOptions, useCheckoutFlow, catalogUnavailableMessage, useCartCheckoutFlow, useSignupFlow, useRegisterFlow, useSubscribeFlow, useDashboardData, useUpdatePaymentMethodFlow, useMemberPortalData, useMessagesThread, captureFunnelEmail, markEmailGateAnswered, isCatalogItemId, subscribeToSupportTopic, useAffiliateStats, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, stateAvailabilityNote, hasStateRestrictions, uploadPrescriptionPhoto, deriveAttention, deriveJourney, buildTimeline, lifecycleReason, accountSource, intakeEvidence, LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, classifyCatalogError, groupDrugsByPharmacy, useProductCatalogEditor, skuBindingModeFor, isCssColorValue, categoryLabel, formatConversationTime, buildTrackerView, ACCOUNT_SOURCE_LABEL, fmtDay, createCatalogProduct, addCatalogItemAsProduct, applyPriceDrafts, resolveStrengthPrices, invalidDraftKeys, orphanKey, ORPHAN_REASON, READINESS_LABEL, canOfferConversion, useCatalogConversion, formatCalendarDate, formatMessageTime, formatEventDate, formatStageDate, offerSummaryText, LIFECYCLE_TONE, buildTrackingUrl, buildStrengthRows, isImageAttachment, buildRefillView, toTrackerRequest, MATCH_DEPENDENT_WARNINGS, SOURCE_FIELD_NOTE, MATCH_HOW_LABEL, explainFinding } from './YK2Y76A4.js';
3
+ import { fetchFunnelConfig } from './GYEK4TSP.js';
4
4
  import { usePrimitives } from './67KHO66G.js';
5
- import { cart_default, auth_default, affiliateAuth_default } from './46MIDHRD.js';
6
- import { usersApi, adminApi, membersApi, offersApi, affiliatePortalApi, authApi, adminAffiliatesApi, apiFetch, apexApi, adminCatalogApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, ApiError, subscriptionsApi } from './NEV5KNPS.js';
5
+ import { cart_default, auth_default, affiliateAuth_default } from './ATSYHZSR.js';
6
+ import { usersApi, adminApi, membersApi, offersApi, affiliatePortalApi, authApi, adminAffiliatesApi, apiFetch, apexApi, adminCatalogApi, SUPPORT_ATTACHMENT_MIME_TYPES, SUPPORT_ATTACHMENT_MAX_BYTES, ApiError, subscriptionsApi } from './U426ASG4.js';
7
7
  import { delegateEvents, createComponent, insert, memo, effect, setStyleProperty, mergeProps, use, setAttribute, addEventListener, style, className, Dynamic, Portal, template } from 'solid-js/web';
8
8
  import { createContext, createSignal, createEffect, on, Show, For, createResource, createMemo, untrack, ErrorBoundary, Switch, Match, onMount, onCleanup, useContext, Index } from 'solid-js';
9
9
  import { isQuestionVisible } from '@apextelemed/survey-core';
@@ -3048,7 +3048,7 @@ function AddressFields(props) {
3048
3048
  },
3049
3049
  onChange: (v) => a().setShippingField("state", v),
3050
3050
  get options() {
3051
- return availableStateOptions();
3051
+ return memo(() => !!props.billingOnly)() ? US_STATE_OPTIONS : availableStateOptions();
3052
3052
  },
3053
3053
  placeholder: "Select a state",
3054
3054
  get error() {
@@ -29504,5 +29504,5 @@ function primaryButtonStyle2(submitting) {
29504
29504
  }
29505
29505
 
29506
29506
  export { ADMIN_TAB_SEGMENTS, AFFILIATE_SUB_TAB_SEGMENTS, AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod, adminTabFromPath, adminTabPath, affiliateSubTabFromPath, affiliateSubTabPath };
29507
- //# sourceMappingURL=MPW4IVPB.js.map
29508
- //# sourceMappingURL=MPW4IVPB.js.map
29507
+ //# sourceMappingURL=XNP3VLLY.js.map
29508
+ //# sourceMappingURL=XNP3VLLY.js.map