@edx/frontend-app-alacarte-checkout 1.47.0 → 1.49.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 (118) hide show
  1. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js +3 -3
  2. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js.map +1 -1
  3. package/dist/components/AlacarteConfirmation/Messages.js +1 -1
  4. package/dist/components/AlacarteConfirmation/Messages.js.map +1 -1
  5. package/dist/components/Checkout/Checkout.js +5 -2
  6. package/dist/components/Checkout/Checkout.js.map +1 -1
  7. package/dist/components/Checkout/Messages.js +2 -2
  8. package/dist/components/Checkout/Messages.js.map +1 -1
  9. package/dist/components/CheckoutGate/CheckoutGate.js +1 -1
  10. package/dist/components/CheckoutGate/CheckoutGate.js.map +1 -1
  11. package/dist/components/PaymentFields/FieldError.d.ts +13 -0
  12. package/dist/components/PaymentFields/FieldError.js +8 -0
  13. package/dist/components/PaymentFields/FieldError.js.map +1 -0
  14. package/dist/components/PaymentFields/PaymentFields.d.ts +6 -1
  15. package/dist/components/PaymentFields/PaymentFields.js +4 -7
  16. package/dist/components/PaymentFields/PaymentFields.js.map +1 -1
  17. package/dist/components/PaymentForm/Messages.d.ts +46 -1
  18. package/dist/components/PaymentForm/Messages.js +49 -4
  19. package/dist/components/PaymentForm/Messages.js.map +1 -1
  20. package/dist/components/PaymentForm/PaymentForm.js +29 -17
  21. package/dist/components/PaymentForm/PaymentForm.js.map +1 -1
  22. package/dist/components/ProgramEnrollmentCard/ProgramEnrollmentCard.js +1 -1
  23. package/dist/components/ProgramEnrollmentCard/ProgramEnrollmentCard.js.map +1 -1
  24. package/dist/components/PromoCode/Messages.d.ts +0 -5
  25. package/dist/components/PromoCode/Messages.js +7 -12
  26. package/dist/components/PromoCode/Messages.js.map +1 -1
  27. package/dist/components/PromoCode/PromoCode.js +8 -6
  28. package/dist/components/PromoCode/PromoCode.js.map +1 -1
  29. package/dist/data/hooks/keys.d.ts +0 -2
  30. package/dist/data/hooks/keys.js +0 -2
  31. package/dist/data/hooks/keys.js.map +1 -1
  32. package/dist/data/hooks/useAlacarteQueries.d.ts +0 -4
  33. package/dist/data/hooks/useAlacarteQueries.js +0 -22
  34. package/dist/data/hooks/useAlacarteQueries.js.map +1 -1
  35. package/dist/data/hooks/useCheckout.js +18 -3
  36. package/dist/data/hooks/useCheckout.js.map +1 -1
  37. package/dist/routes.d.ts +2 -18
  38. package/dist/routes.js +0 -54
  39. package/dist/routes.js.map +1 -1
  40. package/dist/styles/components/alacarteConfirmation.scss +26 -2
  41. package/dist/styles/components/checkout.scss +7 -0
  42. package/dist/styles/components/orderBlockedModal.scss +3 -0
  43. package/dist/styles/components/paymentFields.scss +12 -0
  44. package/dist/styles/components/paymentForm.scss +16 -0
  45. package/dist/styles/components/programEnrollmentCard.scss +4 -4
  46. package/dist/styles/components/promoCode.scss +12 -4
  47. package/dist/types/alacarte.d.ts +0 -3
  48. package/dist/types/alacarte.js.map +1 -1
  49. package/dist/types.d.ts +2 -0
  50. package/dist/types.js.map +1 -1
  51. package/dist/utils/alacarteApi.d.ts +0 -4
  52. package/dist/utils/alacarteApi.js +1 -28
  53. package/dist/utils/alacarteApi.js.map +1 -1
  54. package/dist/utils/alacarteCheckout.js +0 -3
  55. package/dist/utils/alacarteCheckout.js.map +1 -1
  56. package/dist/utils/alacarteQueries.d.ts +0 -6
  57. package/dist/utils/alacarteQueries.js +0 -12
  58. package/dist/utils/alacarteQueries.js.map +1 -1
  59. package/dist/utils/provision.js +2 -2
  60. package/dist/utils/provision.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/components/OrderHistory/HelpCenter/HelpCenter.d.ts +0 -3
  63. package/dist/components/OrderHistory/HelpCenter/HelpCenter.js +0 -13
  64. package/dist/components/OrderHistory/HelpCenter/HelpCenter.js.map +0 -1
  65. package/dist/components/OrderHistory/HelpCenter/messages.d.ts +0 -13
  66. package/dist/components/OrderHistory/HelpCenter/messages.js +0 -15
  67. package/dist/components/OrderHistory/HelpCenter/messages.js.map +0 -1
  68. package/dist/components/OrderHistory/OrderHistory.d.ts +0 -3
  69. package/dist/components/OrderHistory/OrderHistory.js +0 -13
  70. package/dist/components/OrderHistory/OrderHistory.js.map +0 -1
  71. package/dist/components/OrderHistory/OrderHistoryCard.d.ts +0 -11
  72. package/dist/components/OrderHistory/OrderHistoryCard.js +0 -6
  73. package/dist/components/OrderHistory/OrderHistoryCard.js.map +0 -1
  74. package/dist/components/OrderHistory/OrderHistoryDetails.d.ts +0 -2
  75. package/dist/components/OrderHistory/OrderHistoryDetails.js +0 -157
  76. package/dist/components/OrderHistory/OrderHistoryDetails.js.map +0 -1
  77. package/dist/components/OrderHistory/OrderHistoryHeader.d.ts +0 -3
  78. package/dist/components/OrderHistory/OrderHistoryHeader.js +0 -9
  79. package/dist/components/OrderHistory/OrderHistoryHeader.js.map +0 -1
  80. package/dist/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.d.ts +0 -6
  81. package/dist/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.js +0 -60
  82. package/dist/components/OrderHistory/OrderHistoryTabDetails/PaymentHistory.js.map +0 -1
  83. package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.d.ts +0 -3
  84. package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.js +0 -9
  85. package/dist/components/OrderHistory/OrderHistoryTabDetails/SubscriptionDetails.js.map +0 -1
  86. package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.d.ts +0 -28
  87. package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.js +0 -30
  88. package/dist/components/OrderHistory/OrderHistoryTabDetails/messages.js.map +0 -1
  89. package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.d.ts +0 -6
  90. package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.js +0 -32
  91. package/dist/components/OrderHistory/OrderHistoryTabs/OrderHistoryTabs.js.map +0 -1
  92. package/dist/components/OrderHistory/OrderList.d.ts +0 -3
  93. package/dist/components/OrderHistory/OrderList.js +0 -12
  94. package/dist/components/OrderHistory/OrderList.js.map +0 -1
  95. package/dist/components/OrderHistory/ProgramItemsTable.d.ts +0 -8
  96. package/dist/components/OrderHistory/ProgramItemsTable.js +0 -49
  97. package/dist/components/OrderHistory/ProgramItemsTable.js.map +0 -1
  98. package/dist/components/OrderHistory/RefundNotice/RefundNotice.d.ts +0 -3
  99. package/dist/components/OrderHistory/RefundNotice/RefundNotice.js +0 -15
  100. package/dist/components/OrderHistory/RefundNotice/RefundNotice.js.map +0 -1
  101. package/dist/components/OrderHistory/RefundNotice/messages.d.ts +0 -18
  102. package/dist/components/OrderHistory/RefundNotice/messages.js +0 -20
  103. package/dist/components/OrderHistory/RefundNotice/messages.js.map +0 -1
  104. package/dist/components/OrderHistory/data/orderDetailsData.d.ts +0 -35
  105. package/dist/components/OrderHistory/data/orderDetailsData.js +0 -3
  106. package/dist/components/OrderHistory/data/orderDetailsData.js.map +0 -1
  107. package/dist/components/OrderHistory/data/receiptRows.d.ts +0 -17
  108. package/dist/components/OrderHistory/data/receiptRows.js +0 -16
  109. package/dist/components/OrderHistory/data/receiptRows.js.map +0 -1
  110. package/dist/components/OrderHistory/messages.d.ts +0 -108
  111. package/dist/components/OrderHistory/messages.js +0 -110
  112. package/dist/components/OrderHistory/messages.js.map +0 -1
  113. package/dist/types/orderHistory.d.ts +0 -16
  114. package/dist/types/orderHistory.js +0 -2
  115. package/dist/types/orderHistory.js.map +0 -1
  116. package/dist/utils/orderHistory.d.ts +0 -6
  117. package/dist/utils/orderHistory.js +0 -6
  118. package/dist/utils/orderHistory.js.map +0 -1
@@ -88,12 +88,12 @@ const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetai
88
88
  amount: discount.toFixed(2),
89
89
  currency,
90
90
  }) })] })), _jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--paid", children: [_jsx("span", { children: formatMessage(messages.amountPaid) }), _jsx("span", { children: money(paid) })] })] }));
91
- return (_jsx("div", { className: "alacarte-confirmation", "data-testid": "alacarte-confirmation", children: _jsxs(Row, { className: "alacarte-confirmation__row", children: [_jsxs(Col, { xs: 12, lg: 7, className: "alacarte-confirmation__main", children: [_jsx("h1", { ref: headlineRef, tabIndex: -1, className: "alacarte-confirmation__headline font-weight-bold mb-4", children: formatMessage(messages.headline) }), _jsx("p", { className: "alacarte-confirmation__subheadline mb-4", children: formatMessage(programOrder ? messages.subheadlineProgram : messages.subheadlineCourse, { productLabel }) }), _jsxs("div", { className: "alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5", children: [_jsx(Button, { variant: "brand", className: "alacarte-confirmation__cta-primary", onClick: onContinue, children: formatMessage(programOrder ? messages.startProgram : messages.startCourse) }), orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, target: "_blank", rel: "noopener noreferrer", className: "alacarte-confirmation__order-history", "aria-label": formatMessage(messages.viewOrderHistoryLabel), children: formatMessage(messages.viewOrderHistory) }))] }), _jsx("div", { className: "alacarte-confirmation__summary-mobile d-lg-none", children: summaryCard }), programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h2", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), purchasedCourseNames.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h3", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourseTotal }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: purchasedCourseNames.map((name) => (_jsx("li", { children: name }, name))) })] })), previouslyPurchased.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__previously-purchased", "data-testid": "confirmation-previously-purchased", children: [_jsx("h3", { className: "alacarte-confirmation__previously-purchased-heading", children: formatMessage(messages.previouslyPurchased, {
91
+ return (_jsx("div", { className: "alacarte-confirmation", "data-testid": "alacarte-confirmation", children: _jsxs(Row, { className: "alacarte-confirmation__row", children: [_jsxs(Col, { xs: 12, className: "alacarte-confirmation__main alacarte-confirmation__intro", children: [_jsx("h1", { ref: headlineRef, tabIndex: -1, className: "alacarte-confirmation__headline font-weight-bold mb-4", children: formatMessage(messages.headline) }), _jsx("p", { className: "alacarte-confirmation__subheadline mb-4", children: formatMessage(programOrder ? messages.subheadlineProgram : messages.subheadlineCourse, { productLabel }) }), _jsxs("div", { className: "alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5", children: [_jsx(Button, { variant: "brand", className: "alacarte-confirmation__cta-primary", onClick: onContinue, children: formatMessage(programOrder ? messages.startProgram : messages.startCourse) }), orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, target: "_blank", rel: "noopener noreferrer", className: "alacarte-confirmation__order-history", "aria-label": formatMessage(messages.viewOrderHistoryLabel), children: formatMessage(messages.viewOrderHistory) }))] })] }), _jsx(Col, { xs: 12, className: "alacarte-confirmation__summary-col", children: summaryCard }), _jsxs(Col, { xs: 12, className: "alacarte-confirmation__main alacarte-confirmation__details", children: [programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h3", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), purchasedCourseNames.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h4", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourseTotal }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: purchasedCourseNames.map((name) => (_jsx("li", { children: name }, name))) })] })), previouslyPurchased.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__previously-purchased", "data-testid": "confirmation-previously-purchased", children: [_jsx("h4", { className: "alacarte-confirmation__previously-purchased-heading", children: formatMessage(messages.previouslyPurchased, {
92
92
  count: previouslyPurchased.length,
