@edx/frontend-app-alacarte-checkout 1.35.0 → 1.36.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.
@@ -0,0 +1,2 @@
1
+ declare const OrderHistoryDetails: () => import("react/jsx-runtime").JSX.Element;
2
+ export default OrderHistoryDetails;
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useParams } from 'react-router-dom';
3
+ import { Container } from '@openedx/paragon';
4
+ import { useIntl } from '@openedx/frontend-base';
5
+ import orders from './data/orderDetailsData';
6
+ import messages from './messages';
7
+ import { getOrderSummaryRows, getOrderItemRows, } from './data/receiptRows';
8
+ const formatAmount = (amount, currency) => (`${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`);
9
+ const formatDate = (isoDate) => (new Date(isoDate).toLocaleDateString('en-US', {
10
+ month: 'short',
11
+ day: 'numeric',
12
+ year: 'numeric',
13
+ }));
14
+ const ReceiptRow = ({ label, children }) => (_jsxs("div", { className: "d-flex align-items-baseline mb-2", children: [_jsx("span", { className: "font-weight-bold text-gray-700", children: label }), _jsx("span", { className: "flex-grow-1 mx-2 text-gray-700", style: { borderBottom: '1px dotted currentColor' } }), _jsx("span", { children: children })] }));
15
+ const OrderReceipt = ({ order }) => {
16
+ const { formatMessage } = useIntl();
17
+ const orderDate = formatDate(order.purchasedAt);
18
+ const total = formatAmount(order.total.amount, order.total.currency);
19
+ const discountAmount = formatAmount(0, order.total.currency);
20
+ const orderSummaryRows = getOrderSummaryRows(order, orderDate, total, discountAmount);
21
+ const orderItemRows = getOrderItemRows(order, total, discountAmount);
22
+ const renderRows = (rows) => rows.map(({ label, value }) => (_jsx(ReceiptRow, { label: formatMessage(label), children: value }, label.id)));
23
+ return (_jsxs(_Fragment, { children: [_jsxs("h1", { className: "h1 mb-4 mt-4 text-primary-500 orderHistoryTitle", children: [formatMessage(messages.orderDateTitle), ": ", orderDate] }), _jsx("h3", { className: "h3 font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderSummaryTitle) }), renderRows(orderSummaryRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.orderItemsTitle) }), renderRows(orderItemRows), _jsx("hr", { className: "my-4 divider" }), _jsx("h3", { className: "font-weight-bold mb-3 text-primary-500", children: formatMessage(messages.paymentTitle) }), _jsx(ReceiptRow, { label: formatMessage(messages.receiptAmountLabel), children: total })] }));
24
+ };
25
+ const OrderHistoryDetails = () => {
26
+ const { orderId } = useParams();
27
+ const order = orders.find(item => item.orderId === orderId);
28
+ return (_jsx(Container, { fluid: true, size: "xl", className: "py-4", children: order && _jsx(OrderReceipt, { order: order }) }));
29
+ };
30
+ export default OrderHistoryDetails;
31
+ //# sourceMappingURL=OrderHistoryDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderHistoryDetails.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderHistoryDetails.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,MAAiC,MAAM,yBAAyB,CAAC;AACxE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CAAC,CACzD,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CACnE,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,E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,CAAC,YACnD,KAAK,IADS,KAAK,CAAC,EAAE,CAEZ,CACd,CAAC,CAAC;IAEL,OAAO,CACL,8BACE,cAAI,SAAS,EAAC,iDAAiD,aAC5D,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAI,SAAS,IACjD,EAEL,aAAI,SAAS,EAAC,2CAA2C,YACtD,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACvC,EACJ,UAAU,CAAC,gBAAgB,CAAC,EAE7B,aAAI,SAAS,EAAC,cAAc,GAAG,EAE/B,aAAI,SAAS,EAAC,wCAAwC,YACnD,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,GACrC,EACJ,UAAU,CAAC,aAAa,CAAC,EAE1B,aAAI,SAAS,EAAC,cAAc,GAAG,EAE/B,aAAI,SAAS,EAAC,wCAAwC,YACnD,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,GAClC,EACL,KAAC,UAAU,IAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,YAC1D,KAAK,GACK,IACZ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAE5D,OAAO,CACL,KAAC,SAAS,IAAC,KAAK,QAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,YACxC,KAAK,IAAI,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,GAC9B,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Container } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport orders, { type OrderDetailsData } from './data/orderDetailsData';\nimport messages from './messages';\nimport {\n getOrderSummaryRows,\n getOrderItemRows,\n} from './data/receiptRows';\n\nconst formatAmount = (amount: number, currency: string) => (\n `${currency === 'USD' ? '$' : ''}${amount.toFixed(2)} ${currency}`\n);\n\nconst formatDate = (isoDate: string) => (\n new Date(isoDate).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n);\n\ninterface ReceiptRowProps {\n label: string,\n children: ReactNode,\n}\n\nconst ReceiptRow = ({ label, children }: ReceiptRowProps) => (\n <div className=\"d-flex align-items-baseline mb-2\">\n <span className=\"font-weight-bold text-gray-700\">{label}</span>\n <span\n className=\"flex-grow-1 mx-2 text-gray-700\"\n style={{ borderBottom: '1px dotted currentColor' }}\n />\n <span>{children}</span>\n </div>\n);\n\nconst OrderReceipt = ({ order }: { order: OrderDetailsData }) => {\n const { formatMessage } = useIntl();\n const orderDate = formatDate(order.purchasedAt);\n const total = formatAmount(order.total.amount, order.total.currency);\n const discountAmount = formatAmount(0, order.total.currency);\n\n const orderSummaryRows = getOrderSummaryRows(order, orderDate, total, discountAmount);\n\n const orderItemRows = getOrderItemRows(order, total, discountAmount);\n\n const renderRows = (rows: typeof orderSummaryRows | typeof orderItemRows) =>\n rows.map(({ label, value }) => (\n <ReceiptRow key={label.id} label={formatMessage(label)}>\n {value}\n </ReceiptRow>\n ));\n\n return (\n <>\n <h1 className=\"h1 mb-4 mt-4 text-primary-500 orderHistoryTitle\">\n {formatMessage(messages.orderDateTitle)}: {orderDate}\n </h1>\n\n <h3 className=\"h3 font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.orderSummaryTitle)}\n </h3>\n {renderRows(orderSummaryRows)}\n\n <hr className=\"my-4 divider\" />\n\n <h3 className=\"font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.orderItemsTitle)}\n </h3>\n {renderRows(orderItemRows)}\n\n <hr className=\"my-4 divider\" />\n\n <h3 className=\"font-weight-bold mb-3 text-primary-500\">\n {formatMessage(messages.paymentTitle)}\n </h3>\n <ReceiptRow label={formatMessage(messages.receiptAmountLabel)}>\n {total}\n </ReceiptRow>\n </>\n );\n};\n\nconst OrderHistoryDetails = () => {\n const { orderId } = useParams();\n const order = orders.find(item => item.orderId === orderId);\n\n return (\n <Container fluid size=\"xl\" className=\"py-4\">\n {order && <OrderReceipt order={order} />}\n </Container>\n );\n};\n\nexport default OrderHistoryDetails;\n"]}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import OrderHistoryCard from './OrderHistoryCard';
3
+ import { useNavigate } from 'react-router-dom';
3
4
  const orders = [
4
5
  {
5
6
  orderId: 'BI0QZ4UAFLTYBCXC',
@@ -35,10 +36,11 @@ const orders = [
35
36
  },
36
37
  },
37
38
  ];
38
- const OrdersList = () => (_jsx("div", { className: "px-4", children: orders.map((order) => (_jsx("div", { className: "mb-3", children: _jsx(OrderHistoryCard, { title: order.name, purchaseDate: new Date(order.purchasedAt).toLocaleDateString('en-US'), totalCost: `${order.total.currency === 'USD' ? '$' : ''}${order.total.amount.toFixed(2)} ${order.total.currency}`, orderNumber: order.orderNumber, onViewReceipt: () => {
39
- console.log('View receipt:', order.paymentIntentId);
40
- }, onViewOrderDetails: () => {
41
- console.log('View order details:', order.orderId);
42
- } }) }, order.orderId))) }));
39
+ const OrdersList = () => {
40
+ const navigate = useNavigate();
41
+ return (_jsx("div", { className: "px-4", children: orders.map((order) => (_jsx("div", { className: "mb-3", children: _jsx(OrderHistoryCard, { title: order.name, purchaseDate: new Date(order.purchasedAt).toLocaleDateString('en-US'), totalCost: `${order.total.currency === 'USD' ? '$' : ''}${order.total.amount.toFixed(2)} ${order.total.currency}`, orderNumber: order.orderNumber, onViewReceipt: () => {
42
+ console.log('View receipt:', order.paymentIntentId);
43
+ }, onViewOrderDetails: () => navigate(`/aca-order-details/${order.orderId}`) }) }, order.orderId))) }));
44
+ };
43
45
  export default OrdersList;
44
46
  //# sourceMappingURL=OrderList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrderList.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderList.tsx"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,GAAG;IACb;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,+CAA+C;QACrD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,0DAA0D;QAChE,KAAK,EAAE;YACL,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACvB,cAAK,SAAS,EAAC,MAAM,YAClB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,cAAyB,SAAS,EAAC,MAAM,YACvC,KAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,YAAY,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EACrE,SAAS,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EACjH,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,aAAa,EAAE,GAAG,EAAE;gBAClB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;YACtD,CAAC,EACD,kBAAkB,EAAE,GAAG,EAAE;gBACvB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACpD,CAAC,GACD,IAZM,KAAK,CAAC,OAAO,CAajB,CACP,CAAC,GACE,CACP,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import OrderHistoryCard from './OrderHistoryCard';\n\nconst orders = [\n {\n orderId: 'BI0QZ4UAFLTYBCXC',\n orderNumber: '2U-ORD-62638121',\n purchasedAt: '2026-10-26T14:37:56.721Z',\n paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',\n name: 'A Verified and Audi course or b2c testing 001',\n total: {\n amount: 90,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI1RX5VBGMUZCDYD',\n orderNumber: '2U-ORD-62638122',\n purchasedAt: '2026-10-24T10:15:30.000Z',\n paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',\n name: 'Harvard University CS50 Introduction to Computer Science',\n total: {\n amount: 219,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI2SY6WCHNVAEZE',\n orderNumber: '2U-ORD-62638123',\n purchasedAt: '2026-10-20T08:45:12.000Z',\n paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',\n name: 'Introduction to Python Programming',\n total: {\n amount: 49,\n currency: 'USD',\n },\n },\n];\n\nconst OrdersList = () => (\n <div className=\"px-4\">\n {orders.map((order) => (\n <div key={order.orderId} className=\"mb-3\">\n <OrderHistoryCard\n title={order.name}\n purchaseDate={new Date(order.purchasedAt).toLocaleDateString('en-US')}\n totalCost={`${order.total.currency === 'USD' ? '$' : ''}${order.total.amount.toFixed(2)} ${order.total.currency}`}\n orderNumber={order.orderNumber}\n onViewReceipt={() => {\n console.log('View receipt:', order.paymentIntentId);\n }}\n onViewOrderDetails={() => {\n console.log('View order details:', order.orderId);\n }}\n />\n </div>\n ))}\n </div>\n);\n\nexport default OrdersList;\n"]}
1
+ {"version":3,"file":"OrderList.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/OrderList.tsx"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,MAAM,MAAM,GAAG;IACb;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,+CAA+C;QACrD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,0DAA0D;QAChE,KAAK,EAAE;YACL,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,OAAO,CACL,cAAK,SAAS,EAAC,MAAM,YAClB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,cAAyB,SAAS,EAAC,MAAM,YACvC,KAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,YAAY,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EACrE,SAAS,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EACjH,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,aAAa,EAAE,GAAG,EAAE;oBAClB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBACtD,CAAC,EACD,kBAAkB,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,sBAAsB,KAAK,CAAC,OAAO,EAAE,CAAC,GACzE,IAVM,KAAK,CAAC,OAAO,CAWjB,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import OrderHistoryCard from './OrderHistoryCard';\nimport { useNavigate } from 'react-router-dom';\nconst orders = [\n {\n orderId: 'BI0QZ4UAFLTYBCXC',\n orderNumber: '2U-ORD-62638121',\n purchasedAt: '2026-10-26T14:37:56.721Z',\n paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',\n name: 'A Verified and Audi course or b2c testing 001',\n total: {\n amount: 90,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI1RX5VBGMUZCDYD',\n orderNumber: '2U-ORD-62638122',\n purchasedAt: '2026-10-24T10:15:30.000Z',\n paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',\n name: 'Harvard University CS50 Introduction to Computer Science',\n total: {\n amount: 219,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI2SY6WCHNVAEZE',\n orderNumber: '2U-ORD-62638123',\n purchasedAt: '2026-10-20T08:45:12.000Z',\n paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',\n name: 'Introduction to Python Programming',\n total: {\n amount: 49,\n currency: 'USD',\n },\n },\n];\n\nconst OrdersList = () => {\n const navigate = useNavigate();\n return (\n <div className=\"px-4\">\n {orders.map((order) => (\n <div key={order.orderId} className=\"mb-3\">\n <OrderHistoryCard\n title={order.name}\n purchaseDate={new Date(order.purchasedAt).toLocaleDateString('en-US')}\n totalCost={`${order.total.currency === 'USD' ? '$' : ''}${order.total.amount.toFixed(2)} ${order.total.currency}`}\n orderNumber={order.orderNumber}\n onViewReceipt={() => {\n console.log('View receipt:', order.paymentIntentId);\n }}\n onViewOrderDetails={() => navigate(`/aca-order-details/${order.orderId}`)}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport default OrdersList;\n"]}
@@ -0,0 +1,13 @@
1
+ export interface OrderDetailsData {
2
+ orderId: string;
3
+ orderNumber: string;
4
+ purchasedAt: string;
5
+ paymentIntentId: string;
6
+ name: string;
7
+ total: {
8
+ amount: number;
9
+ currency: string;
10
+ };
11
+ }
12
+ declare const orderDetailsData: OrderDetailsData[];
13
+ export default orderDetailsData;
@@ -0,0 +1,37 @@
1
+ const orderDetailsData = [
2
+ {
3
+ orderId: 'BI0QZ4UAFLTYBCXC',
4
+ orderNumber: '2U-ORD-62638121',
5
+ purchasedAt: '2026-10-26T14:37:56.721Z',
6
+ paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',
7
+ name: 'A Verified and Audi course or b2c testing 001',
8
+ total: {
9
+ amount: 90,
10
+ currency: 'USD',
11
+ },
12
+ },
13
+ {
14
+ orderId: 'BI1RX5VBGMUZCDYD',
15
+ orderNumber: '2U-ORD-62638122',
16
+ purchasedAt: '2026-10-24T10:15:30.000Z',
17
+ paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',
18
+ name: 'Harvard University CS50 Introduction to Computer Science',
19
+ total: {
20
+ amount: 219,
21
+ currency: 'USD',
22
+ },
23
+ },
24
+ {
25
+ orderId: 'BI2SY6WCHNVAEZE',
26
+ orderNumber: '2U-ORD-62638123',
27
+ purchasedAt: '2026-10-20T08:45:12.000Z',
28
+ paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',
29
+ name: 'Introduction to Python Programming',
30
+ total: {
31
+ amount: 49,
32
+ currency: 'USD',
33
+ },
34
+ },
35
+ ];
36
+ export default orderDetailsData;
37
+ //# sourceMappingURL=orderDetailsData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderDetailsData.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/data/orderDetailsData.ts"],"names":[],"mappings":"AAYA,MAAM,gBAAgB,GAAuB;IAC3C;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,+CAA+C;QACrD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,0DAA0D;QAChE,KAAK,EAAE;YACL,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,KAAK;SAChB;KACF;IACD;QACE,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,eAAe,EAAE,6BAA6B;QAC9C,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;KACF;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["export interface OrderDetailsData {\n orderId: string,\n orderNumber: string,\n purchasedAt: string,\n paymentIntentId: string,\n name: string,\n total: {\n amount: number,\n currency: string,\n },\n}\n\nconst orderDetailsData: OrderDetailsData[] = [\n {\n orderId: 'BI0QZ4UAFLTYBCXC',\n orderNumber: '2U-ORD-62638121',\n purchasedAt: '2026-10-26T14:37:56.721Z',\n paymentIntentId: 'pi_3UUp24EUxB2SCTmQ1LBPdo4n',\n name: 'A Verified and Audi course or b2c testing 001',\n total: {\n amount: 90,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI1RX5VBGMUZCDYD',\n orderNumber: '2U-ORD-62638122',\n purchasedAt: '2026-10-24T10:15:30.000Z',\n paymentIntentId: 'pi_3UUp25EUxB2SCTmQ2LBPdo5p',\n name: 'Harvard University CS50 Introduction to Computer Science',\n total: {\n amount: 219,\n currency: 'USD',\n },\n },\n {\n orderId: 'BI2SY6WCHNVAEZE',\n orderNumber: '2U-ORD-62638123',\n purchasedAt: '2026-10-20T08:45:12.000Z',\n paymentIntentId: 'pi_3UUp26EUxB2SCTmQ3LBPdo6q',\n name: 'Introduction to Python Programming',\n total: {\n amount: 49,\n currency: 'USD',\n },\n },\n];\n\nexport default orderDetailsData;\n"]}
@@ -0,0 +1,17 @@
1
+ import type { OrderDetailsData } from './orderDetailsData';
2
+ export declare const getOrderSummaryRows: (order: OrderDetailsData, orderDate: string, total: string, discountAmount: string) => {
3
+ label: {
4
+ id: string;
5
+ defaultMessage: string;
6
+ description: string;
7
+ };
8
+ value: string;
9
+ }[];
10
+ export declare const getOrderItemRows: (order: OrderDetailsData, total: string, discountAmount: string) => {
11
+ label: {
12
+ id: string;
13
+ defaultMessage: string;
14
+ description: string;
15
+ };
16
+ value: string;
17
+ }[];
@@ -0,0 +1,16 @@
1
+ import messages from '../messages';
2
+ export const getOrderSummaryRows = (order, orderDate, total, discountAmount) => [
3
+ { label: messages.receiptOrderNumberLabel, value: order.orderNumber },
4
+ { label: messages.receiptOrderDateLabel, value: orderDate },
5
+ { label: messages.receiptSubtotalLabel, value: total },
6
+ { label: messages.receiptDiscountCodeLabel, value: 'None' },
7
+ { label: messages.receiptDiscountAmountLabel, value: discountAmount },
8
+ { label: messages.receiptTotalAfterDiscountLabel, value: total },
9
+ ];
10
+ export const getOrderItemRows = (order, total, discountAmount) => [
11
+ { label: messages.receiptNameLabel, value: order.name },
12
+ { label: messages.receiptPriceLabel, value: total },
13
+ { label: messages.receiptDiscountAmountLabel, value: discountAmount },
14
+ { label: messages.receiptTotalAfterDiscountLabel, value: total },
15
+ ];
16
+ //# sourceMappingURL=receiptRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiptRows.js","sourceRoot":"","sources":["../../../../src/components/OrderHistory/data/receiptRows.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAuB,EACvB,SAAiB,EACjB,KAAa,EACb,cAAsB,EACtB,EAAE,CAAC;IACH,EAAE,KAAK,EAAE,QAAQ,CAAC,uBAAuB,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE;IACrE,EAAE,KAAK,EAAE,QAAQ,CAAC,qBAAqB,EAAE,KAAK,EAAE,SAAS,EAAE;IAC3D,EAAE,KAAK,EAAE,QAAQ,CAAC,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE;IACtD,EAAE,KAAK,EAAE,QAAQ,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3D,EAAE,KAAK,EAAE,QAAQ,CAAC,0BAA0B,EAAE,KAAK,EAAE,cAAc,EAAE;IACrE,EAAE,KAAK,EAAE,QAAQ,CAAC,8BAA8B,EAAE,KAAK,EAAE,KAAK,EAAE;CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,KAAuB,EACvB,KAAa,EACb,cAAsB,EACtB,EAAE,CAAC;IACH,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;IACvD,EAAE,KAAK,EAAE,QAAQ,CAAC,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE;IACnD,EAAE,KAAK,EAAE,QAAQ,CAAC,0BAA0B,EAAE,KAAK,EAAE,cAAc,EAAE;IACrE,EAAE,KAAK,EAAE,QAAQ,CAAC,8BAA8B,EAAE,KAAK,EAAE,KAAK,EAAE;CACjE,CAAC","sourcesContent":["import type { OrderDetailsData } from './orderDetailsData';\nimport messages from '../messages';\n\nexport const getOrderSummaryRows = (\n order: OrderDetailsData,\n orderDate: string,\n total: string,\n discountAmount: string,\n) => [\n { label: messages.receiptOrderNumberLabel, value: order.orderNumber },\n { label: messages.receiptOrderDateLabel, value: orderDate },\n { label: messages.receiptSubtotalLabel, value: total },\n { label: messages.receiptDiscountCodeLabel, value: 'None' },\n { label: messages.receiptDiscountAmountLabel, value: discountAmount },\n { label: messages.receiptTotalAfterDiscountLabel, value: total },\n];\n\nexport const getOrderItemRows = (\n order: OrderDetailsData,\n total: string,\n discountAmount: string,\n) => [\n { label: messages.receiptNameLabel, value: order.name },\n { label: messages.receiptPriceLabel, value: total },\n { label: messages.receiptDiscountAmountLabel, value: discountAmount },\n { label: messages.receiptTotalAfterDiscountLabel, value: total },\n];\n"]}
@@ -19,5 +19,70 @@ declare const messages: {
19
19
  defaultMessage: string;
20
20
  description: string;
21
21
  };
22
+ orderDateTitle: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ orderSummaryTitle: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ orderItemsTitle: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ paymentTitle: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ receiptOrderNumberLabel: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ receiptOrderDateLabel: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ receiptSubtotalLabel: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ receiptDiscountCodeLabel: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ receiptDiscountAmountLabel: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ description: string;
66
+ };
67
+ receiptTotalAfterDiscountLabel: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
72
+ receiptNameLabel: {
73
+ id: string;
74
+ defaultMessage: string;
75
+ description: string;
76
+ };
77
+ receiptPriceLabel: {
78
+ id: string;
79
+ defaultMessage: string;
80
+ description: string;
81
+ };
82
+ receiptAmountLabel: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
22
87
  };
23
88
  export default messages;
@@ -19,7 +19,72 @@ const messages = defineMessages({
19
19
  id: 'coursePaymentsTab',
20
20
  defaultMessage: 'Course payments',
21
21
  description: 'Course payments tab label',
22
- }
22
+ },
23
+ orderDateTitle: {
24
+ id: 'orderDateTitle',
25
+ defaultMessage: 'Order date',
26
+ description: 'Label for order date',
27
+ },
28
+ orderSummaryTitle: {
29
+ id: 'orderSummaryTitle',
30
+ defaultMessage: 'Order summary',
31
+ description: 'Heading for order summary section',
32
+ },
33
+ orderItemsTitle: {
34
+ id: 'orderItemsTitle',
35
+ defaultMessage: 'Order items',
36
+ description: 'Heading for order items section',
37
+ },
38
+ paymentTitle: {
39
+ id: 'paymentTitle',
40
+ defaultMessage: 'Payment',
41
+ description: 'Heading for payment section',
42
+ },
43
+ receiptOrderNumberLabel: {
44
+ id: 'receiptOrderNumberLabel',
45
+ defaultMessage: 'Order number:',
46
+ description: 'Receipt label for the order number',
47
+ },
48
+ receiptOrderDateLabel: {
49
+ id: 'receiptOrderDateLabel',
50
+ defaultMessage: 'Order date:',
51
+ description: 'Receipt label for the order date',
52
+ },
53
+ receiptSubtotalLabel: {
54
+ id: 'receiptSubtotalLabel',
55
+ defaultMessage: 'Subtotal:',
56
+ description: 'Receipt label for the subtotal amount',
57
+ },
58
+ receiptDiscountCodeLabel: {
59
+ id: 'receiptDiscountCodeLabel',
60
+ defaultMessage: 'Discount code:',
61
+ description: 'Receipt label for the discount code',
62
+ },
63
+ receiptDiscountAmountLabel: {
64
+ id: 'receiptDiscountAmountLabel',
65
+ defaultMessage: 'Discount amount:',
66
+ description: 'Receipt label for the discount amount',
67
+ },
68
+ receiptTotalAfterDiscountLabel: {
69
+ id: 'receiptTotalAfterDiscountLabel',
70
+ defaultMessage: 'Total after discount:',
71
+ description: 'Receipt label for the total after discount',
72
+ },
73
+ receiptNameLabel: {
74
+ id: 'receiptNameLabel',
75
+ defaultMessage: 'Name:',
76
+ description: 'Receipt label for the item name',
77
+ },
78
+ receiptPriceLabel: {
79
+ id: 'receiptPriceLabel',
80
+ defaultMessage: 'Price:',
81
+ description: 'Receipt label for the item price',
82
+ },
83
+ receiptAmountLabel: {
84
+ id: 'receiptAmountLabel',
85
+ defaultMessage: 'Amount:',
86
+ description: 'Receipt label for the payment amount',
87
+ },
23
88
  });
24
89
  export default messages;
25
90
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KACzC;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,WAAW,EAAE,mCAAmC;KACjD;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,iCAAiC;KAC/C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,2BAA2B;KACzC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderHistoryTitle: {\n id: 'orderHistoryTitle',\n defaultMessage: 'Order History',\n description: 'Heading for order history',\n },\n orderHistorySubTitle: {\n id: 'orderHistorySubTitle',\n defaultMessage: 'View previous purchases and manage your subscription. ',\n description: 'Page subtitle under Order History',\n },\n subscriptionPaymentsTab: {\n id: 'subscriptionPaymentsTab',\n defaultMessage: 'Subscription payments',\n description: 'Subscription payments tab label',\n },\n coursePaymentsTab: {\n id: 'coursePaymentsTab',\n defaultMessage: 'Course payments',\n description: 'Course payments tab label',\n }\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/components/OrderHistory/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KACzC;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,WAAW,EAAE,mCAAmC;KACjD;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,iCAAiC;KAC/C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mBAAmB;QACvB,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,2BAA2B;KAC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kCAAkC;KAChD;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,oBAAoB;QACxB,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,sCAAsC;KACpD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderHistoryTitle: {\n id: 'orderHistoryTitle',\n defaultMessage: 'Order History',\n description: 'Heading for order history',\n },\n orderHistorySubTitle: {\n id: 'orderHistorySubTitle',\n defaultMessage: 'View previous purchases and manage your subscription. ',\n description: 'Page subtitle under Order History',\n },\n subscriptionPaymentsTab: {\n id: 'subscriptionPaymentsTab',\n defaultMessage: 'Subscription payments',\n description: 'Subscription payments tab label',\n },\n coursePaymentsTab: {\n id: 'coursePaymentsTab',\n defaultMessage: 'Course payments',\n description: 'Course payments tab label',\n },\n orderDateTitle: {\n id: 'orderDateTitle',\n defaultMessage: 'Order date',\n description: 'Label for order date',\n },\n orderSummaryTitle: {\n id: 'orderSummaryTitle',\n defaultMessage: 'Order summary',\n description: 'Heading for order summary section',\n },\n orderItemsTitle: {\n id: 'orderItemsTitle',\n defaultMessage: 'Order items',\n description: 'Heading for order items section',\n },\n paymentTitle: {\n id: 'paymentTitle',\n defaultMessage: 'Payment',\n description: 'Heading for payment section',\n },\n receiptOrderNumberLabel: {\n id: 'receiptOrderNumberLabel',\n defaultMessage: 'Order number:',\n description: 'Receipt label for the order number',\n },\n receiptOrderDateLabel: {\n id: 'receiptOrderDateLabel',\n defaultMessage: 'Order date:',\n description: 'Receipt label for the order date',\n },\n receiptSubtotalLabel: {\n id: 'receiptSubtotalLabel',\n defaultMessage: 'Subtotal:',\n description: 'Receipt label for the subtotal amount',\n },\n receiptDiscountCodeLabel: {\n id: 'receiptDiscountCodeLabel',\n defaultMessage: 'Discount code:',\n description: 'Receipt label for the discount code',\n },\n receiptDiscountAmountLabel: {\n id: 'receiptDiscountAmountLabel',\n defaultMessage: 'Discount amount:',\n description: 'Receipt label for the discount amount',\n },\n receiptTotalAfterDiscountLabel: {\n id: 'receiptTotalAfterDiscountLabel',\n defaultMessage: 'Total after discount:',\n description: 'Receipt label for the total after discount',\n },\n receiptNameLabel: {\n id: 'receiptNameLabel',\n defaultMessage: 'Name:',\n description: 'Receipt label for the item name',\n },\n receiptPriceLabel: {\n id: 'receiptPriceLabel',\n defaultMessage: 'Price:',\n description: 'Receipt label for the item price',\n },\n receiptAmountLabel: {\n id: 'receiptAmountLabel',\n defaultMessage: 'Amount:',\n description: 'Receipt label for the payment amount',\n },\n});\n\nexport default messages;\n"]}
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const routes: {
1
+ declare const routes: ({
2
2
  id: string;
3
3
  path: string;
4
4
  loader: (args: any) => Promise<null>;
@@ -14,5 +14,21 @@ declare const routes: {
14
14
  Component: import("react").FC<{}>;
15
15
  }>;
16
16
  }[];
17
- }[];
17
+ } | {
18
+ id: string;
19
+ path: string;
20
+ loader: (args: any) => Promise<null>;
21
+ handle: {
22
+ roles: string[];
23
+ };
24
+ lazy(): Promise<{
25
+ Component: () => import("react/jsx-runtime").JSX.Element;
26
+ }>;
27
+ children: {
28
+ index: boolean;
29
+ lazy(): Promise<{
30
+ Component: () => import("react/jsx-runtime").JSX.Element;
31
+ }>;
32
+ }[];
33
+ })[];
18
34
  export default routes;
package/dist/routes.js CHANGED
@@ -88,6 +88,33 @@ const routes = [
88
88
  },
89
89
  ],
90
90
  },
