@edx/frontend-app-alacarte-checkout 1.9.0 → 1.11.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.
- package/dist/checkoutPage/CheckoutPage.js +12 -0
- package/dist/checkoutPage/CheckoutPage.js.map +1 -1
- package/dist/components/AlacarteConfirmation/AlacarteConfirmation.d.ts +5 -1
- package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js +20 -13
- package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js.map +1 -1
- package/dist/components/Checkout/Checkout.js +1 -1
- package/dist/components/Checkout/Checkout.js.map +1 -1
- package/dist/components/DemoPdpBanner/DemoPdpBanner.d.ts +14 -0
- package/dist/components/DemoPdpBanner/DemoPdpBanner.js +34 -0
- package/dist/components/DemoPdpBanner/DemoPdpBanner.js.map +1 -0
- package/dist/data/hooks/keys.d.ts +1 -0
- package/dist/data/hooks/keys.js +1 -0
- package/dist/data/hooks/keys.js.map +1 -1
- package/dist/data/hooks/useAlacarteCheckout.d.ts +3 -0
- package/dist/data/hooks/useAlacarteCheckout.js +10 -6
- package/dist/data/hooks/useAlacarteCheckout.js.map +1 -1
- package/dist/data/hooks/useAlacarteQueries.d.ts +4 -1
- package/dist/data/hooks/useAlacarteQueries.js +11 -0
- package/dist/data/hooks/useAlacarteQueries.js.map +1 -1
- package/dist/style.scss +1 -0
- package/dist/styles/components/alacarteConfirmation.scss +143 -27
- package/dist/styles/components/checkout.scss +1 -1
- package/dist/styles/components/demoPdpBanner.scss +262 -0
- package/dist/types/alacarte.d.ts +10 -0
- package/dist/types/alacarte.js.map +1 -1
- package/dist/utils/alacarteApi.d.ts +3 -1
- package/dist/utils/alacarteApi.js +15 -1
- package/dist/utils/alacarteApi.js.map +1 -1
- package/dist/utils/alacarteCheckout.js +1 -0
- package/dist/utils/alacarteCheckout.js.map +1 -1
- package/dist/utils/alacarteQueries.d.ts +4 -0
- package/dist/utils/alacarteQueries.js +9 -0
- package/dist/utils/alacarteQueries.js.map +1 -1
- package/dist/utils/provision.js +2 -2
- package/dist/utils/provision.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Alert, Container } from '@openedx/paragon';
|
|
3
4
|
import { getAppConfig, getSiteConfig } from '@openedx/frontend-base';
|
|
4
5
|
import { appId } from '../constants';
|
|
5
6
|
import CheckoutGate from '../components/CheckoutGate/CheckoutGate';
|
|
7
|
+
import DemoPdpBanner from '../components/DemoPdpBanner/DemoPdpBanner';
|
|
6
8
|
const PageWrapper = ({ children }) => (_jsx(Container, { children: children }));
|
|
9
|
+
// TEMPORARY — Set to true to show the demo PDP banner before checkout.
|
|
10
|
+
// When true, the banner is displayed first; clicking "Earn a certificate"
|
|
11
|
+
// transitions to the real checkout flow. Set to false to skip the banner.
|
|
12
|
+
const SHOW_DEMO_PDP = true;
|
|
7
13
|
const CheckoutPage = () => {
|
|
8
14
|
const config = getAppConfig(appId);
|
|
9
15
|
const siteConfig = getSiteConfig();
|
|
@@ -13,6 +19,12 @@ const CheckoutPage = () => {
|
|
|
13
19
|
const isDevelopment = siteConfig.environment === 'development';
|
|
14
20
|
const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/edx-session`;
|
|
15
21
|
const geolocationUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/geolocation/lookup`;
|
|
22
|
+
// When the demo banner is enabled, start on the "PDP" view; clicking the
|
|
23
|
+
// CTA flips showCheckout to true and the real checkout renders.
|
|
24
|
+
const [showCheckout, setShowCheckout] = useState(!SHOW_DEMO_PDP);
|
|
25
|
+
if (!showCheckout) {
|
|
26
|
+
return _jsx(DemoPdpBanner, { onEnroll: () => setShowCheckout(true) });
|
|
27
|
+
}
|
|
16
28
|
if (!stripePublishableKey || !apiUrl || !edxSessionUrl) {
|
|
17
29
|
return (_jsx(PageWrapper, { children: _jsxs(Alert, { variant: "danger", children: ["We're having trouble loading the checkout. Please refresh the page or try again in a few moments. If the problem persists,", ' ', _jsx("a", { href: "https://courses.edx.org/support/contact_us", children: "contact support" }), "."] }) }));
|
|
18
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPage.js","sourceRoot":"","sources":["../../src/checkoutPage/CheckoutPage.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CheckoutPage.js","sourceRoot":"","sources":["../../src/checkoutPage/CheckoutPage.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,aAAa,MAAM,2CAA2C,CAAC;AAEtE,MAAM,WAAW,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC7E,KAAC,SAAS,cAAE,QAAQ,GAAa,CAClC,CAAC;AAEF,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,oBAAoB,GAAG,MAAM,CAAC,iBAA2B,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,YAAsB,CAAC;IAC7C,MA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port { getAppConfig, getSiteConfig } from '@openedx/frontend-base';\nimport { appId } from '@src/constants';\nimport CheckoutGate from '../components/CheckoutGate/CheckoutGate';\nimport DemoPdpBanner from '../components/DemoPdpBanner/DemoPdpBanner';\n\nconst PageWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <Container>{children}</Container>\n);\n\n// TEMPORARY — Set to true to show the demo PDP banner before checkout.\n// When true, the banner is displayed first; clicking \"Earn a certificate\"\n// transitions to the real checkout flow. Set to false to skip the banner.\nconst SHOW_DEMO_PDP = true;\n\nconst CheckoutPage: React.FC = () => {\n const config = getAppConfig(appId);\n const siteConfig = getSiteConfig();\n const LMS_BASE_URL = siteConfig.lmsBaseUrl.replace(/\\/$/, '');\n const stripePublishableKey = config.STRIPE_PUBLIC_KEY as string;\n const apiUrl = config.VIAX_API_URL as string;\n const isDevelopment = siteConfig.environment === 'development';\n const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/edx-session`;\n const geolocationUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/geolocation/lookup`;\n\n // When the demo banner is enabled, start on the \"PDP\" view; clicking the\n // CTA flips showCheckout to true and the real checkout renders.\n const [showCheckout, setShowCheckout] = useState(!SHOW_DEMO_PDP);\n\n if (!showCheckout) {\n return <DemoPdpBanner onEnroll={() => setShowCheckout(true)} />;\n }\n\n if (!stripePublishableKey || !apiUrl || !edxSessionUrl) {\n return (\n <PageWrapper>\n <Alert variant=\"danger\">\n We're having trouble loading the checkout. Please refresh the\n page or try again in a few moments. If the problem persists,{' '}\n <a href=\"https://courses.edx.org/support/contact_us\">\n contact support\n </a>\n .\n </Alert>\n </PageWrapper>\n );\n }\n\n return (\n <PageWrapper>\n <CheckoutGate\n stripePublishableKey={stripePublishableKey}\n apiUrl={apiUrl}\n edxSessionUrl={edxSessionUrl}\n geolocationUrl={geolocationUrl}\n learnerDashboardUrl={`${LMS_BASE_URL}/dashboard`}\n homeUrl={LMS_BASE_URL || '/'}\n onComplete={(_subscriptionBiId) => {\n console.log(_subscriptionBiId);\n // window.location.href = `/checkout/confirmation?sub=${_subscriptionBiId ?? ''}`;\n // Success screen.\n }}\n />\n </PageWrapper>\n );\n};\n\nexport default CheckoutPage;\n"]}
|
|
@@ -10,6 +10,10 @@ export interface AlacarteConfirmationProps {
|
|
|
10
10
|
productTitle?: string | null;
|
|
11
11
|
/** Learner order-history / dashboard URL for the secondary CTA. */
|
|
12
12
|
orderHistoryUrl?: string | null;
|
|
13
|
+
/** ISO timestamp the order was placed (tPlacedAt, falling back to
|
|
14
|
+
* biCreatedAt). Drives both the purchase date and the refund deadline
|
|
15
|
+
* (placedAt + 14 days); the refund line is hidden once that date passes. */
|
|
16
|
+
placedAt?: string | null;
|
|
13
17
|
}
|
|
14
|
-
declare const AlacarteConfirmation: ({ order, awaiting, error, onContinue, productDetail, productTitle, orderHistoryUrl, }: AlacarteConfirmationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
declare const AlacarteConfirmation: ({ order, awaiting, error, onContinue, productDetail, productTitle, orderHistoryUrl, placedAt, }: AlacarteConfirmationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
19
|
export default AlacarteConfirmation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { Alert, Button, Col, Icon, Row } from '@openedx/paragon';
|
|
4
4
|
import { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';
|
|
@@ -8,23 +8,29 @@ import messages from './Messages';
|
|
|
8
8
|
function isProgramOrder(order) {
|
|
9
9
|
return order.lines.some((line) => line.kind === 'program' || !!line.programId);
|
|
10
10
|
}
|
|
11
|
-
function formatPurchaseDate(locale, date
|
|
11
|
+
function formatPurchaseDate(locale, date) {
|
|
12
12
|
return new Intl.DateTimeFormat(locale, {
|
|
13
13
|
month: 'long',
|
|
14
14
|
day: 'numeric',
|
|
15
15
|
year: 'numeric',
|
|
16
16
|
}).format(date);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
return
|
|
18
|
+
function addDays(from, days) {
|
|
19
|
+
const result = new Date(from);
|
|
20
|
+
result.setDate(result.getDate() + days);
|
|
21
|
+
return result;
|
|
22
22
|
}
|
|
23
|
-
const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetail = null, productTitle = null, orderHistoryUrl = null, }) => {
|
|
23
|
+
const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetail = null, productTitle = null, orderHistoryUrl = null, placedAt = null, }) => {
|
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
25
25
|
const { formatMessage, locale = 'en-US' } = useIntl();
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const placedAtDate = useMemo(() => {
|
|
27
|
+
const parsed = placedAt ? new Date(placedAt) : null;
|
|
28
|
+
return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;
|
|
29
|
+
}, [placedAt]);
|
|
30
|
+
const purchaseDate = useMemo(() => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null), [locale, placedAtDate]);
|
|
31
|
+
const refundDeadlineDate = useMemo(() => (placedAtDate ? addDays(placedAtDate, 14) : null), [placedAtDate]);
|
|
32
|
+
const refundBy = useMemo(() => (refundDeadlineDate ? formatPurchaseDate(locale, refundDeadlineDate) : null), [locale, refundDeadlineDate]);
|
|
33
|
+
const refundWindowOpen = !!refundDeadlineDate && refundDeadlineDate.getTime() >= Date.now();
|
|
28
34
|
if (awaiting && !order) {
|
|
29
35
|
return _jsx(ProcessingScreen, {});
|
|
30
36
|
}
|
|
@@ -66,10 +72,11 @@ const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetai
|
|
|
66
72
|
const programCourses = programOrder
|
|
67
73
|
? order.lines.map((line) => line.name).filter(Boolean)
|
|
68
74
|
: [];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
const summaryCard = (_jsxs("aside", { className: "alacarte-confirmation__summary", "aria-label": formatMessage(messages.purchaseSummary), children: [_jsx("h2", { className: "alacarte-confirmation__summary-title font-weight-bold mb-0", children: formatMessage(messages.purchaseSummary) }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__product d-flex align-items-start", children: [orgLogo ? (_jsx("img", { src: orgLogo, alt: "", className: "alacarte-confirmation__org-logo" })) : (_jsx("div", { className: "alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder", "aria-hidden": true })), _jsxs("div", { children: [_jsxs("span", { className: "alacarte-confirmation__badge", children: [_jsx(Icon, { src: Monitor, className: "alacarte-confirmation__badge-icon" }), formatMessage(messages.verifiedCertificate)] }), _jsx("p", { className: "alacarte-confirmation__product-name font-weight-bold mb-0", children: productLabel })] })] }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__price-row", children: [_jsx("span", { children: formatMessage(messages.subtotal) }), _jsx("span", { children: money(subtotal) })] }), discount > 0 && (_jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--discount", children: [_jsx("span", { children: formatMessage(messages.discountsApplied) }), _jsx("span", { children: formatMessage(messages.discountAmount, {
|
|
76
|
+
amount: discount.toFixed(2),
|
|
77
|
+
currency,
|
|
78
|
+
}) })] })), _jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--paid", children: [_jsx("span", { children: formatMessage(messages.amountPaid) }), _jsx("span", { children: money(paid) })] })] }));
|
|
79
|
+
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", { 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, className: "alacarte-confirmation__order-history", children: formatMessage(messages.viewOrderHistory) }))] }), _jsx("div", { className: "alacarte-confirmation__summary-mobile d-lg-none", children: summaryCard }), programOrder && programCourses.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h2", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), _jsx("p", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourses.length }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: programCourses.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("p", { className: "font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), refundWindowOpen && refundBy && (_jsxs(_Fragment, { children: [_jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, { date: refundBy }) })] }))] }), _jsx(Col, { xs: 12, lg: 5, className: "alacarte-confirmation__summary-col d-none d-lg-block", children: summaryCard })] }) }));
|
|
73
80
|
};
|
|
74
81
|
export default AlacarteConfirmation;
|
|
75
82
|
//# sourceMappingURL=AlacarteConfirmation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,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,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAelC,SAAS,cAAc,CAAC,KAAkB;IACxC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE;IAC3D,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QACrC,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,IAAI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AC,mBAAmB,CAAC,IACvC,EACP,YAAG,SAAS,EAAC,2DAA2D,YACrE,YAAY,GACX,IACA,IACF,EAEN,aAAI,SAAS,EAAC,wCAAwC,GAAG,EAEzD,eAAK,SAAS,EAAC,kCAAkC,aAC/C,yBAAO,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAQ,EAC/C,yBAAO,KAAK,CAAC,QAAQ,CAAC,GAAQ,IAC1B,EACL,QAAQ,GAAG,CAAC,IAAI,CACf,eAAK,SAAS,EAAC,6EAA6E,aAC1F,yBAAO,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAQ,EACvD,yBACG,aAAa,CAAC,QAAQ,CAAC,cAAc,EAAE;4CACtC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;4CAC3B,QAAQ;yCACT,CAAC,GACG,IACH,CACP,EACD,eAAK,SAAS,EAAC,yEAAyE,aACtF,yBAAO,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAQ,EACjD,yBAAO,KAAK,CAAC,IAAI,CAAC,GAAQ,IACtB,IACA,GACJ,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useMemo } 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 { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type { PlacedOrder, ProductDetail, ProgramDetail } 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 /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\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 = new Date()): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nfunction refundDeadline(locale: string, from = new Date()): string {\n const deadline = new Date(from);\n deadline.setDate(deadline.getDate() + 14);\n return formatPurchaseDate(locale, deadline);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n orderHistoryUrl = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const purchaseDate = useMemo(() => formatPurchaseDate(locale), [locale]);\n const refundBy = useMemo(() => refundDeadline(locale), [locale]);\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 const subtotal = order.totals?.price ?? 0;\n const discount = (order.totals?.discount ?? 0) + (order.totals?.deduction ?? 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 programCourses = programOrder\n ? order.lines.map((line) => line.name).filter(Boolean)\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 mb-5 mb-lg-0\">\n <h1 className=\"alacarte-confirmation__headline font-weight-bold mb-2\">\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline text-muted 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-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 href={orderHistoryUrl} className=\"alacarte-confirmation__order-history\">\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n\n {programOrder && programCourses.length > 0 && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h2 className=\"h5 font-weight-bold mb-2\">\n {formatMessage(messages.aboutProgram)}\n </h2>\n <p className=\"font-weight-bold mb-2\">\n {formatMessage(messages.coursesIncluded, { count: programCourses.length })}\n </p>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {programCourses.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\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 <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </p>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </p>\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, { date: refundBy })}\n </p>\n </Col>\n\n <Col xs={12} lg={5}>\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-3\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start mb-4\">\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\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\" />\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 </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,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,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,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAmBlC,SAAS,cAAc,CAAC,KAAkB;IACxC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc,EAAE,IAAU;IACpD,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QACrC,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAC,IAAU,EAAE,IAAY;IACvC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MA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AAC,QAAQ,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GACvD,IACH,CACJ,IACG,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, { useMemo } 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 { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type { PlacedOrder, ProductDetail, ProgramDetail } 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 /** 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 both the purchase date and the refund deadline\n * (placedAt + 14 days); the refund line is hidden once that date passes. */\n placedAt?: string | null,\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\nfunction addDays(from: Date, days: number): Date {\n const result = new Date(from);\n result.setDate(result.getDate() + days);\n return result;\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = 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 const refundDeadlineDate = useMemo(\n () => (placedAtDate ? addDays(placedAtDate, 14) : null),\n [placedAtDate],\n );\n const refundBy = useMemo(\n () => (refundDeadlineDate ? formatPurchaseDate(locale, refundDeadlineDate) : null),\n [locale, refundDeadlineDate],\n );\n const refundWindowOpen = !!refundDeadlineDate && refundDeadlineDate.getTime() >= Date.now();\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 const subtotal = order.totals?.price ?? 0;\n const discount = (order.totals?.discount ?? 0) + (order.totals?.deduction ?? 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 programCourses = programOrder\n ? order.lines.map((line) => line.name).filter(Boolean)\n : [];\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 {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\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\" />\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 className=\"alacarte-confirmation__headline font-weight-bold mb-4\">\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 href={orderHistoryUrl} className=\"alacarte-confirmation__order-history\">\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 && programCourses.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 <p className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourses.length })}\n </p>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {programCourses.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\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 <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </p>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </p>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n {refundWindowOpen && refundBy && (\n <>\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, { date: refundBy })}\n </p>\n </>\n )}\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"]}
|
|
@@ -168,7 +168,7 @@ const Checkout = (_a) => {
|
|
|
168
168
|
: ((_l = alacarte.line) === null || _l === void 0 ? void 0 : _l.kind) === 'course'
|
|
169
169
|
? alacarte.line.courseName
|
|
170
170
|
: null;
|
|
171
|
-
return (_jsxs(_Fragment, { children: [alacarteDebug, _jsx(Row, { className: "checkout__container bg-light-200", children: _jsx(Col, { xs: 12, children: _jsx(AlacarteConfirmation, { order: alacarte.placedOrder, awaiting: false, error: alacarte.placedOrderError, onContinue: handleStartCourse, productDetail: alacarte.productDetail, productTitle: confirmationTitle, orderHistoryUrl: orderHistoryUrl !== null && orderHistoryUrl !== void 0 ? orderHistoryUrl : null }) }) })] }));
|
|
171
|
+
return (_jsxs(_Fragment, { children: [alacarteDebug, _jsx(Row, { className: "checkout__container alacarte-confirmation__container bg-light-200", children: _jsx(Col, { xs: 12, children: _jsx(AlacarteConfirmation, { order: alacarte.placedOrder, awaiting: false, error: alacarte.placedOrderError, onContinue: handleStartCourse, productDetail: alacarte.productDetail, productTitle: confirmationTitle, orderHistoryUrl: orderHistoryUrl !== null && orderHistoryUrl !== void 0 ? orderHistoryUrl : null, placedAt: alacarte.placedOrderPlacedAt }) }) })] }));
|
|
172
172
|
}
|
|
173
173
|
if (alacarte.phase === 'loading') {
|
|
174
174
|
return (_jsxs(_Fragment, { children: [alacarteDebug, _jsx(ProcessingScreen, {})] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../src/components/Checkout/Checkout.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,S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AC;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 AlacarteNotice from '../AlacarteNotice/AlacarteNotice';\nimport AlacarteConfirmation from '../AlacarteConfirmation/AlacarteConfirmation';\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 { confirmPaymentWithMethodId } 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};\n\nconst Checkout = ({\n homeUrl = '/',\n orderHistoryUrl,\n ...props\n}: CheckoutProps) => {\n const { formatMessage } = useIntl();\n const alacarte = useAlacarteCheckout({ apiUrl: props.apiUrl, edxSessionUrl: props.edxSessionUrl });\n const c = useCheckout(props);\n const [promoCodeValue, setPromoCodeValue] = useState('');\n const [dismissedCouponAlert, setDismissedCouponAlert] = useState<string | null>(null);\n const [showValidationBanner, setShowValidationBanner] = 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 const appliedDiscount = appliedCouponCode && alacarte.line?.discount && 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 useEffect(() => {\n if (alacarte.checkout?.couponCode) {\n setPromoCodeValue(alacarte.checkout.couponCode);\n }\n }, [alacarte.checkout?.couponCode]);\n\n useEffect(() => {\n if (appliedCouponCode && discountPercent != null) {\n setAdvertisedOffer({ code: appliedCouponCode, percent: discountPercent });\n }\n }, [appliedCouponCode, 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\n await alacarte.placeOrderAsync({\n billing: {\n ...c.billing,\n country: c.billing.country || walletCountry || c.userCountry || '',\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 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 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 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 orderHistoryUrl={orderHistoryUrl ?? null}\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 if (alacarte.phase === 'notPurchasable') {\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <Col xs={12}>\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {alacarte.error}\n </Alert>\n </Col>\n </Row>\n </>\n );\n }\n\n const isAlreadyOwned = alacarte.isAlreadyOwned;\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <CountryUnavailableModal\n isOpen={isBillingCountryBlocked}\n homeUrl={homeUrl}\n />\n <Col xs={12} className=\"d-lg-none\">\n <h1 className=\"font-weight-bold text-primary-900\">Checkout</h1>\n </Col>\n\n <Col xs={12} className={isAlreadyOwned ? 'checkout__owned-overlay' : ''}>\n <Row className=\"flex-column-reverse gap-5 flex-lg-row\">\n {/* ── LEFT ── */}\n <Col xs={12} lg={7} xxl={9} className=\"payment__options\">\n <div>\n <h1 className=\"font-weight-bold text-primary-900 d-none d-lg-block mb-4\">\n Checkout\n </h1>\n\n {isAlreadyOwned && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"checkout__already-owned-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.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 {!alacarte.priceAccepted && 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 {showValidationBanner && (\n <Alert variant=\"danger\" icon={ErrorIcon} className=\"mb-3\">\n {formatMessage(messages.validationBanner)}\n </Alert>\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 >\n <span aria-hidden=\"true\">🎉 </span>\n {formatMessage(messages.couponAppliedAlert, {\n code: appliedCouponCode,\n percent: appliedDiscount.percent,\n })}\n </Alert>\n )}\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={setShowValidationBanner}\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 />\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\n {/* ── RIGHT — swaps to EnrollmentSummary on success ── */}\n <Col xs={12} lg={5} xxl={3} className=\"payment__summary\">\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 </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,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,uBAAuB,MAAM,oDAAoD,CAAC;AACzF,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAChF,OAAO,kBAAkB,MAAM,0CAA0C,CAAC,CAAC,kDAAkD;AAC7H,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGhG,OAAO,QAAQ,MAAM,YAAY,C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e,CAAC,CAAC,CAAC,IAAI;4CAClD,KAAK,EAAE,QAAQ,CAAC,WAAW;4CAC3B,UAAU,EAAE,QAAQ,CAAC,cAAc;4CACnC,QAAQ,EAAE,QAAQ,CAAC,YAAY;yCAChC,CAAC,CAAC,CAAC,IAAI,GACR,CACH,GACG,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 AlacarteNotice from '../AlacarteNotice/AlacarteNotice';\nimport AlacarteConfirmation from '../AlacarteConfirmation/AlacarteConfirmation';\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 { confirmPaymentWithMethodId } 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};\n\nconst Checkout = ({\n homeUrl = '/',\n orderHistoryUrl,\n ...props\n}: CheckoutProps) => {\n const { formatMessage } = useIntl();\n const alacarte = useAlacarteCheckout({ apiUrl: props.apiUrl, edxSessionUrl: props.edxSessionUrl });\n const c = useCheckout(props);\n const [promoCodeValue, setPromoCodeValue] = useState('');\n const [dismissedCouponAlert, setDismissedCouponAlert] = useState<string | null>(null);\n const [showValidationBanner, setShowValidationBanner] = 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 const appliedDiscount = appliedCouponCode && alacarte.line?.discount && 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 useEffect(() => {\n if (alacarte.checkout?.couponCode) {\n setPromoCodeValue(alacarte.checkout.couponCode);\n }\n }, [alacarte.checkout?.couponCode]);\n\n useEffect(() => {\n if (appliedCouponCode && discountPercent != null) {\n setAdvertisedOffer({ code: appliedCouponCode, percent: discountPercent });\n }\n }, [appliedCouponCode, 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\n await alacarte.placeOrderAsync({\n billing: {\n ...c.billing,\n country: c.billing.country || walletCountry || c.userCountry || '',\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 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 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 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 if (alacarte.phase === 'notPurchasable') {\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <Col xs={12}>\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {alacarte.error}\n </Alert>\n </Col>\n </Row>\n </>\n );\n }\n\n const isAlreadyOwned = alacarte.isAlreadyOwned;\n\n return (\n <>\n {alacarteDebug}\n <Row className=\"checkout__container bg-light-200\">\n <CountryUnavailableModal\n isOpen={isBillingCountryBlocked}\n homeUrl={homeUrl}\n />\n <Col xs={12} className=\"d-lg-none\">\n <h1 className=\"font-weight-bold text-primary-900\">Checkout</h1>\n </Col>\n\n <Col xs={12} className={isAlreadyOwned ? 'checkout__owned-overlay' : ''}>\n <Row className=\"flex-column-reverse gap-5 flex-lg-row\">\n {/* ── LEFT ── */}\n <Col xs={12} lg={7} xxl={9} className=\"payment__options\">\n <div>\n <h1 className=\"font-weight-bold text-primary-900 d-none d-lg-block mb-4\">\n Checkout\n </h1>\n\n {isAlreadyOwned && (\n <Alert\n variant=\"danger\"\n icon={ErrorIcon}\n className=\"checkout__already-owned-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.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 {!alacarte.priceAccepted && 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 {showValidationBanner && (\n <Alert variant=\"danger\" icon={ErrorIcon} className=\"mb-3\">\n {formatMessage(messages.validationBanner)}\n </Alert>\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 >\n <span aria-hidden=\"true\">🎉 </span>\n {formatMessage(messages.couponAppliedAlert, {\n code: appliedCouponCode,\n percent: appliedDiscount.percent,\n })}\n </Alert>\n )}\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={setShowValidationBanner}\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 />\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\n {/* ── RIGHT — swaps to EnrollmentSummary on success ── */}\n <Col xs={12} lg={5} xxl={3} className=\"payment__summary\">\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 </Col>\n </Row>\n </Col>\n </Row>\n </>\n );\n};\n\nexport default Checkout;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
activeProgramId?: string;
|
|
5
|
+
activeCourseUid?: string;
|
|
6
|
+
activeCourseRunKey?: string;
|
|
7
|
+
activeDiscountCode?: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface DemoPdpBannerProps {
|
|
11
|
+
onEnroll: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const DemoPdpBanner: React.FC<DemoPdpBannerProps>;
|
|
14
|
+
export default DemoPdpBanner;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const DEFAULT_PROGRAM_UID = '01a06551-667b-7c85-9286-f6a60b9eb287';
|
|
3
|
+
const DEFAULT_DISCOUNT_CODE = '';
|
|
4
|
+
function buildCheckoutUrl() {
|
|
5
|
+
var _a;
|
|
6
|
+
const programUid = window.activeProgramId || DEFAULT_PROGRAM_UID;
|
|
7
|
+
const courseUid = window.activeCourseUid || '';
|
|
8
|
+
const courseRunKey = window.activeCourseRunKey || '';
|
|
9
|
+
const discountCode = (_a = window.activeDiscountCode) !== null && _a !== void 0 ? _a : DEFAULT_DISCOUNT_CODE;
|
|
10
|
+
const params = new URLSearchParams();
|
|
11
|
+
if (courseUid && courseRunKey) {
|
|
12
|
+
params.set('course_uid', courseUid);
|
|
13
|
+
params.set('course_run_key', courseRunKey);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
params.set('program_uid', programUid);
|
|
17
|
+
}
|
|
18
|
+
if (discountCode) {
|
|
19
|
+
params.set('discount_code', discountCode);
|
|
20
|
+
}
|
|
21
|
+
return `/aca-checkout?${params.toString()}`;
|
|
22
|
+
}
|
|
23
|
+
const HarvardShield = () => (_jsxs("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { width: "30", height: "30", rx: "2", fill: "#A41034" }), _jsx("text", { x: "15", y: "20", textAnchor: "middle", fill: "#fff", fontSize: "16", fontWeight: "700", fontFamily: "serif", children: "H" })] }));
|
|
24
|
+
const DemoPdpBanner = ({ onEnroll }) => {
|
|
25
|
+
const handleEarnCertificate = (e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
const url = buildCheckoutUrl();
|
|
28
|
+
window.history.pushState({}, '', url);
|
|
29
|
+
onEnroll();
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs("div", { className: "demo-pdp", children: [_jsxs("div", { className: "demo-pdp__hero", children: [_jsx("div", { className: "demo-pdp__hero-bg" }), _jsxs("div", { className: "demo-pdp__hero-content", children: [_jsxs("div", { className: "demo-pdp__main", children: [_jsxs("div", { className: "demo-pdp__institution", children: [_jsx(HarvardShield, {}), _jsxs("span", { className: "demo-pdp__institution-name", children: ["Harvard", _jsx("br", {}), "University"] })] }), _jsxs("h1", { className: "demo-pdp__title", children: ["Computer Science for", _jsx("br", {}), "Python Programming"] }), _jsxs("p", { className: "demo-pdp__meta", children: [_jsx("strong", { children: "2 courses" }), ", 6 months"] }), _jsx("button", { type: "button", className: "demo-pdp__cta-primary", onClick: handleEarnCertificate, children: "Earn a certificate" }), _jsxs("label", { className: "demo-pdp__consent", children: [_jsx("input", { type: "checkbox", className: "demo-pdp__checkbox", defaultChecked: false }), _jsx("span", { className: "demo-pdp__consent-text", children: "I would like to receive email from HarvardX and learn about other offerings related to Computer Science for Python Programming." })] })] }), _jsx("div", { className: "demo-pdp__sidebar", children: _jsxs("div", { className: "demo-pdp__card", children: [_jsx("p", { className: "demo-pdp__card-eyebrow", children: "Earn a certificate" }), _jsxs("h2", { className: "demo-pdp__card-title", children: ["Computer Science for", _jsx("br", {}), "Python Programming"] }), _jsxs("p", { className: "demo-pdp__card-enrollments", children: [_jsx("strong", { children: "9,341,307" }), " learners enrolled"] }), _jsxs("div", { className: "demo-pdp__card-courses", children: [_jsx("p", { className: "demo-pdp__card-courses-label", children: "There are 2 courses in this program" }), _jsxs("ul", { className: "demo-pdp__card-courses-list", children: [_jsx("li", { children: "CS50's Introduction to Computer Science" }), _jsx("li", { children: "CS50's Introduction to Programming with Python" })] })] }), _jsxs("div", { className: "demo-pdp__card-pricing", children: [_jsx("span", { className: "demo-pdp__card-price-original", children: "$618 USD" }), _jsx("span", { className: "demo-pdp__card-price-current", children: "$220" })] }), _jsx("button", { type: "button", className: "demo-pdp__cta-sidebar", onClick: handleEarnCertificate, children: "Earn a certificate" })] }) })] })] }), _jsxs("div", { className: "demo-pdp__features", children: [_jsxs("div", { className: "demo-pdp__feature", children: [_jsxs("svg", { className: "demo-pdp__feature-icon", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: [_jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "#fff", strokeWidth: "1.5" }), _jsx("path", { d: "M12 7v5l3 3", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round" })] }), _jsxs("div", { children: [_jsx("p", { className: "demo-pdp__feature-title", children: "Introductory" }), _jsx("p", { className: "demo-pdp__feature-desc", children: "No prior experience required" })] })] }), _jsxs("div", { className: "demo-pdp__feature", children: [_jsxs("svg", { className: "demo-pdp__feature-icon", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M12 2L2 7l10 5 10-5-10-5z", stroke: "#fff", strokeWidth: "1.5", strokeLinejoin: "round" }), _jsx("path", { d: "M2 17l10 5 10-5M2 12l10 5 10-5", stroke: "#fff", strokeWidth: "1.5", strokeLinejoin: "round" })] }), _jsxs("div", { children: [_jsx("p", { className: "demo-pdp__feature-title", children: "Self-paced" }), _jsx("p", { className: "demo-pdp__feature-desc", children: "Progress at your own speed" })] })] }), _jsxs("div", { className: "demo-pdp__feature", children: [_jsxs("svg", { className: "demo-pdp__feature-icon", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: [_jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2", stroke: "#fff", strokeWidth: "1.5" }), _jsx("path", { d: "M3 10h18", stroke: "#fff", strokeWidth: "1.5" }), _jsx("path", { d: "M8 2v4M16 2v4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round" })] }), _jsxs("div", { children: [_jsx("p", { className: "demo-pdp__feature-title", children: "8 months" }), _jsx("p", { className: "demo-pdp__feature-desc", children: "1 - 14 hours per week" })] })] })] })] }));
|
|
32
|
+
};
|
|
33
|
+
export default DemoPdpBanner;
|
|
34
|
+
//# sourceMappingURL=DemoPdpBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DemoPdpBanner.js","sourceRoot":"","sources":["../../../src/components/DemoPdpBanner/DemoPdpBanner.tsx"],"names":[],"mappings":";AAWA,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AACnE,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,SAAS,gBAAgB;;IACvB,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,IAAI,mBAAmB,CAAC;IACjE,MAAM,SAAS,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;IAC/C,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC;IACrD,MAAM,YAAY,GAAG,MAAA,MAAM,CAAC,kBAAkB,mCAAI,qBAAqB,CAAC;IAExE,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IAErC,IAAI,SAAS,IAAI,YAAY,EAA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,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,KAAK,GAAG,EAClF,eAAM,CAAC,EAAC,UAAU,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,KAAK,GAAG,EACrD,eAAM,CAAC,EAAC,eAAe,EAAC,MAAM,EAAC,MAAM,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,GAAG,IAC5E,EACN,0BACE,YAAG,SAAS,EAAC,yBAAyB,yBAAa,EACnD,YAAG,SAAS,EAAC,wBAAwB,sCAA0B,IAC3D,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React from 'react';\n\ndeclare global {\n interface Window {\n activeProgramId?: string,\n activeCourseUid?: string,\n activeCourseRunKey?: string,\n activeDiscountCode?: string,\n }\n}\n\nconst DEFAULT_PROGRAM_UID = '01a06551-667b-7c85-9286-f6a60b9eb287';\nconst DEFAULT_DISCOUNT_CODE = '';\n\nfunction buildCheckoutUrl(): string {\n const programUid = window.activeProgramId || DEFAULT_PROGRAM_UID;\n const courseUid = window.activeCourseUid || '';\n const courseRunKey = window.activeCourseRunKey || '';\n const discountCode = window.activeDiscountCode ?? DEFAULT_DISCOUNT_CODE;\n\n const params = new URLSearchParams();\n\n if (courseUid && courseRunKey) {\n params.set('course_uid', courseUid);\n params.set('course_run_key', courseRunKey);\n } else {\n params.set('program_uid', programUid);\n }\n\n if (discountCode) {\n params.set('discount_code', discountCode);\n }\n\n return `/aca-checkout?${params.toString()}`;\n}\n\nconst HarvardShield = () => (\n <svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" aria-hidden=\"true\">\n <rect width=\"30\" height=\"30\" rx=\"2\" fill=\"#A41034\" />\n <text x=\"15\" y=\"20\" textAnchor=\"middle\" fill=\"#fff\" fontSize=\"16\" fontWeight=\"700\" fontFamily=\"serif\">H</text>\n </svg>\n);\n\ninterface DemoPdpBannerProps {\n onEnroll: () => void,\n}\n\nconst DemoPdpBanner: React.FC<DemoPdpBannerProps> = ({ onEnroll }) => {\n const handleEarnCertificate = (e: React.MouseEvent) => {\n e.preventDefault();\n const url = buildCheckoutUrl();\n window.history.pushState({}, '', url);\n onEnroll();\n };\n\n return (\n <div className=\"demo-pdp\">\n {/* ── Hero Section ── */}\n <div className=\"demo-pdp__hero\">\n <div className=\"demo-pdp__hero-bg\" />\n <div className=\"demo-pdp__hero-content\">\n <div className=\"demo-pdp__main\">\n <div className=\"demo-pdp__institution\">\n <HarvardShield />\n <span className=\"demo-pdp__institution-name\">\n Harvard<br />University\n </span>\n </div>\n\n <h1 className=\"demo-pdp__title\">\n Computer Science for<br />Python Programming\n </h1>\n\n <p className=\"demo-pdp__meta\">\n <strong>2 courses</strong>, 6 months\n </p>\n\n <button\n type=\"button\"\n className=\"demo-pdp__cta-primary\"\n onClick={handleEarnCertificate}\n >\n Earn a certificate\n </button>\n\n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}\n <label className=\"demo-pdp__consent\">\n <input type=\"checkbox\" className=\"demo-pdp__checkbox\" defaultChecked={false} />\n <span className=\"demo-pdp__consent-text\">\n I would like to receive email from HarvardX and learn about other offerings related to\n Computer Science for Python Programming.\n </span>\n </label>\n </div>\n\n {/* ── Right sidebar card ── */}\n <div className=\"demo-pdp__sidebar\">\n <div className=\"demo-pdp__card\">\n <p className=\"demo-pdp__card-eyebrow\">Earn a certificate</p>\n <h2 className=\"demo-pdp__card-title\">\n Computer Science for<br />Python Programming\n </h2>\n <p className=\"demo-pdp__card-enrollments\">\n <strong>9,341,307</strong> learners enrolled\n </p>\n\n <div className=\"demo-pdp__card-courses\">\n <p className=\"demo-pdp__card-courses-label\">\n There are 2 courses in this program\n </p>\n <ul className=\"demo-pdp__card-courses-list\">\n <li>CS50's Introduction to Computer Science</li>\n <li>CS50's Introduction to Programming with Python</li>\n </ul>\n </div>\n\n <div className=\"demo-pdp__card-pricing\">\n <span className=\"demo-pdp__card-price-original\">$618 USD</span>\n <span className=\"demo-pdp__card-price-current\">$220</span>\n </div>\n\n <button\n type=\"button\"\n className=\"demo-pdp__cta-sidebar\"\n onClick={handleEarnCertificate}\n >\n Earn a certificate\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {/* ── Bottom features bar ── */}\n <div className=\"demo-pdp__features\">\n <div className=\"demo-pdp__feature\">\n <svg className=\"demo-pdp__feature-icon\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#fff\" strokeWidth=\"1.5\" />\n <path d=\"M12 7v5l3 3\" stroke=\"#fff\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n <div>\n <p className=\"demo-pdp__feature-title\">Introductory</p>\n <p className=\"demo-pdp__feature-desc\">No prior experience required</p>\n </div>\n </div>\n <div className=\"demo-pdp__feature\">\n <svg className=\"demo-pdp__feature-icon\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M12 2L2 7l10 5 10-5-10-5z\" stroke=\"#fff\" strokeWidth=\"1.5\" strokeLinejoin=\"round\" />\n <path d=\"M2 17l10 5 10-5M2 12l10 5 10-5\" stroke=\"#fff\" strokeWidth=\"1.5\" strokeLinejoin=\"round\" />\n </svg>\n <div>\n <p className=\"demo-pdp__feature-title\">Self-paced</p>\n <p className=\"demo-pdp__feature-desc\">Progress at your own speed</p>\n </div>\n </div>\n <div className=\"demo-pdp__feature\">\n <svg className=\"demo-pdp__feature-icon\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" stroke=\"#fff\" strokeWidth=\"1.5\" />\n <path d=\"M3 10h18\" stroke=\"#fff\" strokeWidth=\"1.5\" />\n <path d=\"M8 2v4M16 2v4\" stroke=\"#fff\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n <div>\n <p className=\"demo-pdp__feature-title\">8 months</p>\n <p className=\"demo-pdp__feature-desc\">1 - 14 hours per week</p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default DemoPdpBanner;\n"]}
|
|
@@ -16,4 +16,5 @@ export declare const alacarteKeys: {
|
|
|
16
16
|
ownedProduct: (productId: string) => readonly ["alacarte", "ownedProduct", string];
|
|
17
17
|
productDetail: (key: string) => readonly ["alacarte", "productDetail", string];
|
|
18
18
|
placedOrder: (biId: string) => readonly ["alacarte", "placedOrder", string];
|
|
19
|
+
orderDates: (biId: string) => readonly ["alacarte", "orderDates", string];
|
|
19
20
|
};
|
package/dist/data/hooks/keys.js
CHANGED
|
@@ -16,5 +16,6 @@ export const alacarteKeys = {
|
|
|
16
16
|
ownedProduct: (productId) => ['alacarte', 'ownedProduct', productId],
|
|
17
17
|
productDetail: (key) => ['alacarte', 'productDetail', key],
|
|
18
18
|
placedOrder: (biId) => ['alacarte', 'placedOrder', biId],
|
|
19
|
+
orderDates: (biId) => ['alacarte', 'orderDates', biId],
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/data/hooks/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE,CAAC,UAAU,CAAU;IAC1B,MAAM,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAU;IACvE,YAAY,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAU;IAC/F,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,CAAU;IACvF,QAAQ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,EAAE,UAAU,EAAE,SAAS,CAAU;IAC7E,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,CAAU;IACjE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,aAAa,CAAU;IACvD,YAAY,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,SAAS,CAAU;CACtF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,UAAU,CAAU;IACjD,YAAY,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,cAAc,EAAE,SAAS,CAAU;IACrF,aAAa,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,CAAU;IAC3E,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,CAAU;IACzE,UAAU,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,CAAU;CACxE,CAAC","sourcesContent":["/**\n * query/keys.ts — typed query-key factory for the checkout module.\n */\nexport const checkoutKeys = {\n all: ['checkout'] as const,\n status: (cartBiId: string) => ['checkout', 'status', cartBiId] as const,\n clientSecret: (subscriptionId: string) => ['checkout', 'clientSecret', subscriptionId] as const,\n subscriptionId: (cartBiId: string) => ['checkout', 'subscriptionId', cartBiId] as const,\n customer: (userEmail: string) => ['checkout', 'customer', userEmail] as const,\n salable: (maId: string) => ['checkout', 'salable', maId] as const,\n viaxSession: () => ['checkout', 'viaxSession'] as const,\n courseDetail: (courseKey: string) => ['checkout', 'courseDetail', courseKey] as const,\n};\n\nexport const alacarteKeys = {\n checkout: () => ['alacarte', 'checkout'] as const,\n ownedProduct: (productId: string) => ['alacarte', 'ownedProduct', productId] as const,\n productDetail: (key: string) => ['alacarte', 'productDetail', key] as const,\n placedOrder: (biId: string) => ['alacarte', 'placedOrder', biId] as const,\n orderDates: (biId: string) => ['alacarte', 'orderDates', biId] as const,\n};\n"]}
|
|
@@ -50,6 +50,9 @@ export interface UseAlacarteCheckoutResult extends AlacartePhaseState {
|
|
|
50
50
|
placedOrder: PlacedOrder | null;
|
|
51
51
|
awaitingPlacedOrder: boolean;
|
|
52
52
|
placedOrderError: string | null;
|
|
53
|
+
/** ISO timestamp the order was placed (tPlacedAt, falling back to
|
|
54
|
+
* biCreatedAt); null while the order-dates query hasn't resolved yet. */
|
|
55
|
+
placedOrderPlacedAt: string | null;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Read the product selector from the URL: course_uid+course_run_key, or
|