93
- }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h2", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), _jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, {
93
+ }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h3", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h3", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), _jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, {
94
94
  email: (_jsx("a", { href: `mailto:${BILLING_SUPPORT_EMAIL}`, "aria-label": formatMessage(messages.billingEmailLabel), children: BILLING_SUPPORT_EMAIL })),
95
95
  refundPolicy: (_jsx("a", { href: REFUND_POLICY_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": formatMessage(messages.refundPolicyLabel), children: formatMessage(messages.refundPolicy) })),
96
- }) })] }), _jsx(Col, { xs: 12, lg: 5, className: "alacarte-confirmation__summary-col d-none d-lg-block", children: summaryCard })] }) }));
96
+ }) })] })] }) }));
97
97
  };
98
98
  export default AlacarteConfirmation;
99
99
  //# sourceMappingURL=AlacarteConfirmation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAoBlC,SAA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N,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,MAAM,aAClC,eAAK,SAAS,EAAC,MAAM,aACnB,aAAI,SAAS,EAAC,6DAA6D,YACxE,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,GACjC,EACL,YAAG,SAAS,EAAC,iBAAiB,YAAE,KAAK,CAAC,WAAW,GAAK,IAClD,EACN,0BACE,aAAI,SAAS,EAAC,6DAA6D,YACxE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GAClC,EACL,YAAG,SAAS,EAAC,iBAAiB,YAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,GAAK,IACnD,IACF,IACF,EAEN,aAAI,SAAS,EAAC,gCAAgC,GAAG,EACjD,YAAG,SAAS,EAAC,qDAAqD,YAC/D,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE;gCACpC,KAAK,EAAE,CACL,YACE,IAAI,EAAE,UAAU,qBAAqB,EAAE,gBAC3B,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,YAEpD,qBAAqB,GACpB,CACL;gCACD,YAAY,EAAE,CACZ,YACE,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,gBACb,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,YAEpD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GACnC,CACL;6BACF,CAAC,GACA,IACA,EAEN,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,sDAAsD,YACjF,WAAW,GACR,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { Alert, Button, Col, Icon, Row } from '@openedx/paragon';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives the purchase date. */\n placedAt?: string | null,\n}\n\nfunction normalizeName(name: string): string {\n return name.trim().toLowerCase().replace(/\\s+/g, ' ');\n}\n\nfunction isProgramOrder(order: PlacedOrder): boolean {\n return order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n\n // Checkout swaps to this view in place, unmounting the focused Pay now\n // button. Start keyboard and screen reader users at the headline so the\n // next Tab reaches the CTAs instead of restarting from the site header.\n const headlineRef = useRef<HTMLHeadingElement>(null);\n const hasOrder = !!order;\n useEffect(() => {\n if (hasOrder) headlineRef.current?.focus();\n }, [hasOrder]);\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const purchasedCourseNames = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeName));\n\n const previouslyPurchased = (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <aside\n className=\"alacarte-confirmation__summary\"\n aria-label={formatMessage(messages.purchaseSummary)}\n >\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {/* Decorative — the institution is named in the product title. */}\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" aria-hidden=\"true\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </aside>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} lg={7} className=\"alacarte-confirmation__main\">\n <h1\n ref={headlineRef}\n tabIndex={-1}\n className=\"alacarte-confirmation__headline font-weight-bold mb-4\"\n >\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a\n href={orderHistoryUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"alacarte-confirmation__order-history\"\n aria-label={formatMessage(messages.viewOrderHistoryLabel)}\n >\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n\n <div className=\"alacarte-confirmation__summary-mobile d-lg-none\">\n {summaryCard}\n </div>\n\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h2 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h2>\n {purchasedCourseNames.length > 0 && (\n <>\n <h3 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h3 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h2 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h2>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h2>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h2>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, {\n email: (\n <a\n href={`mailto:${BILLING_SUPPORT_EMAIL}`}\n aria-label={formatMessage(messages.billingEmailLabel)}\n >\n {BILLING_SUPPORT_EMAIL}\n </a>\n ),\n refundPolicy: (\n <a\n href={REFUND_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={formatMessage(messages.refundPolicyLabel)}\n >\n {formatMessage(messages.refundPolicy)}\n </a>\n ),\n })}\n </p>\n </Col>\n\n <Col xs={12} lg={5} className=\"alacarte-confirmation__summary-col d-none d-lg-block\">\n {summaryCard}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
1
+ {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC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CAAC,YAEpD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GACnC,CACL;6BACF,CAAC,GACA,IACA,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef } from 'react';\nimport { Alert, Button, Col, Icon, Row } from '@openedx/paragon';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives the purchase date. */\n placedAt?: string | null,\n}\n\nfunction normalizeName(name: string): string {\n return name.trim().toLowerCase().replace(/\\s+/g, ' ');\n}\n\nfunction isProgramOrder(order: PlacedOrder): boolean {\n return order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n\n // Checkout swaps to this view in place, unmounting the focused Pay now\n // button. Start keyboard and screen reader users at the headline so the\n // next Tab reaches the CTAs instead of restarting from the site header.\n const headlineRef = useRef<HTMLHeadingElement>(null);\n const hasOrder = !!order;\n useEffect(() => {\n if (hasOrder) headlineRef.current?.focus();\n }, [hasOrder]);\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const purchasedCourseNames = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeName));\n\n const previouslyPurchased = (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <aside\n className=\"alacarte-confirmation__summary\"\n aria-label={formatMessage(messages.purchaseSummary)}\n >\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {/* Decorative — the institution is named in the product title. */}\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" aria-hidden=\"true\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </aside>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n {/* DOM order is the reading order on every breakpoint: intro, purchase\n summary, then order details. From lg up, the grid in\n alacarteConfirmation.scss moves the summary to the right column. */}\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__intro\">\n <h1\n ref={headlineRef}\n tabIndex={-1}\n className=\"alacarte-confirmation__headline font-weight-bold mb-4\"\n >\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a\n href={orderHistoryUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"alacarte-confirmation__order-history\"\n aria-label={formatMessage(messages.viewOrderHistoryLabel)}\n >\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__summary-col\">\n {summaryCard}\n </Col>\n\n <Col xs={12} className=\"alacarte-confirmation__main alacarte-confirmation__details\">\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h3 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h3>\n {purchasedCourseNames.length > 0 && (\n <>\n <h4 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h4 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h4>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h3 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h3>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h3>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h3 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h3>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, {\n email: (\n <a\n href={`mailto:${BILLING_SUPPORT_EMAIL}`}\n aria-label={formatMessage(messages.billingEmailLabel)}\n >\n {BILLING_SUPPORT_EMAIL}\n </a>\n ),\n refundPolicy: (\n <a\n href={REFUND_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={formatMessage(messages.refundPolicyLabel)}\n >\n {formatMessage(messages.refundPolicy)}\n </a>\n ),\n })}\n </p>\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
@@ -52,7 +52,7 @@ const messages = defineMessages({
52
52
  },
53
53
  previouslyPurchased: {
54
54
  id: 'checkout.alacarteConfirmation.previouslyPurchased',
55
- defaultMessage: 'Previously purchased ({count}):',
55
+ defaultMessage: 'Courses previously purchased ({count}):',
56
56
  description: 'Heading above member courses the learner already owned before this order',
57
57
  },
58
58
  whatsIncluded: {
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,yFAAyF;QACzG,WAAW,EAAE,8DAA8D;KAC5E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,iCAAiC;QACjD,WAAW,EAAE,yDAAyD;KACvE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,gDAAgD;KAC9D;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,iDAAiD;KAC/D;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,mCAAmC;KACjD;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oCAAoC;KAClD;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,6CAA6C;KAC3D;IACD,qBAAqB,EAAE;Q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;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,4DAA4D;KAC1E;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,mCAAmC;QACnD,WAAW,EAAE,uEAAuE;KACrF;IACD,eAAe,EAAE;QACf,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,+CAA+C;KAC7D;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,uCAAuC;KACrD;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,oBAAoB;KAClC;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,oBAAoB;KAClC;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,uBAAuB;KACrC;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,wCAAwC;KACtD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when tPlacedOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n viewOrderHistoryLabel: {\n id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',\n defaultMessage: 'View order history, opens in a new tab',\n description: 'Accessible label for the order history link, which opens in a new tab',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundContact',\n defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',\n description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',\n },\n billingEmailLabel: {\n id: 'checkout.alacarteConfirmation.billingEmailLabel',\n defaultMessage: 'Email billing at edx dot org',\n description: 'Accessible label for the billing@edx.org email link',\n },\n refundPolicy: {\n id: 'checkout.alacarteConfirmation.refundPolicy',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy in the refund contact line',\n },\n refundPolicyLabel: {\n id: 'checkout.alacarteConfirmation.refundPolicyLabel',\n defaultMessage: 'Refund Policy, opens in a new tab',\n description: 'Accessible label for the Refund Policy link, which opens in a new tab',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,yFAAyF;QACzG,WAAW,EAAE,8DAA8D;KAC5E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,iCAAiC;QACjD,WAAW,EAAE,yDAAyD;KACvE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,gDAAgD;KAC9D;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,iDAAiD;KAC/D;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,mCAAmC;KACjD;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oCAAoC;KAClD;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,6CAA6C;KAC3D;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,wCAAwC;QACxD,WAAW,EAAE,uEAAuE;KACrF;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc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cAAc,EAAE,mCAAmC;QACnD,WAAW,EAAE,uEAAuE;KACrF;IACD,eAAe,EAAE;QACf,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,+CAA+C;KAC7D;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,uCAAuC;KACrD;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,oBAAoB;KAClC;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,oBAAoB;KAClC;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,uBAAuB;KACrC;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,wCAAwC;KACtD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when tPlacedOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n viewOrderHistoryLabel: {\n id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',\n defaultMessage: 'View order history, opens in a new tab',\n description: 'Accessible label for the order history link, which opens in a new tab',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Courses previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundContact',\n defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',\n description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',\n },\n billingEmailLabel: {\n id: 'checkout.alacarteConfirmation.billingEmailLabel',\n defaultMessage: 'Email billing at edx dot org',\n description: 'Accessible label for the billing@edx.org email link',\n },\n refundPolicy: {\n id: 'checkout.alacarteConfirmation.refundPolicy',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy in the refund contact line',\n },\n refundPolicyLabel: {\n id: 'checkout.alacarteConfirmation.refundPolicyLabel',\n defaultMessage: 'Refund Policy, opens in a new tab',\n description: 'Accessible label for the Refund Policy link, which opens in a new tab',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
@@ -246,14 +246,17 @@ const Checkout = (_a) => {
246
246
  const priceChangedKind = isProgramProduct ? 'program' : 'course';
247
247
  return (_jsxs(_Fragment, { children: [alacarteDebug, _jsxs(Row, { className: "checkout__container bg-light-200", children: [_jsx(CountryUnavailableModal, { isOpen: isBillingCountryBlocked, homeUrl: homeUrl }), alacarte.sanctionsBlocked && (_jsx(OrderBlockedModal, { isOpen: true, referenceCode: alacarte.sanctionsBlocked.referenceCode, homeUrl: homeUrl })), _jsx(Col, { xs: 12, className: isLocked ? 'checkout__locked-overlay' : '', children: _jsxs(Row, { className: "checkout__layout", children: [_jsx(Col, { xs: 12, className: "checkout__header", children: _jsxs("div", { children: [_jsx("h1", { className: "font-weight-bold text-primary-900 mb-lg-4", children: "Checkout" }), paymentTimedOut && (_jsx(PaymentTimeoutAlert, { className: "checkout__overlay-alert mb-3" })), isAlreadyOwned && (_jsxs(Alert, { variant: "danger", icon: ErrorIcon, className: "checkout__overlay-alert mb-3", "data-testid": "already-owned-alert", children: [_jsx("p", { className: "mb-3", children: formatMessage(((_p = alacarte.selector) === null || _p === void 0 ? void 0 : _p.kind) === 'program'
248
248
  ? messages.alreadyPaidProgram
249
- : messages.alreadyPaidCourse) }), _jsxs("div", { className: "d-flex align-items-center justify-content-end gap-3 flex-wrap", children: [orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, className: "text-gray-900 font-weight-bold", children: formatMessage(messages.viewOrderHistory) })), _jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleStartCourse, children: formatMessage(messages.goToCourse) })] })] })), c.error && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: c.clearError, children: c.error })), alacarte.placeOrderError && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPlaceOrderError, className: "mb-3", children: alacarte.placeOrderError })), ((_q = alacarte.paymentDecline) === null || _q === void 0 ? void 0 : _q.message) && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", "data-testid": "payment-decline-alert", children: getLearnerFacingStripeMessage({
249
+ : messages.alreadyPaidCourse) }), _jsxs("div", { className: "d-flex align-items-center justify-content-end gap-3 flex-wrap", children: [orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, className: "checkout__order-history text-gray-900 font-weight-bold", children: formatMessage(messages.viewOrderHistory) })), _jsx(Button, { variant: "brand", className: "rounded-pill", onClick: handleStartCourse, children: formatMessage(messages.goToCourse) })] })] })), c.error && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: c.clearError, children: c.error })), alacarte.placeOrderError && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPlaceOrderError, className: "mb-3", children: alacarte.placeOrderError })), ((_q = alacarte.paymentDecline) === null || _q === void 0 ? void 0 : _q.message) && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", "data-testid": "payment-decline-alert", children: getLearnerFacingStripeMessage({
250
250
  message: alacarte.paymentDecline.message,