91
+ {
92
+ id: 'org.openedx.frontend.route.template.main.aca-order-details',
93
+ path: 'aca-order-details/:orderId',
94
+ loader: protectedLoader,
95
+ handle: {
96
+ roles: [acaCheckoutRole],
97
+ },
98
+ lazy() {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ const module = yield import(
101
+ /* webpackChunkName: "template-main" */ './Main');
102
+ return { Component: module.default };
103
+ });
104
+ },
105
+ children: [
106
+ {
107
+ index: true,
108
+ lazy() {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ const module = yield import(
111
+ /* webpackChunkName: "OrderHistoryDetails" */ './components/OrderHistory/OrderHistoryDetails');
112
+ return { Component: module.default };
113
+ });
114
+ },
115
+ },
116
+ ],
117
+ },
91
118
  ];
92
119
  export default routes;
93
120
  //# sourceMappingURL=routes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACzC,OAAO,QAAQ,KAAK,WAAW;WAC1B,QAAQ,KAAK,WAAW;WACxB,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WACpC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WACpC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;WAC/B,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAO,IAAI,EAAE,EAAE;IACrC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAA,CAAC;AAEF,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,uDAAuD;QAC3D,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,eAAe,CAAC;SACzB;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM;gBACzB,uCAAuC,CAAC,QAAQ,CACjD,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;QACD,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,IAAI;gBACL,IAAI;;wBACR,MAAM,MAAM,GAAG,MAAM,MAAM;wBACzB,sCAAsC,CAAC,6BAA6B,CACrE,CAAC;wBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvC,CAAC;iBAAA;aACF;SACF;KACF;IACD;QACE,EAAE,EAAE,4DAA4D;QAChE,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,eAAe,CAAC;SACzB;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM;gBACzB,uCAAuC,CAAC,QAAQ,CACjD,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;QACD,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,IAAI;gBACL,IAAI;;wBACR,MAAM,MAAM,GAAG,MAAM,MAAM;wBACzB,sCAAsC,CAAC,wCAAwC,CAChF,CAAC;wBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvC,CAAC;iBAAA;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n authenticatedLoader,\n} from '@openedx/frontend-base';\n\nimport { acaCheckoutRole } from './constants';\n\n/**\n * LMS JWT cookies are host-bound to localhost:18000. On https://localhost or an\n * ngrok tunnel they are missing, so authenticatedLoader sends you to LMS login\n * → usually /dashboard. DEV_MOCK_SESSION covers Viax tokens for that case.\n *\n * Do not use getAppConfig() here — app configs are registered after the router\n * is created, so the first loader pass often sees an empty config and still\n * redirects. Use the request hostname instead.\n */\nconst shouldSkipLmsCookieAuth = (requestUrl: string): boolean => {\n const { hostname } = new URL(requestUrl);\n return hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname.endsWith('.ngrok-free.app')\n || hostname.endsWith('.ngrok-free.dev')\n || hostname.endsWith('.ngrok.app')\n || hostname.endsWith('.ngrok.io');\n};\n\nconst protectedLoader = async (args) => {\n if (!shouldSkipLmsCookieAuth(args.request.url)) {\n await authenticatedLoader(args);\n }\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.template.main.aca-checkout',\n path: 'aca-checkout',\n loader: protectedLoader,\n handle: {\n roles: [acaCheckoutRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"template-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CheckoutPage\" */ './checkoutPage/CheckoutPage'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n {\n id: 'org.openedx.frontend.route.template.main.aca-order-history',\n path: 'aca-order-history',\n loader: protectedLoader,\n handle: {\n roles: [acaCheckoutRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"template-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"OrderHistory\" */ './components/OrderHistory/OrderHistory'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n];\n\nexport default routes;\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACzC,OAAO,QAAQ,KAAK,WAAW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C,CAAC,QAAQ,CACjD,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;QACD,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,IAAI;gBACL,IAAI;;wBACR,MAAM,MAAM,GAAG,MAAM,MAAM;wBACzB,sCAAsC,CAAC,wCAAwC,CAChF,CAAC;wBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvC,CAAC;iBAAA;aACF;SACF;KACF;IACD;QACE,EAAE,EAAE,4DAA4D;QAChE,IAAI,EAAE,4BAA4B;QAClC,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,eAAe,CAAC;SACzB;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM;gBACzB,uCAAuC,CAAC,QAAQ,CACjD,CAAC;gBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;QACD,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,IAAI;gBACL,IAAI;;wBACR,MAAM,MAAM,GAAG,MAAM,MAAM;wBACzB,6CAA6C,CAAC,+CAA+C,CAC9F,CAAC;wBACF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvC,CAAC;iBAAA;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n authenticatedLoader,\n} from '@openedx/frontend-base';\n\nimport { acaCheckoutRole } from './constants';\n\n/**\n * LMS JWT cookies are host-bound to localhost:18000. On https://localhost or an\n * ngrok tunnel they are missing, so authenticatedLoader sends you to LMS login\n * → usually /dashboard. DEV_MOCK_SESSION covers Viax tokens for that case.\n *\n * Do not use getAppConfig() here — app configs are registered after the router\n * is created, so the first loader pass often sees an empty config and still\n * redirects. Use the request hostname instead.\n */\nconst shouldSkipLmsCookieAuth = (requestUrl: string): boolean => {\n const { hostname } = new URL(requestUrl);\n return hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname.endsWith('.ngrok-free.app')\n || hostname.endsWith('.ngrok-free.dev')\n || hostname.endsWith('.ngrok.app')\n || hostname.endsWith('.ngrok.io');\n};\n\nconst protectedLoader = async (args) => {\n if (!shouldSkipLmsCookieAuth(args.request.url)) {\n await authenticatedLoader(args);\n }\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.template.main.aca-checkout',\n path: 'aca-checkout',\n loader: protectedLoader,\n handle: {\n roles: [acaCheckoutRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"template-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"CheckoutPage\" */ './checkoutPage/CheckoutPage'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n {\n id: 'org.openedx.frontend.route.template.main.aca-order-history',\n path: 'aca-order-history',\n loader: protectedLoader,\n handle: {\n roles: [acaCheckoutRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"template-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"OrderHistory\" */ './components/OrderHistory/OrderHistory'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n {\n id: 'org.openedx.frontend.route.template.main.aca-order-details',\n path: 'aca-order-details/:orderId',\n loader: protectedLoader,\n handle: {\n roles: [acaCheckoutRole],\n },\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"template-main\" */ './Main'\n );\n return { Component: module.default };\n },\n children: [\n {\n index: true,\n async lazy() {\n const module = await import(\n /* webpackChunkName: \"OrderHistoryDetails\" */ './components/OrderHistory/OrderHistoryDetails'\n );\n return { Component: module.default };\n },\n },\n ],\n },\n];\n\nexport default routes;\n"]}
@@ -11,4 +11,8 @@
11
11
  &__link {
12
12
  color: #002B2B;
13
13
  }
14
+ }
15
+
16
+ .divider {
17
+ border-top: 1px solid #002B2B;
14
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-alacarte-checkout",
3
- "version": "1.35.0",
3
+ "version": "1.36.0",
4
4
  "description": "alacarte Checkout Frontend application",
5
5
  "repository": {
6
6
  "type": "git",