251
251
  code: (_r = alacarte.paymentDecline.code) !== null && _r !== void 0 ? _r : undefined,
252
252
  }) })), alacarte.paymentInterrupted && !alacarte.paymentDecline && !alacarte.placeOrderError && !paymentTimedOut && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearPaymentInterrupted, className: "mb-3", "data-testid": "payment-interrupted-alert", children: formatMessage(messages.paymentInterruptedAlert) })), alacarte.couponError && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, dismissible: true, onClose: alacarte.clearCouponError, className: "mb-3", "data-testid": "coupon-error-alert", children: alacarte.couponError })), showPriceChangedAlert && (_jsx(PriceChangedAlert, { kind: priceChangedKind, onDismiss: () => setDismissedPriceChange(true), className: "mb-3" })), !alacarte.priceAccepted && !alacarte.priceChanged && isAlacarteReady && ((_s = alacarte.line) === null || _s === void 0 ? void 0 : _s.amountDue) && (_jsx(Alert, { variant: "info", className: "mb-3", "data-testid": "price-accept-notice", children: formatMessage(messages.priceChangedNotice, {
253
253
  amount: alacarte.line.amountDue.amount.toFixed(2),
254
254
  currency: alacarte.line.amountDue.currency,
255
255
  }) })), showForm && (_jsxs(_Fragment, { children: [_jsx(PaymentValidationAlert, { fields: invalidPaymentFields, country: c.billing.country, focusRequest: validationRequest, onFieldSelect: focusPaymentField, className: "mb-3" }), c.phase === 'failed' && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", children: failedMessage
256
- || formatMessage(messages.paymentProcessingDescription) })), appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (_jsxs(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: () => setDismissedCouponAlert(appliedCouponCode), className: "coupon-applied-alert", "data-testid": "coupon-applied-alert", role: "status", children: [_jsx("span", { "aria-hidden": "true", children: "\uD83C\uDF89 " }), formatMessage(messages.couponAppliedAlert)] })), alacarte.removedCouponCode && (() => {
256
+ || formatMessage(messages.paymentProcessingDescription) })), appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (_jsxs(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: () => setDismissedCouponAlert(appliedCouponCode), className: "coupon-applied-alert", "data-testid": "coupon-applied-alert", role: "status", children: [_jsx("span", { "aria-hidden": "true", children: "\uD83C\uDF89 " }), formatMessage(messages.couponAppliedAlert, {
257
+ code: appliedCouponCode,
258
+ percent: appliedDiscount.percent,
259
+ })] })), alacarte.removedCouponCode && (() => {
257
260
  const removedCode = alacarte.removedCouponCode;
258
261
  const removedText = formatMessage(messages.couponRemovedAlert, { code: removedCode });
259
262
  // Bold the interpolated code without baking markup into the
@@ -1 +1 @@
1
- {"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../src/components/Checkout/Checkout.tsx"],"names":[],"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C;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { Alert, Button, Col, Row } from '@openedx/paragon';\nimport { CheckCircle, Error as ErrorIcon } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport useCheckout from '../../data/hooks/useCheckout';\nimport type { UseCheckoutOptions } from '../../data/hooks/useCheckout';\nimport { useAlacarteCheckout } from '../../data/hooks/useAlacarteCheckout';\nimport { ALLOWED_CHECKOUT_COUNTRIES, GATE_CHECK_COUNTRY } from '../../constants';\nimport CartSummary from '../CartSummary/CartSummary';\nimport EnrollmentSummary from '../EnrollmentSummary/EnrollmentSummary';\nimport PaymentForm from '../PaymentForm/PaymentForm';\nimport CountryUnavailableModal from '../CountryUnavailableModal/CountryUnavailableModal';\nimport OrderBlockedModal from '../OrderBlockedModal/OrderBlockedModal';\nimport AlacarteNotice from '../AlacarteNotice/AlacarteNotice';\nimport AlacarteConfirmation from '../AlacarteConfirmation/AlacarteConfirmation';\nimport PaymentTimeoutAlert from '../PaymentTimeoutAlert/PaymentTimeoutAlert';\nimport PriceChangedAlert from '../PriceChangedAlert/PriceChangedAlert';\nimport PaymentValidationAlert from '../PaymentValidationAlert/PaymentValidationAlert';\nimport AlacarteDebugPanel from '../AlacarteDebugPanel/AlacarteDebugPanel'; // TEMPORARY — remove alongside AlacarteDebugPanel\nimport { getTrialDateRange } from '@src/utils';\nimport { getLearnerFacingCheckoutMessage } from '../../utils/checkoutErrors';\nimport { appliedDiscountPercent } from '../../utils/discount';\nimport { useInert } from '../../utils/inert';\nimport { getInvalidPaymentFields, isCardFieldKey } from '../../utils/paymentValidation';\nimport type { PaymentFieldKey } from '../../utils/paymentValidation';\nimport { confirmPaymentWithMethodId, getLearnerFacingStripeMessage } from '../../utils/stripeCard';\nimport { SuccessScreen, BlockedScreen, ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { BillingCycle, CourseDetail } from '../../types';\nimport type { ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\n\n// TEMPORARY — redirect-home-on-noActiveCheckout disabled per request; shows a\n// banner instead so the case is visible while the flow is being verified.\n// Flip back to true to restore the redirect.\nconst REDIRECT_ON_NO_ACTIVE_CHECKOUT = false;\n\nexport type CheckoutProps = UseCheckoutOptions & {\n /** Homepage URL for the country-unavailable modal CTA. */\n homeUrl?: string,\n /** Endpoint used to look up the representative IP for a selected country. */\n geolocationUrl?: string,\n /** Learner dashboard / order history URL for confirmation CTAs. */\n orderHistoryUrl?: string,\n /** PayPal JS SDK client id — enables the express PayPal button. */\n paypalClientId?: string,\n};\n\nconst Checkout = ({\n homeUrl = '/',\n orderHistoryUrl,\n paypalClientId,\n ...props\n}: CheckoutProps) => {\n const { formatMessage } = useIntl();\n const alacarte = useAlacarteCheckout({\n apiUrl: props.apiUrl,\n edxSessionUrl: props.edxSessionUrl,\n skipSubscriptionCourseRuns: props.skipSubscriptionCourseRuns,\n });\n const c = useCheckout(props);\n const [promoCodeValue, setPromoCodeValue] = useState('');\n const [dismissedCouponAlert, setDismissedCouponAlert] = useState<string | null>(null);\n // 0 hides the validation alert; each failed Pay now bumps it, which moves\n // focus to the alert.\n const [validationRequest, setValidationRequest] = useState(0);\n const [dismissedPriceChange, setDismissedPriceChange] = useState(false);\n // Last code we successfully priced — drives the \"Save {percent}% with code\n // {code}\" hint on the empty field while a coupon is not yet applied.\n const [advertisedOffer, setAdvertisedOffer] = useState<{ code: string, percent: number } | null>(null);\n const isAlacarteReady = (alacarte.phase === 'ready' || alacarte.phase === 'alreadyOwned') && !!alacarte.checkout;\n const appliedCouponCode = alacarte.checkout?.couponCode?.trim()\n ? alacarte.checkout.couponCode.trim()\n : null;\n const discountPercent = appliedDiscountPercent(alacarte.line);\n // Only treat the line discount as a removable coupon when the backend says\n // so (or a coupon code is present). Automatic offers show only in CartSummary's\n // discount row and must not drive PromoCode's applied/remove UI.\n const isCouponDiscount = !!alacarte.line?.discount\n && alacarte.line.discountSource !== 'automatic'\n && (alacarte.line.discountSource === 'coupon' || !!appliedCouponCode);\n const appliedDiscount = isCouponDiscount && discountPercent != null\n ? {\n percent: discountPercent,\n amount: alacarte.line!.discount!.amount,\n currency: alacarte.line!.discount!.currency,\n }\n : null;\n\n // Keep the coupon field in sync when a code is applied via URL or API.\n // Don't overwrite the field with empty when only an automatic offer applies.\n useEffect(() => {\n if (alacarte.checkout?.couponCode) {\n setPromoCodeValue(alacarte.checkout.couponCode);\n }\n }, [alacarte.checkout?.couponCode]);\n\n useEffect(() => {\n if (appliedCouponCode && isCouponDiscount && discountPercent != null) {\n setAdvertisedOffer({ code: appliedCouponCode, percent: discountPercent });\n }\n }, [appliedCouponCode, isCouponDiscount, discountPercent]);\n\n // No query params and no active cart — nothing to check out, send the\n // learner home rather than showing a placeholder.\n useEffect(() => {\n if (REDIRECT_ON_NO_ACTIVE_CHECKOUT && alacarte.phase === 'noActiveCheckout') {\n window.location.href = homeUrl;\n }\n }, [alacarte.phase, homeUrl]);\n\n // Express checkout (Apple Pay / Google Pay): runs the full place-order flow\n // using a wallet-provided PaymentMethod id instead of the mounted card element.\n const handleExpressPayment = useCallback(async (paymentMethodId: string, walletCountry?: string) => {\n if (!c.stripe) throw new Error('Stripe not loaded');\n const stripeInstance = c.stripe;\n const country = (c.billing.country || walletCountry || c.userCountry || '').trim().toUpperCase();\n if (!country) {\n throw new Error('Please select a country before using Apple Pay or Google Pay.');\n }\n\n await alacarte.placeOrderAsync({\n billing: {\n ...c.billing,\n country,\n },\n confirmCardPayment: async (clientSecret: string) => {\n await confirmPaymentWithMethodId({\n stripe: stripeInstance,\n clientSecret,\n paymentMethodId,\n });\n },\n });\n }, [alacarte, c.billing, c.userCountry, c.stripe]);\n\n // Express checkout (PayPal): tCheckoutPlaceOrder(PAYPAL) when the PayPal\n // button is clicked; approve/cancel go straight to the à la carte hook.\n // The card form isn't validated — PayPal collects the payer's details.\n const handlePaypalCreateOrder = useCallback(() => alacarte.startPaypalOrder({\n billing: {\n ...c.billing,\n country: c.billing.country || c.userCountry || '',\n },\n }), [alacarte, c.billing, c.userCountry]);\n\n const showProcessing\n = c.returningFromStripe\n && c.processingSubscription\n && c.phase !== 'success'\n && c.phase !== 'blocked'\n && c.phase !== 'failed';\n const showForm\n = !showProcessing\n && (c.phase === 'init'\n || c.phase === 'ready'\n || c.phase === 'failed'\n || c.phase === 'processing');\n const failedMessage = getLearnerFacingCheckoutMessage(c.lastComment);\n\n const { displayStart, displayEnd } = getTrialDateRange();\n\n const isBillingCountryBlocked = GATE_CHECK_COUNTRY\n && !!c.billing.country\n && !ALLOWED_CHECKOUT_COUNTRIES.includes(c.billing.country);\n\n const selectedCycle: BillingCycle = c.selectedCycle;\n\n // Prefer the à la carte course's own detail (skills/badge/image, richer than\n // the subscription flow's ?course_run_key= lookup) when we selected a course.\n // When already-owned the line may be null, so fall back to the selector kind.\n const isCourseProduct = alacarte.line?.kind === 'course' || alacarte.selector?.kind === 'course';\n const isProgramProduct = alacarte.line?.kind === 'program' || alacarte.selector?.kind === 'program';\n\n const alacarteCourseDetail: CourseDetail | null\n = isCourseProduct && alacarte.productDetail && 'maId' in alacarte.productDetail\n ? alacarte.productDetail\n : null;\n const courseForSummary = alacarteCourseDetail ?? c.course;\n\n const alacarteProgramDetail: ProgramDetail | null\n = isProgramProduct && alacarte.productDetail && 'tCourses' in alacarte.productDetail\n ? alacarte.productDetail\n : null;\n\n const handleStartCourse = () => {\n const alacarteCourseUrl = alacarteCourseDetail?.tUrlCourse\n || (alacarte.productDetail && 'tUrlCourse' in alacarte.productDetail\n ? alacarte.productDetail.tUrlCourse\n : null);\n if (alacarteCourseUrl) {\n window.location.href = alacarteCourseUrl;\n } else if (c.course?.tUrlCourse) {\n window.location.href = c.course.tUrlCourse;\n } else {\n window.location.href = homeUrl || '/';\n }\n };\n\n const courseLabel = c.course\n ? [c.course.tBrandText, c.course.maName].filter(Boolean).join(': ')\n : null;\n\n const isAlreadyOwned = alacarte.isAlreadyOwned;\n const { paymentTimedOut } = alacarte;\n // Grey out and block the form + summary; only the alerts above stay usable.\n const isLocked = isAlreadyOwned || paymentTimedOut;\n // The overlay only blocks the pointer — inert takes the locked content out\n // of the tab order too.\n const lockedInertRef = useInert<HTMLDivElement>(isLocked);\n\n // Live while shown, so the links drop off as the learner fixes each field.\n const invalidPaymentFields = validationRequest > 0\n ? getInvalidPaymentFields(c.cardFieldStates, c.billing)\n : [];\n const handleValidationResult = (invalidFields: PaymentFieldKey[]) => {\n setValidationRequest((n) => (invalidFields.length > 0 ? n + 1 : 0));\n };\n const focusPaymentField = (field: PaymentFieldKey) => {\n if (isCardFieldKey(field)) {\n c.focusCardField(field);\n } else {\n // Billing controls use the field key as their id (Form.Group controlId).\n document.getElementById(field)?.focus();\n }\n };\n\n if (showProcessing) {\n return <ProcessingScreen />;\n }\n\n // TEMPORARY — flip to true to dump à la carte hook state while validating\n // against the real backend. Remove AlacarteDebugPanel once the flow is solid.\n const SHOW_ALACARTE_DEBUG = false;\n const alacarteDebug = SHOW_ALACARTE_DEBUG\n ? <AlacarteDebugPanel data={alacarte} />\n : null;\n\n // Confirmation: show once the order is ready (or failed to load). While\n // tPlacedOrder is still polling, keep the checkout form so Pay now can show\n // \"Processing...\" instead of a full-page loader.\n if (alacarte.placedOrder || alacarte.placedOrderError) {\n const confirmationTitle = alacarte.line?.kind === 'program'\n ? alacarte.line.programName\n : alacarte.line?.kind === 'course'\n ? alacarte.line.courseName\n : null;\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container alacarte-confirmation__container bg-light-200\">\n <Col xs={12}>\n <AlacarteConfirmation\n order={alacarte.placedOrder}\n awaiting={false}\n error={alacarte.placedOrderError}\n onContinue={handleStartCourse}\n productDetail={alacarte.productDetail}\n productTitle={confirmationTitle}\n ownedCourses={\n alacarte.line?.kind === 'program'\n ? (alacarte.line.ownedCourses ?? null)\n : null\n }\n orderHistoryUrl={orderHistoryUrl ?? null}\n placedAt={alacarte.placedOrderPlacedAt}\n />\n </Col>\n </Row>\n </>\n );\n }\n\n if (alacarte.phase === 'loading') {\n return (\n <>\n {alacarteDebug}\n <ProcessingScreen />\n </>\n );\n }\n if (alacarte.phase === 'noActiveCheckout' && REDIRECT_ON_NO_ACTIVE_CHECKOUT) {\n // Redirects home via the effect above — show a spinner rather than a\n // notice while that happens.\n return (\n <>\n {alacarteDebug}\n <ProcessingScreen />\n </>\n );\n }\n if (alacarte.phase === 'noActiveCheckout') {\n return (\n <>\n {alacarteDebug}\n <AlacarteNotice messageId={alacarte.noticeMessageId!} />\n </>\n );\n }\n // Product unavailable / not found / not purchasable — banner only, no checkout form.\n if (alacarte.phase === 'notPurchasable' || alacarte.phase === 'error') {\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <Col xs={12}>\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n data-testid=\"alacarte-error-banner\"\n >\n {alacarte.error || 'Something went wrong with checkout.'}\n </Alert>\n </Col>\n </Row>\n </>\n );\n }\n\n // Price differs from what the learner viewed before checkout (ALC-159).\n const showPriceChangedAlert = !!alacarte.priceChanged && !dismissedPriceChange && !isLocked;\n const priceChangedKind = isProgramProduct ? 'program' : 'course';\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <CountryUnavailableModal\n isOpen={isBillingCountryBlocked}\n homeUrl={homeUrl}\n />\n {alacarte.sanctionsBlocked && (\n <OrderBlockedModal\n isOpen\n referenceCode={alacarte.sanctionsBlocked.referenceCode}\n homeUrl={homeUrl}\n />\n )}\n <Col xs={12} className={isLocked ? 'checkout__locked-overlay' : ''}>\n {/* DOM order is the tab order on every breakpoint: alerts, then the\n summary and coupon, then payment. From lg up, the grid in\n checkout.scss moves the summary to the right column. */}\n <Row className=\"checkout__layout\">\n <Col xs={12} className=\"checkout__header\">\n <div>\n <h1 className=\"font-weight-bold text-primary-900 mb-lg-4\">\n Checkout\n </h1>\n\n {paymentTimedOut && (\n <PaymentTimeoutAlert className=\"checkout__overlay-alert mb-3\" />\n )}\n\n {isAlreadyOwned && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"checkout__overlay-alert mb-3\"\n data-testid=\"already-owned-alert\"\n >\n <p className=\"mb-3\">\n {formatMessage(\n alacarte.selector?.kind === 'program'\n ? messages.alreadyPaidProgram\n : messages.alreadyPaidCourse,\n )}\n </p>\n <div className=\"d-flex align-items-center justify-content-end gap-3 flex-wrap\">\n {orderHistoryUrl && (\n <a href={orderHistoryUrl} className=\"text-gray-900 font-weight-bold\">\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n <Button variant=\"brand\" className=\"rounded-pill\" onClick={handleStartCourse}>\n {formatMessage(messages.goToCourse)}\n </Button>\n </div>\n </Alert>\n )}\n\n {c.error && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={c.clearError}\n >\n {c.error}\n </Alert>\n )}\n\n {alacarte.placeOrderError && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearPlaceOrderError}\n className=\"mb-3\"\n >\n {alacarte.placeOrderError}\n </Alert>\n )}\n\n {alacarte.paymentDecline?.message && !alacarte.placeOrderError && !paymentTimedOut && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"mb-3\"\n data-testid=\"payment-decline-alert\"\n >\n {getLearnerFacingStripeMessage({\n message: alacarte.paymentDecline.message,\n code: alacarte.paymentDecline.code ?? undefined,\n })}\n </Alert>\n )}\n {/* paymentInterrupted alert shown when payment is interrupted but not declined, no place order error, and payment has not timed out */}\n {alacarte.paymentInterrupted && !alacarte.paymentDecline && !alacarte.placeOrderError && !paymentTimedOut && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearPaymentInterrupted}\n className=\"mb-3\"\n data-testid=\"payment-interrupted-alert\"\n >\n {formatMessage(messages.paymentInterruptedAlert)}\n </Alert>\n )}\n\n {alacarte.couponError && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearCouponError}\n className=\"mb-3\"\n data-testid=\"coupon-error-alert\"\n >\n {alacarte.couponError}\n </Alert>\n )}\n\n {showPriceChangedAlert && (\n <PriceChangedAlert\n kind={priceChangedKind}\n onDismiss={() => setDismissedPriceChange(true)}\n className=\"mb-3\"\n />\n )}\n\n {!alacarte.priceAccepted && !alacarte.priceChanged && isAlacarteReady && alacarte.line?.amountDue && (\n <Alert variant=\"info\" className=\"mb-3\" data-testid=\"price-accept-notice\">\n {formatMessage(messages.priceChangedNotice, {\n amount: alacarte.line.amountDue.amount.toFixed(2),\n currency: alacarte.line.amountDue.currency,\n })}\n </Alert>\n )}\n\n {showForm && (\n <>\n <PaymentValidationAlert\n fields={invalidPaymentFields}\n country={c.billing.country}\n focusRequest={validationRequest}\n onFieldSelect={focusPaymentField}\n className=\"mb-3\"\n />\n {c.phase === 'failed' && (\n <Alert variant=\"danger\" icon={ErrorIcon} className=\"mb-3\">\n {failedMessage\n || formatMessage(messages.paymentProcessingDescription)}\n </Alert>\n )}\n {appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (\n <Alert\n variant=\"success\"\n icon={CheckCircle}\n dismissible\n closeLabel={formatMessage(messages.dismiss)}\n onClose={() => setDismissedCouponAlert(appliedCouponCode)}\n className=\"coupon-applied-alert\"\n data-testid=\"coupon-applied-alert\"\n role=\"status\"\n >\n <span aria-hidden=\"true\">🎉 </span>\n {formatMessage(messages.couponAppliedAlert)}\n </Alert>\n )}\n {alacarte.removedCouponCode && (() => {\n const removedCode = alacarte.removedCouponCode;\n const removedText = formatMessage(\n messages.couponRemovedAlert,\n { code: removedCode },\n );\n // Bold the interpolated code without baking markup into the\n // translation string — find it in the formatted sentence.\n const codeIndex = removedText.indexOf(removedCode);\n return (\n <Alert\n variant=\"success\"\n icon={CheckCircle}\n dismissible\n closeLabel={formatMessage(messages.dismiss)}\n onClose={alacarte.clearRemovedCouponCode}\n className=\"coupon-removed-alert\"\n data-testid=\"coupon-removed-alert\"\n role=\"status\"\n >\n {codeIndex === -1 ? removedText : (\n <>\n {removedText.slice(0, codeIndex)}\n <strong>{removedCode}</strong>\n {removedText.slice(codeIndex + removedCode.length)}\n </>\n )}\n </Alert>\n );\n })()}\n </>\n )}\n </div>\n </Col>\n\n {/* ── Summary — swaps to EnrollmentSummary on success ── */}\n <Col xs={12} className=\"payment__summary\">\n <div ref={lockedInertRef} data-testid=\"checkout-summary-region\">\n {c.phase === 'success' ? (\n <EnrollmentSummary\n course={c.course}\n onStartCourse={handleStartCourse}\n />\n ) : (\n <CartSummary\n defaultCycle={selectedCycle}\n onCycleChange={c.processingSubscription ? undefined : c.setCycle}\n course={courseForSummary}\n alacarteLine={alacarte.line}\n programDetail={alacarteProgramDetail}\n programName={alacarte.ownedProductName}\n promoCode={isAlacarteReady ? {\n value: promoCodeValue,\n onChange: (next) => {\n setPromoCodeValue(next);\n if (alacarte.couponError) alacarte.clearCouponError();\n },\n onApply: () => alacarte.applyCoupon(promoCodeValue),\n onRemove: () => {\n alacarte.removeCoupon();\n setPromoCodeValue('');\n setAdvertisedOffer(null);\n },\n appliedCode: appliedCouponCode,\n discount: appliedDiscount,\n offer: !appliedCouponCode ? advertisedOffer : null,\n error: alacarte.couponError,\n isApplying: alacarte.couponApplying,\n disabled: alacarte.placingOrder,\n } : null}\n />\n )}\n </div>\n </Col>\n\n {/* ── Payment ── */}\n <Col xs={12} className=\"payment__options\">\n <div ref={lockedInertRef} data-testid=\"checkout-payment-region\">\n {showForm && (\n <PaymentForm\n billing={c.billing}\n setField={c.setField}\n numberMountRef={c.numberMountRef}\n expiryMountRef={c.expiryMountRef}\n cvcMountRef={c.cvcMountRef}\n cardError={c.cardError}\n cardFieldStates={c.cardFieldStates}\n stripeReady={c.stripeReady}\n sessionReady={c.sessionReady}\n submitting={\n isAlacarteReady\n ? (alacarte.placingOrder || alacarte.awaitingPlacedOrder)\n : c.processingSubscription\n }\n onPlaceOrder={\n isAlacarteReady\n ? () => {\n alacarte.placeOrder({\n billing: {\n ...c.billing,\n // Country is required on tCheckoutPlaceOrder (two-letter ISO).\n // Prefer the form selection; fall back to gate geolocation.\n country: c.billing.country || c.userCountry || '',\n },\n confirmCardPayment: c.confirmCardPayment,\n });\n }\n : c.placeOrder\n }\n onValidationError={handleValidationResult}\n trialEnd={selectedCycle === 'monthly' ? displayEnd : undefined}\n priceToShow={null}\n cycleToShow={selectedCycle === 'monthly' ? 'monthly' : 'annual'}\n userCountry={c.userCountry}\n geolocationUrl={props.geolocationUrl}\n alacarteLine={alacarte.line}\n stripe={c.stripe}\n expressCountry={c.billing.country || c.userCountry || 'US'}\n onExpressPayment={isAlacarteReady ? handleExpressPayment : undefined}\n paypalClientId={paypalClientId}\n onPaypalCreateOrder={isAlacarteReady ? handlePaypalCreateOrder : undefined}\n onPaypalApprove={isAlacarteReady ? alacarte.approvePaypalOrder : undefined}\n onPaypalCancel={isAlacarteReady ? alacarte.cancelPaypalOrder : undefined}\n />\n )}\n\n {c.phase === 'success' && (\n <SuccessScreen\n subscriptionBiId={c.subscriptionDetails?.biId || ''}\n cardLast4={c.subscriptionDetails?.cardLast4 || ''}\n purchaseDate={displayStart}\n courseLabel={courseLabel}\n onFindCourse={handleStartCourse}\n />\n )}\n\n {c.phase === 'blocked' && (\n <BlockedScreen detail={c.lastComment} />\n )}\n </div>\n </Col>\n </Row>\n </Col>\n </Row>\n </>\n );\n};\n\nexport default Checkout;\n"]}
1
+ {"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../src/components/Checkout/Checkout.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,SAAS,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CAAC,CAAC,QAAQ,EAC/D,WAAW,EAAE,CAAC,CAAC,WAAW,EAC1B,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAChB,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,EAC1D,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,EACpE,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,EAC1E,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAC1E,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,GACxE,CACH,EAEA,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CACxB,KAAC,aAAa,IACZ,gBAAgB,EAAE,CAAA,MAAA,CAAC,CAAC,mBAAmB,0CAAE,IAAI,KAAI,EAAE,EACnD,SAAS,EAAE,CAAA,MAAA,CAAC,CAAC,mBAAmB,0CAAE,SAAS,KAAI,EAAE,EACjD,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,iBAAiB,GAC/B,CACH,EAEA,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CACxB,KAAC,aAAa,IAAC,MAAM,EAAE,CAAC,CAAC,WAAW,GAAI,CACzC,IACG,GACF,IACF,GACF,IACF,IACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { Alert, Button, Col, Row } from '@openedx/paragon';\nimport { CheckCircle, Error as ErrorIcon } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport useCheckout from '../../data/hooks/useCheckout';\nimport type { UseCheckoutOptions } from '../../data/hooks/useCheckout';\nimport { useAlacarteCheckout } from '../../data/hooks/useAlacarteCheckout';\nimport { ALLOWED_CHECKOUT_COUNTRIES, GATE_CHECK_COUNTRY } from '../../constants';\nimport CartSummary from '../CartSummary/CartSummary';\nimport EnrollmentSummary from '../EnrollmentSummary/EnrollmentSummary';\nimport PaymentForm from '../PaymentForm/PaymentForm';\nimport CountryUnavailableModal from '../CountryUnavailableModal/CountryUnavailableModal';\nimport OrderBlockedModal from '../OrderBlockedModal/OrderBlockedModal';\nimport AlacarteNotice from '../AlacarteNotice/AlacarteNotice';\nimport AlacarteConfirmation from '../AlacarteConfirmation/AlacarteConfirmation';\nimport PaymentTimeoutAlert from '../PaymentTimeoutAlert/PaymentTimeoutAlert';\nimport PriceChangedAlert from '../PriceChangedAlert/PriceChangedAlert';\nimport PaymentValidationAlert from '../PaymentValidationAlert/PaymentValidationAlert';\nimport AlacarteDebugPanel from '../AlacarteDebugPanel/AlacarteDebugPanel'; // TEMPORARY — remove alongside AlacarteDebugPanel\nimport { getTrialDateRange } from '@src/utils';\nimport { getLearnerFacingCheckoutMessage } from '../../utils/checkoutErrors';\nimport { appliedDiscountPercent } from '../../utils/discount';\nimport { useInert } from '../../utils/inert';\nimport { getInvalidPaymentFields, isCardFieldKey } from '../../utils/paymentValidation';\nimport type { PaymentFieldKey } from '../../utils/paymentValidation';\nimport { confirmPaymentWithMethodId, getLearnerFacingStripeMessage } from '../../utils/stripeCard';\nimport { SuccessScreen, BlockedScreen, ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { BillingCycle, CourseDetail } from '../../types';\nimport type { ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\n\n// TEMPORARY — redirect-home-on-noActiveCheckout disabled per request; shows a\n// banner instead so the case is visible while the flow is being verified.\n// Flip back to true to restore the redirect.\nconst REDIRECT_ON_NO_ACTIVE_CHECKOUT = false;\n\nexport type CheckoutProps = UseCheckoutOptions & {\n /** Homepage URL for the country-unavailable modal CTA. */\n homeUrl?: string,\n /** Endpoint used to look up the representative IP for a selected country. */\n geolocationUrl?: string,\n /** Learner dashboard / order history URL for confirmation CTAs. */\n orderHistoryUrl?: string,\n /** PayPal JS SDK client id — enables the express PayPal button. */\n paypalClientId?: string,\n};\n\nconst Checkout = ({\n homeUrl = '/',\n orderHistoryUrl,\n paypalClientId,\n ...props\n}: CheckoutProps) => {\n const { formatMessage } = useIntl();\n const alacarte = useAlacarteCheckout({\n apiUrl: props.apiUrl,\n edxSessionUrl: props.edxSessionUrl,\n skipSubscriptionCourseRuns: props.skipSubscriptionCourseRuns,\n });\n const c = useCheckout(props);\n const [promoCodeValue, setPromoCodeValue] = useState('');\n const [dismissedCouponAlert, setDismissedCouponAlert] = useState<string | null>(null);\n // 0 hides the validation alert; each failed Pay now bumps it, which moves\n // focus to the alert.\n const [validationRequest, setValidationRequest] = useState(0);\n const [dismissedPriceChange, setDismissedPriceChange] = useState(false);\n // Last code we successfully priced — drives the \"Save {percent}% with code\n // {code}\" hint on the empty field while a coupon is not yet applied.\n const [advertisedOffer, setAdvertisedOffer] = useState<{ code: string, percent: number } | null>(null);\n const isAlacarteReady = (alacarte.phase === 'ready' || alacarte.phase === 'alreadyOwned') && !!alacarte.checkout;\n const appliedCouponCode = alacarte.checkout?.couponCode?.trim()\n ? alacarte.checkout.couponCode.trim()\n : null;\n const discountPercent = appliedDiscountPercent(alacarte.line);\n // Only treat the line discount as a removable coupon when the backend says\n // so (or a coupon code is present). Automatic offers show only in CartSummary's\n // discount row and must not drive PromoCode's applied/remove UI.\n const isCouponDiscount = !!alacarte.line?.discount\n && alacarte.line.discountSource !== 'automatic'\n && (alacarte.line.discountSource === 'coupon' || !!appliedCouponCode);\n const appliedDiscount = isCouponDiscount && discountPercent != null\n ? {\n percent: discountPercent,\n amount: alacarte.line!.discount!.amount,\n currency: alacarte.line!.discount!.currency,\n }\n : null;\n\n // Keep the coupon field in sync when a code is applied via URL or API.\n // Don't overwrite the field with empty when only an automatic offer applies.\n useEffect(() => {\n if (alacarte.checkout?.couponCode) {\n setPromoCodeValue(alacarte.checkout.couponCode);\n }\n }, [alacarte.checkout?.couponCode]);\n\n useEffect(() => {\n if (appliedCouponCode && isCouponDiscount && discountPercent != null) {\n setAdvertisedOffer({ code: appliedCouponCode, percent: discountPercent });\n }\n }, [appliedCouponCode, isCouponDiscount, discountPercent]);\n\n // No query params and no active cart — nothing to check out, send the\n // learner home rather than showing a placeholder.\n useEffect(() => {\n if (REDIRECT_ON_NO_ACTIVE_CHECKOUT && alacarte.phase === 'noActiveCheckout') {\n window.location.href = homeUrl;\n }\n }, [alacarte.phase, homeUrl]);\n\n // Express checkout (Apple Pay / Google Pay): runs the full place-order flow\n // using a wallet-provided PaymentMethod id instead of the mounted card element.\n const handleExpressPayment = useCallback(async (paymentMethodId: string, walletCountry?: string) => {\n if (!c.stripe) throw new Error('Stripe not loaded');\n const stripeInstance = c.stripe;\n const country = (c.billing.country || walletCountry || c.userCountry || '').trim().toUpperCase();\n if (!country) {\n throw new Error('Please select a country before using Apple Pay or Google Pay.');\n }\n\n await alacarte.placeOrderAsync({\n billing: {\n ...c.billing,\n country,\n },\n confirmCardPayment: async (clientSecret: string) => {\n await confirmPaymentWithMethodId({\n stripe: stripeInstance,\n clientSecret,\n paymentMethodId,\n });\n },\n });\n }, [alacarte, c.billing, c.userCountry, c.stripe]);\n\n // Express checkout (PayPal): tCheckoutPlaceOrder(PAYPAL) when the PayPal\n // button is clicked; approve/cancel go straight to the à la carte hook.\n // The card form isn't validated — PayPal collects the payer's details.\n const handlePaypalCreateOrder = useCallback(() => alacarte.startPaypalOrder({\n billing: {\n ...c.billing,\n country: c.billing.country || c.userCountry || '',\n },\n }), [alacarte, c.billing, c.userCountry]);\n\n const showProcessing\n = c.returningFromStripe\n && c.processingSubscription\n && c.phase !== 'success'\n && c.phase !== 'blocked'\n && c.phase !== 'failed';\n const showForm\n = !showProcessing\n && (c.phase === 'init'\n || c.phase === 'ready'\n || c.phase === 'failed'\n || c.phase === 'processing');\n const failedMessage = getLearnerFacingCheckoutMessage(c.lastComment);\n\n const { displayStart, displayEnd } = getTrialDateRange();\n\n const isBillingCountryBlocked = GATE_CHECK_COUNTRY\n && !!c.billing.country\n && !ALLOWED_CHECKOUT_COUNTRIES.includes(c.billing.country);\n\n const selectedCycle: BillingCycle = c.selectedCycle;\n\n // Prefer the à la carte course's own detail (skills/badge/image, richer than\n // the subscription flow's ?course_run_key= lookup) when we selected a course.\n // When already-owned the line may be null, so fall back to the selector kind.\n const isCourseProduct = alacarte.line?.kind === 'course' || alacarte.selector?.kind === 'course';\n const isProgramProduct = alacarte.line?.kind === 'program' || alacarte.selector?.kind === 'program';\n\n const alacarteCourseDetail: CourseDetail | null\n = isCourseProduct && alacarte.productDetail && 'maId' in alacarte.productDetail\n ? alacarte.productDetail\n : null;\n const courseForSummary = alacarteCourseDetail ?? c.course;\n\n const alacarteProgramDetail: ProgramDetail | null\n = isProgramProduct && alacarte.productDetail && 'tCourses' in alacarte.productDetail\n ? alacarte.productDetail\n : null;\n\n const handleStartCourse = () => {\n const alacarteCourseUrl = alacarteCourseDetail?.tUrlCourse\n || (alacarte.productDetail && 'tUrlCourse' in alacarte.productDetail\n ? alacarte.productDetail.tUrlCourse\n : null);\n if (alacarteCourseUrl) {\n window.location.href = alacarteCourseUrl;\n } else if (c.course?.tUrlCourse) {\n window.location.href = c.course.tUrlCourse;\n } else {\n window.location.href = homeUrl || '/';\n }\n };\n\n const courseLabel = c.course\n ? [c.course.tBrandText, c.course.maName].filter(Boolean).join(': ')\n : null;\n\n const isAlreadyOwned = alacarte.isAlreadyOwned;\n const { paymentTimedOut } = alacarte;\n // Grey out and block the form + summary; only the alerts above stay usable.\n const isLocked = isAlreadyOwned || paymentTimedOut;\n // The overlay only blocks the pointer — inert takes the locked content out\n // of the tab order too.\n const lockedInertRef = useInert<HTMLDivElement>(isLocked);\n\n // Live while shown, so the links drop off as the learner fixes each field.\n const invalidPaymentFields = validationRequest > 0\n ? getInvalidPaymentFields(c.cardFieldStates, c.billing)\n : [];\n const handleValidationResult = (invalidFields: PaymentFieldKey[]) => {\n setValidationRequest((n) => (invalidFields.length > 0 ? n + 1 : 0));\n };\n const focusPaymentField = (field: PaymentFieldKey) => {\n if (isCardFieldKey(field)) {\n c.focusCardField(field);\n } else {\n // Billing controls use the field key as their id (Form.Group controlId).\n document.getElementById(field)?.focus();\n }\n };\n\n if (showProcessing) {\n return <ProcessingScreen />;\n }\n\n // TEMPORARY — flip to true to dump à la carte hook state while validating\n // against the real backend. Remove AlacarteDebugPanel once the flow is solid.\n const SHOW_ALACARTE_DEBUG = false;\n const alacarteDebug = SHOW_ALACARTE_DEBUG\n ? <AlacarteDebugPanel data={alacarte} />\n : null;\n\n // Confirmation: show once the order is ready (or failed to load). While\n // tPlacedOrder is still polling, keep the checkout form so Pay now can show\n // \"Processing...\" instead of a full-page loader.\n if (alacarte.placedOrder || alacarte.placedOrderError) {\n const confirmationTitle = alacarte.line?.kind === 'program'\n ? alacarte.line.programName\n : alacarte.line?.kind === 'course'\n ? alacarte.line.courseName\n : null;\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container alacarte-confirmation__container bg-light-200\">\n <Col xs={12}>\n <AlacarteConfirmation\n order={alacarte.placedOrder}\n awaiting={false}\n error={alacarte.placedOrderError}\n onContinue={handleStartCourse}\n productDetail={alacarte.productDetail}\n productTitle={confirmationTitle}\n ownedCourses={\n alacarte.line?.kind === 'program'\n ? (alacarte.line.ownedCourses ?? null)\n : null\n }\n orderHistoryUrl={orderHistoryUrl ?? null}\n placedAt={alacarte.placedOrderPlacedAt}\n />\n </Col>\n </Row>\n </>\n );\n }\n\n if (alacarte.phase === 'loading') {\n return (\n <>\n {alacarteDebug}\n <ProcessingScreen />\n </>\n );\n }\n if (alacarte.phase === 'noActiveCheckout' && REDIRECT_ON_NO_ACTIVE_CHECKOUT) {\n // Redirects home via the effect above — show a spinner rather than a\n // notice while that happens.\n return (\n <>\n {alacarteDebug}\n <ProcessingScreen />\n </>\n );\n }\n if (alacarte.phase === 'noActiveCheckout') {\n return (\n <>\n {alacarteDebug}\n <AlacarteNotice messageId={alacarte.noticeMessageId!} />\n </>\n );\n }\n // Product unavailable / not found / not purchasable — banner only, no checkout form.\n if (alacarte.phase === 'notPurchasable' || alacarte.phase === 'error') {\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <Col xs={12}>\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n data-testid=\"alacarte-error-banner\"\n >\n {alacarte.error || 'Something went wrong with checkout.'}\n </Alert>\n </Col>\n </Row>\n </>\n );\n }\n\n // Price differs from what the learner viewed before checkout (ALC-159).\n const showPriceChangedAlert = !!alacarte.priceChanged && !dismissedPriceChange && !isLocked;\n const priceChangedKind = isProgramProduct ? 'program' : 'course';\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <CountryUnavailableModal\n isOpen={isBillingCountryBlocked}\n homeUrl={homeUrl}\n />\n {alacarte.sanctionsBlocked && (\n <OrderBlockedModal\n isOpen\n referenceCode={alacarte.sanctionsBlocked.referenceCode}\n homeUrl={homeUrl}\n />\n )}\n <Col xs={12} className={isLocked ? 'checkout__locked-overlay' : ''}>\n {/* DOM order is the tab order on every breakpoint: alerts, then the\n summary and coupon, then payment. From lg up, the grid in\n checkout.scss moves the summary to the right column. */}\n <Row className=\"checkout__layout\">\n <Col xs={12} className=\"checkout__header\">\n <div>\n <h1 className=\"font-weight-bold text-primary-900 mb-lg-4\">\n Checkout\n </h1>\n\n {paymentTimedOut && (\n <PaymentTimeoutAlert className=\"checkout__overlay-alert mb-3\" />\n )}\n\n {isAlreadyOwned && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"checkout__overlay-alert mb-3\"\n data-testid=\"already-owned-alert\"\n >\n <p className=\"mb-3\">\n {formatMessage(\n alacarte.selector?.kind === 'program'\n ? messages.alreadyPaidProgram\n : messages.alreadyPaidCourse,\n )}\n </p>\n <div className=\"d-flex align-items-center justify-content-end gap-3 flex-wrap\">\n {orderHistoryUrl && (\n <a href={orderHistoryUrl} className=\"checkout__order-history text-gray-900 font-weight-bold\">\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n <Button variant=\"brand\" className=\"rounded-pill\" onClick={handleStartCourse}>\n {formatMessage(messages.goToCourse)}\n </Button>\n </div>\n </Alert>\n )}\n\n {c.error && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={c.clearError}\n >\n {c.error}\n </Alert>\n )}\n\n {alacarte.placeOrderError && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearPlaceOrderError}\n className=\"mb-3\"\n >\n {alacarte.placeOrderError}\n </Alert>\n )}\n\n {alacarte.paymentDecline?.message && !alacarte.placeOrderError && !paymentTimedOut && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"mb-3\"\n data-testid=\"payment-decline-alert\"\n >\n {getLearnerFacingStripeMessage({\n message: alacarte.paymentDecline.message,\n code: alacarte.paymentDecline.code ?? undefined,\n })}\n </Alert>\n )}\n {/* paymentInterrupted alert shown when payment is interrupted but not declined, no place order error, and payment has not timed out */}\n {alacarte.paymentInterrupted && !alacarte.paymentDecline && !alacarte.placeOrderError && !paymentTimedOut && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearPaymentInterrupted}\n className=\"mb-3\"\n data-testid=\"payment-interrupted-alert\"\n >\n {formatMessage(messages.paymentInterruptedAlert)}\n </Alert>\n )}\n\n {alacarte.couponError && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n dismissible\n onClose={alacarte.clearCouponError}\n className=\"mb-3\"\n data-testid=\"coupon-error-alert\"\n >\n {alacarte.couponError}\n </Alert>\n )}\n\n {showPriceChangedAlert && (\n <PriceChangedAlert\n kind={priceChangedKind}\n onDismiss={() => setDismissedPriceChange(true)}\n className=\"mb-3\"\n />\n )}\n\n {!alacarte.priceAccepted && !alacarte.priceChanged && isAlacarteReady && alacarte.line?.amountDue && (\n <Alert variant=\"info\" className=\"mb-3\" data-testid=\"price-accept-notice\">\n {formatMessage(messages.priceChangedNotice, {\n amount: alacarte.line.amountDue.amount.toFixed(2),\n currency: alacarte.line.amountDue.currency,\n })}\n </Alert>\n )}\n\n {showForm && (\n <>\n <PaymentValidationAlert\n fields={invalidPaymentFields}\n country={c.billing.country}\n focusRequest={validationRequest}\n onFieldSelect={focusPaymentField}\n className=\"mb-3\"\n />\n {c.phase === 'failed' && (\n <Alert variant=\"danger\" icon={ErrorIcon} className=\"mb-3\">\n {failedMessage\n || formatMessage(messages.paymentProcessingDescription)}\n </Alert>\n )}\n {appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (\n <Alert\n variant=\"success\"\n icon={CheckCircle}\n dismissible\n closeLabel={formatMessage(messages.dismiss)}\n onClose={() => setDismissedCouponAlert(appliedCouponCode)}\n className=\"coupon-applied-alert\"\n data-testid=\"coupon-applied-alert\"\n role=\"status\"\n >\n <span aria-hidden=\"true\">🎉 </span>\n {formatMessage(messages.couponAppliedAlert, {\n code: appliedCouponCode,\n percent: appliedDiscount.percent,\n })}\n </Alert>\n )}\n {alacarte.removedCouponCode && (() => {\n const removedCode = alacarte.removedCouponCode;\n const removedText = formatMessage(\n messages.couponRemovedAlert,\n { code: removedCode },\n );\n // Bold the interpolated code without baking markup into the\n // translation string — find it in the formatted sentence.\n const codeIndex = removedText.indexOf(removedCode);\n return (\n <Alert\n variant=\"success\"\n icon={CheckCircle}\n dismissible\n closeLabel={formatMessage(messages.dismiss)}\n onClose={alacarte.clearRemovedCouponCode}\n className=\"coupon-removed-alert\"\n data-testid=\"coupon-removed-alert\"\n role=\"status\"\n >\n {codeIndex === -1 ? removedText : (\n <>\n {removedText.slice(0, codeIndex)}\n <strong>{removedCode}</strong>\n {removedText.slice(codeIndex + removedCode.length)}\n </>\n )}\n </Alert>\n );\n })()}\n </>\n )}\n </div>\n </Col>\n\n {/* ── Summary — swaps to EnrollmentSummary on success ── */}\n <Col xs={12} className=\"payment__summary\">\n <div ref={lockedInertRef} data-testid=\"checkout-summary-region\">\n {c.phase === 'success' ? (\n <EnrollmentSummary\n course={c.course}\n onStartCourse={handleStartCourse}\n />\n ) : (\n <CartSummary\n defaultCycle={selectedCycle}\n onCycleChange={c.processingSubscription ? undefined : c.setCycle}\n course={courseForSummary}\n alacarteLine={alacarte.line}\n programDetail={alacarteProgramDetail}\n programName={alacarte.ownedProductName}\n promoCode={isAlacarteReady ? {\n value: promoCodeValue,\n onChange: (next) => {\n setPromoCodeValue(next);\n if (alacarte.couponError) alacarte.clearCouponError();\n },\n onApply: () => alacarte.applyCoupon(promoCodeValue),\n onRemove: () => {\n alacarte.removeCoupon();\n setPromoCodeValue('');\n setAdvertisedOffer(null);\n },\n appliedCode: appliedCouponCode,\n discount: appliedDiscount,\n offer: !appliedCouponCode ? advertisedOffer : null,\n error: alacarte.couponError,\n isApplying: alacarte.couponApplying,\n disabled: alacarte.placingOrder,\n } : null}\n />\n )}\n </div>\n </Col>\n\n {/* ── Payment ── */}\n <Col xs={12} className=\"payment__options\">\n <div ref={lockedInertRef} data-testid=\"checkout-payment-region\">\n {showForm && (\n <PaymentForm\n billing={c.billing}\n setField={c.setField}\n numberMountRef={c.numberMountRef}\n expiryMountRef={c.expiryMountRef}\n cvcMountRef={c.cvcMountRef}\n cardError={c.cardError}\n cardFieldStates={c.cardFieldStates}\n stripeReady={c.stripeReady}\n sessionReady={c.sessionReady}\n submitting={\n isAlacarteReady\n ? (alacarte.placingOrder || alacarte.awaitingPlacedOrder)\n : c.processingSubscription\n }\n onPlaceOrder={\n isAlacarteReady\n ? () => {\n alacarte.placeOrder({\n billing: {\n ...c.billing,\n // Country is required on tCheckoutPlaceOrder (two-letter ISO).\n // Prefer the form selection; fall back to gate geolocation.\n country: c.billing.country || c.userCountry || '',\n },\n confirmCardPayment: c.confirmCardPayment,\n });\n }\n : c.placeOrder\n }\n onValidationError={handleValidationResult}\n trialEnd={selectedCycle === 'monthly' ? displayEnd : undefined}\n priceToShow={null}\n cycleToShow={selectedCycle === 'monthly' ? 'monthly' : 'annual'}\n userCountry={c.userCountry}\n geolocationUrl={props.geolocationUrl}\n alacarteLine={alacarte.line}\n stripe={c.stripe}\n expressCountry={c.billing.country || c.userCountry || 'US'}\n onExpressPayment={isAlacarteReady ? handleExpressPayment : undefined}\n paypalClientId={paypalClientId}\n onPaypalCreateOrder={isAlacarteReady ? handlePaypalCreateOrder : undefined}\n onPaypalApprove={isAlacarteReady ? alacarte.approvePaypalOrder : undefined}\n onPaypalCancel={isAlacarteReady ? alacarte.cancelPaypalOrder : undefined}\n />\n )}\n\n {c.phase === 'success' && (\n <SuccessScreen\n subscriptionBiId={c.subscriptionDetails?.biId || ''}\n cardLast4={c.subscriptionDetails?.cardLast4 || ''}\n purchaseDate={displayStart}\n courseLabel={courseLabel}\n onFindCourse={handleStartCourse}\n />\n )}\n\n {c.phase === 'blocked' && (\n <BlockedScreen detail={c.lastComment} />\n )}\n </div>\n </Col>\n </Row>\n </Col>\n </Row>\n </>\n );\n};\n\nexport default Checkout;\n"]}
@@ -17,8 +17,8 @@ const messages = defineMessages({
17
17
  },
18
18
  couponAppliedAlert: {
19
19
  id: 'checkout.couponAppliedAlert',
20
- defaultMessage: 'Discount applied',
21
- description: 'Success alert shown above payment methods after a discount is applied',
20
+ defaultMessage: 'Coupon code {code} applied for {percent}% off!',
21
+ description: 'Success alert shown at the top of checkout after a coupon is applied, e.g. "Coupon code SAVE15 applied for 15% off!"',
22
22
  },
23
23
  couponRemovedAlert: {
24
24
  id: 'checkout.couponRemovedAlert',
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/Checkout/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,4BAA4B,EAAE;QAC5B,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,oFAAoF;QACpG,WAAW,EAAE,gCAAgC;KAC9C;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,uGAAuG;QACvH,WAAW,EAAE,6EAA6E;KAC3F;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,0FAA0F;QAC1G,WAAW,EAAE,2FAA2F;KACzG;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,uEAAuE;KACrF;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,gDAAgD;QAChE,WAAW,EAAE,qEAAqE;KACnF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,yCAAyC;KACvD;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,sEAAsE;QACtF,WAAW,EAAE,sDAAsD;KACpE;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,uEAAuE;QACvF,WAAW,EAAE,uDAAuD;KACrE;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,iDAAiD;KAC/D;IACD,UAAU,EAAE;QACV,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,4DAA4D;KAC1E;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n paymentProcessingDescription: {\n id: 'checkout.paymentForm.paymentProcessingdescription',\n defaultMessage: 'Your payment could not be processed. Please check your card details and try again.',\n description: 'Payment processing description',\n },\n paymentInterruptedAlert: {\n id: 'checkout.paymentInterruptedAlert',\n defaultMessage: \"Your payment wasn't completed, and you haven't been charged. Try again or use another payment method.\",\n description: 'Alert shown when the learner returns to checkout without completing payment',\n },\n priceChangedNotice: {\n id: 'checkout.alacarte.priceChangedNotice',\n defaultMessage: 'The price is now ${amount} {currency}. Click Pay now to accept this amount and continue.',\n description: 'Shown when checkout.priceAccepted is false so the learner confirms the current amount due',\n },\n couponAppliedAlert: {\n id: 'checkout.couponAppliedAlert',\n defaultMessage: 'Discount applied',\n description: 'Success alert shown above payment methods after a discount is applied',\n },\n couponRemovedAlert: {\n id: 'checkout.couponRemovedAlert',\n defaultMessage: 'Coupon code {code} was removed from your cart.',\n description: 'Success alert shown above payment methods after a coupon is removed',\n },\n dismiss: {\n id: 'checkout.couponAppliedAlert.dismiss',\n defaultMessage: 'Dismiss',\n description: 'Closes the coupon-applied success alert',\n },\n alreadyPaidCourse: {\n id: 'checkout.alreadyPaid.course',\n defaultMessage: \"You've already paid for this course. You haven't been charged again.\",\n description: 'Alert shown when the learner already owns the course',\n },\n alreadyPaidProgram: {\n id: 'checkout.alreadyPaid.program',\n defaultMessage: \"You've already paid for this program. You haven't been charged again.\",\n description: 'Alert shown when the learner already owns the program',\n },\n viewOrderHistory: {\n id: 'checkout.alreadyPaid.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Link to order history on the already-paid alert',\n },\n goToCourse: {\n id: 'checkout.alreadyPaid.goToCourse',\n defaultMessage: 'Go to course',\n description: 'Button to navigate to the course on the already-paid alert',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/Checkout/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,4BAA4B,EAAE;QAC5B,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,oFAAoF;QACpG,WAAW,EAAE,gCAAgC;KAC9C;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,uGAAuG;QACvH,WAAW,EAAE,6EAA6E;KAC3F;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,0FAA0F;QAC1G,WAAW,EAAE,2FAA2F;KACzG;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,gDAAgD;QAChE,WAAW,EAAE,sHAAsH;KACpI;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,gDAAgD;QAChE,WAAW,EAAE,qEAAqE;KACnF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,yCAAyC;KACvD;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,sEAAsE;QACtF,WAAW,EAAE,sDAAsD;KACpE;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,uEAAuE;QACvF,WAAW,EAAE,uDAAuD;KACrE;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,iDAAiD;KAC/D;IACD,UAAU,EAAE;QACV,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,4DAA4D;KAC1E;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n paymentProcessingDescription: {\n id: 'checkout.paymentForm.paymentProcessingdescription',\n defaultMessage: 'Your payment could not be processed. Please check your card details and try again.',\n description: 'Payment processing description',\n },\n paymentInterruptedAlert: {\n id: 'checkout.paymentInterruptedAlert',\n defaultMessage: \"Your payment wasn't completed, and you haven't been charged. Try again or use another payment method.\",\n description: 'Alert shown when the learner returns to checkout without completing payment',\n },\n priceChangedNotice: {\n id: 'checkout.alacarte.priceChangedNotice',\n defaultMessage: 'The price is now ${amount} {currency}. Click Pay now to accept this amount and continue.',\n description: 'Shown when checkout.priceAccepted is false so the learner confirms the current amount due',\n },\n couponAppliedAlert: {\n id: 'checkout.couponAppliedAlert',\n defaultMessage: 'Coupon code {code} applied for {percent}% off!',\n description: 'Success alert shown at the top of checkout after a coupon is applied, e.g. \"Coupon code SAVE15 applied for 15% off!\"',\n },\n couponRemovedAlert: {\n id: 'checkout.couponRemovedAlert',\n defaultMessage: 'Coupon code {code} was removed from your cart.',\n description: 'Success alert shown above payment methods after a coupon is removed',\n },\n dismiss: {\n id: 'checkout.couponAppliedAlert.dismiss',\n defaultMessage: 'Dismiss',\n description: 'Closes the coupon-applied success alert',\n },\n alreadyPaidCourse: {\n id: 'checkout.alreadyPaid.course',\n defaultMessage: \"You've already paid for this course. You haven't been charged again.\",\n description: 'Alert shown when the learner already owns the course',\n },\n alreadyPaidProgram: {\n id: 'checkout.alreadyPaid.program',\n defaultMessage: \"You've already paid for this program. You haven't been charged again.\",\n description: 'Alert shown when the learner already owns the program',\n },\n viewOrderHistory: {\n id: 'checkout.alreadyPaid.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Link to order history on the already-paid alert',\n },\n goToCourse: {\n id: 'checkout.alreadyPaid.goToCourse',\n defaultMessage: 'Go to course',\n description: 'Button to navigate to the course on the already-paid alert',\n },\n});\n\nexport default messages;\n"]}
@@ -38,7 +38,7 @@ const CheckoutGate = (_a) => {
38
38
  if (gateStatus === 'blocked') {
39
39
  return (_jsx(_Fragment, { children: _jsx(CountryUnavailableModal, { isOpen: true, homeUrl: homeUrl }) }));
40
40
  }
41
- return (_jsx(Checkout, Object.assign({}, checkoutProps, { userCountry: userCountry, homeUrl: homeUrl, orderHistoryUrl: "/aca-order-history" })));
41
+ return (_jsx(Checkout, Object.assign({}, checkoutProps, { userCountry: userCountry, homeUrl: homeUrl, orderHistoryUrl: "/order-history" })));
42
42
  };
43
43
  export default CheckoutGate;
44
44
  //# sourceMappingURL=CheckoutGate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutGate.js","sourceRoot":"","sources":["../../../src/components/CheckoutGate/CheckoutGate.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,uBAAuB,MAAM,oDAAoD,CAAC;AAEzF,OAAO,QAAQ,MAAM,YAAY,CAAC;AAelC,MAAM,YAAY,GAAG,CAAC,EAOF,EAAE,EAAE;QAPF,EACpB,mBAAmB,EACnB,OAAO,GAAG,GAAG,EACb,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,OAEA,EADf,aAAa,cANI,wGAOrB,CADiB;IAEhB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,GAAG,eAAe,CAAC;QACrG,MAAM,EAAE,aAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,aAAa,CAAC,aAAa;QAC1C,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,kBAAkB;QAClB,sBAAsB;QACtB,kBAAkB;QAClB,mBAAmB;KACpB,CAAC,CAAC;IAEH,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CACL,cAAK,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,YACjE,KAAC,OAAO,IAAC,SAAS,EAAC,QAAQ,EAAC,gBAAgB,EAAC,SAAS,GAAG,GACrD,CACP,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,CACL,MAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,EAAE,SAAS,aACpC,WAAW,aAAX,WAAW,cAAX,WAAW,GACT,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,GAAG,EAClD,CAAC,gBAAgB,IAAI,mBAAmB,IAAI,CAC3C,YAAG,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAC,YAAY,6CAEhD,CACL,IACK,CACT,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CACL,4BACE,KAAC,uBAAuB,IAAC,MAAM,QAAC,OAAO,EAAE,OAAO,GAAI,GACnD,CACJ,CAAC;IACJ,CAAC;IACD,OAAO,CACL,KAAC,QAAQ,oBACH,aAAa,IACjB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAC,oBAAoB,IACpC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { Alert, Spinner } from '@openedx/paragon';\nimport { Error as ErrorIcon } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useCheckoutGate } from '../../data/hooks/useCheckoutGate';\nimport Checkout from '../Checkout/Checkout';\nimport CountryUnavailableModal from '../CountryUnavailableModal/CountryUnavailableModal';\nimport type { CheckoutProps } from '../Checkout/Checkout';\nimport messages from './Messages';\n\nexport interface CheckoutGateProps extends CheckoutProps {\n /** URL linked in session-error recovery messaging. */\n learnerDashboardUrl?: string,\n /** Homepage URL for the country-unavailable modal CTA. */\n homeUrl?: string,\n /** ALC-307 compliance-check endpoint — decides whether the learner is embargoed. */\n complianceCheckUrl?: string,\n /** When true, skip the compliance-check request. */\n disableComplianceCheck?: boolean,\n /** When true, skip the compliance-check request and show the blocked modal. */\n restrictCompliance?: boolean,\n}\n\nconst CheckoutGate = ({\n learnerDashboardUrl,\n homeUrl = '/',\n complianceCheckUrl,\n disableComplianceCheck,\n restrictCompliance,\n ...checkoutProps\n}: CheckoutGateProps) => {\n const { formatMessage } = useIntl();\n const { gateStatus, userCountry, gateMessage, isAccountLinkError: accountLinkError } = useCheckoutGate({\n apiUrl: checkoutProps.apiUrl,\n edxSessionUrl: checkoutProps.edxSessionUrl,\n geolocationUrl: checkoutProps.geolocationUrl,\n complianceCheckUrl,\n disableComplianceCheck,\n restrictCompliance,\n learnerDashboardUrl,\n });\n\n if (gateStatus === 'loading') {\n return (\n <div className=\"processing-screen\" role=\"status\" aria-live=\"polite\">\n <Spinner animation=\"border\" screenReaderText=\"Loading\" />\n </div>\n );\n }\n\n if (gateStatus === 'error') {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {gateMessage\n ?? formatMessage(messages.defaultErrorMessage)}{' '}\n {!accountLinkError && learnerDashboardUrl && (\n <a href={learnerDashboardUrl} className=\"alert-link\">\n Go to your learner dashboard\n </a>\n )}\n </Alert>\n );\n }\n\n if (gateStatus === 'blocked') {\n return (\n <>\n <CountryUnavailableModal isOpen homeUrl={homeUrl} />\n </>\n );\n }\n return (\n <Checkout\n {...checkoutProps}\n userCountry={userCountry}\n homeUrl={homeUrl}\n orderHistoryUrl=\"/aca-order-history\"\n />\n );\n};\n\nexport default CheckoutGate;\n"]}
1
+ {"version":3,"file":"CheckoutGate.js","sourceRoot":"","sources":["../../../src/components/CheckoutGate/CheckoutGate.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,IAAI,SAAS,EAA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AAmB,IAAI,CAC3C,YAAG,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAC,YAAY,6CAEhD,CACL,IACK,CACT,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,CACL,4BACE,KAAC,uBAAuB,IAAC,MAAM,QAAC,OAAO,EAAE,OAAO,GAAI,GACnD,CACJ,CAAC;IACJ,CAAC;IACD,OAAO,CACL,KAAC,QAAQ,oBACH,aAAa,IACjB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAC,gBAAgB,IAChC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { Alert, Spinner } from '@openedx/paragon';\nimport { Error as ErrorIcon } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useCheckoutGate } from '../../data/hooks/useCheckoutGate';\nimport Checkout from '../Checkout/Checkout';\nimport CountryUnavailableModal from '../CountryUnavailableModal/CountryUnavailableModal';\nimport type { CheckoutProps } from '../Checkout/Checkout';\nimport messages from './Messages';\n\nexport interface CheckoutGateProps extends CheckoutProps {\n /** URL linked in session-error recovery messaging. */\n learnerDashboardUrl?: string,\n /** Homepage URL for the country-unavailable modal CTA. */\n homeUrl?: string,\n /** ALC-307 compliance-check endpoint — decides whether the learner is embargoed. */\n complianceCheckUrl?: string,\n /** When true, skip the compliance-check request. */\n disableComplianceCheck?: boolean,\n /** When true, skip the compliance-check request and show the blocked modal. */\n restrictCompliance?: boolean,\n}\n\nconst CheckoutGate = ({\n learnerDashboardUrl,\n homeUrl = '/',\n complianceCheckUrl,\n disableComplianceCheck,\n restrictCompliance,\n ...checkoutProps\n}: CheckoutGateProps) => {\n const { formatMessage } = useIntl();\n const { gateStatus, userCountry, gateMessage, isAccountLinkError: accountLinkError } = useCheckoutGate({\n apiUrl: checkoutProps.apiUrl,\n edxSessionUrl: checkoutProps.edxSessionUrl,\n geolocationUrl: checkoutProps.geolocationUrl,\n complianceCheckUrl,\n disableComplianceCheck,\n restrictCompliance,\n learnerDashboardUrl,\n });\n\n if (gateStatus === 'loading') {\n return (\n <div className=\"processing-screen\" role=\"status\" aria-live=\"polite\">\n <Spinner animation=\"border\" screenReaderText=\"Loading\" />\n </div>\n );\n }\n\n if (gateStatus === 'error') {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {gateMessage\n ?? formatMessage(messages.defaultErrorMessage)}{' '}\n {!accountLinkError && learnerDashboardUrl && (\n <a href={learnerDashboardUrl} className=\"alert-link\">\n Go to your learner dashboard\n </a>\n )}\n </Alert>\n );\n }\n\n if (gateStatus === 'blocked') {\n return (\n <>\n <CountryUnavailableModal isOpen homeUrl={homeUrl} />\n </>\n );\n }\n return (\n <Checkout\n {...checkoutProps}\n userCountry={userCountry}\n homeUrl={homeUrl}\n orderHistoryUrl=\"/order-history\"\n />\n );\n};\n\nexport default CheckoutGate;\n"]}
@@ -0,0 +1,13 @@
1
+ export interface FieldErrorProps {
2
+ /** Referenced by the field's aria-describedby, where the field can take it. */
3
+ id?: string;
4
+ message?: string;
5
+ /**
6
+ * Announce the error as soon as it appears. Errors raised on blur are; ones
7
+ * raised by Pay now aren't, because focus moves to the error summary and
8
+ * each field reads its own error once it takes focus.
9
+ */
10
+ announce?: boolean;
11
+ }
12
+ declare const FieldError: ({ id, message, announce }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export default FieldError;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const FieldError = ({ id, message, announce = true }) => {
3
+ if (!message)
4
+ return null;
5
+ return (_jsxs("div", Object.assign({ id: id, className: "payment--field__error" }, (announce ? { role: 'alert' } : { 'aria-live': 'off' }), { children: [_jsx("span", { className: "payment--field__error-icon", "aria-hidden": "true" }), message] })));
6
+ };
7
+ export default FieldError;
8
+ //# sourceMappingURL=FieldError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/components/PaymentFields/FieldError.tsx"],"names":[],"mappings":";AAcA,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,EAAmB,EAAE,EAAE;IACvE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,CACL,6BACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAC,uBAAuB,IAE7B,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAc,EAAE,CAAC,eAEpE,eAAM,SAAS,EAAC,4BAA4B,iBAAa,MAAM,GAAG,EACjE,OAAO,KACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import React from 'react';\n\nexport interface FieldErrorProps {\n /** Referenced by the field's aria-describedby, where the field can take it. */\n id?: string,\n message?: string,\n /**\n * Announce the error as soon as it appears. Errors raised on blur are; ones\n * raised by Pay now aren't, because focus moves to the error summary and\n * each field reads its own error once it takes focus.\n */\n announce?: boolean,\n}\n\nconst FieldError = ({ id, message, announce = true }: FieldErrorProps) => {\n if (!message) return null;\n return (\n <div\n id={id}\n className=\"payment--field__error\"\n // aria-live=\"off\" also opts out of an enclosing live region (the billing fields).\n {...(announce ? { role: 'alert' } : { 'aria-live': 'off' as const })}\n >\n <span className=\"payment--field__error-icon\" aria-hidden=\"true\" />\n {message}\n </div>\n );\n};\n\nexport default FieldError;\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { Ref } from 'react';
2
+ import type { CardFieldKey } from '../../utils/paymentValidation';
2
3
  export interface PaymentFieldErrors {
3
4
  number?: string;
4
5
  expiry?: string;
@@ -9,8 +10,12 @@ export interface PaymentFieldsProps {
9
10
  expiryMountRef: Ref<HTMLDivElement>;
10
11
  cvcMountRef: Ref<HTMLDivElement>;
11
12
  fieldErrors?: PaymentFieldErrors;
13
+ /** Announce errors as they appear (blur-time) rather than only on focus. */
14
+ announceErrors?: boolean;
15
+ /** Card field whose Stripe input currently has focus. */
16
+ focusedField?: CardFieldKey | null;
12
17
  /** Stripe-detected card network for the number field (e.g. 'visa'). */
13
18
  cardBrand?: string | null;
14
19
  }
15
- declare const PaymentFields: ({ numberMountRef, expiryMountRef, cvcMountRef, fieldErrors, cardBrand, }: PaymentFieldsProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const PaymentFields: ({ numberMountRef, expiryMountRef, cvcMountRef, fieldErrors, announceErrors, focusedField, cardBrand, }: PaymentFieldsProps) => import("react/jsx-runtime").JSX.Element;
16
21
  export default PaymentFields;