@edx/frontend-app-subscription-manage 1.3.2 → 1.5.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/app.js +2 -2
- package/dist/app.js.map +1 -1
- package/dist/components/ActiveSubscription/ActiveSubscription.d.ts +7 -0
- package/dist/components/ActiveSubscription/ActiveSubscription.js +24 -0
- package/dist/components/ActiveSubscription/ActiveSubscription.js.map +1 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.d.ts +7 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.js +19 -0
- package/dist/components/BecomeSubscriber/BecomeSubscriber.js.map +1 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.d.ts +12 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.js +21 -0
- package/dist/components/CancelConfirmation/CancelConfirmation.js.map +1 -0
- package/dist/components/CancelSuccess/CancelSuccess.d.ts +7 -0
- package/dist/components/CancelSuccess/CancelSuccess.js +17 -0
- package/dist/components/CancelSuccess/CancelSuccess.js.map +1 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.d.ts +13 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.js +27 -0
- package/dist/components/CanceledSubscription/CanceledSubscription.js.map +1 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.d.ts +8 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js +19 -0
- package/dist/components/EnrolledCoursesList/EnrolledCoursesList.js.map +1 -0
- package/dist/components/HelpFooter/HelpFooter.d.ts +3 -0
- package/dist/components/HelpFooter/HelpFooter.js +12 -0
- package/dist/components/HelpFooter/HelpFooter.js.map +1 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.d.ts +3 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js +9 -0
- package/dist/components/OrderHistoryHeader/OrderHistoryHeader.js.map +1 -0
- package/dist/components/PaymentHistory/PaymentHistory.d.ts +10 -0
- package/dist/components/PaymentHistory/PaymentHistory.js +23 -0
- package/dist/components/PaymentHistory/PaymentHistory.js.map +1 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.d.ts +17 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js +63 -0
- package/dist/components/RenewSubscriptionModal/RenewSubscriptionModal.js.map +1 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.d.ts +9 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.js +25 -0
- package/dist/components/ResubscribeCard/ResubscribeCard.js.map +1 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.d.ts +8 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.js +9 -0
- package/dist/components/SubscriptionTabs/SubscriptionTabs.js.map +1 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.d.ts +9 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js +135 -0
- package/dist/components/UpdatePaymentMethodModal/UpdatePaymentMethodModal.js.map +1 -0
- package/dist/components/messages.d.ts +473 -0
- package/dist/components/messages.js +482 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/constants.d.ts +14 -56
- package/dist/constants.js +23 -272
- package/dist/constants.js.map +1 -1
- package/dist/data/hooks/keys.d.ts +8 -13
- package/dist/data/hooks/keys.js +8 -13
- package/dist/data/hooks/keys.js.map +1 -1
- package/dist/data/hooks/useManageQueries.d.ts +37 -0
- package/dist/data/hooks/useManageQueries.js +206 -0
- package/dist/data/hooks/useManageQueries.js.map +1 -0
- package/dist/data/services/subs/urls.d.ts +2 -2
- package/dist/data/services/subs/urls.js.map +1 -1
- package/dist/data/services/subscription/cancelSubscription.d.ts +6 -0
- package/dist/data/services/subscription/cancelSubscription.js +31 -0
- package/dist/data/services/subscription/cancelSubscription.js.map +1 -0
- package/dist/data/services/subscription/getBillingPlans.d.ts +3 -0
- package/dist/{utils/fetchBillingPlans.js → data/services/subscription/getBillingPlans.js} +10 -21
- package/dist/data/services/subscription/getBillingPlans.js.map +1 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.d.ts +3 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.js +37 -0
- package/dist/data/services/subscription/getIsCurrentUserSubscriber.js.map +1 -0
- package/dist/data/services/subscription/getPaymentHistory.d.ts +6 -0
- package/dist/data/services/subscription/getPaymentHistory.js +65 -0
- package/dist/data/services/subscription/getPaymentHistory.js.map +1 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.d.ts +7 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.js +88 -0
- package/dist/data/services/subscription/getSubscriptionEnrollments.js.map +1 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.d.ts +8 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.js +42 -0
- package/dist/data/services/subscription/getSubscriptionPaymentMethod.js.map +1 -0
- package/dist/data/services/subscription/reactivateSubscription.d.ts +6 -0
- package/dist/data/services/subscription/reactivateSubscription.js +30 -0
- package/dist/data/services/subscription/reactivateSubscription.js.map +1 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.d.ts +10 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.js +31 -0
- package/dist/data/services/subscription/updateSubscriptionPaymentMethod.js.map +1 -0
- package/dist/icons/ExternalLinkIcon.d.ts +6 -0
- package/dist/icons/ExternalLinkIcon.js +18 -0
- package/dist/icons/ExternalLinkIcon.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.js +53 -0
- package/dist/manageSubscriptionPage/CancelSubscriptionPage.js.map +1 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.js +24 -0
- package/dist/manageSubscriptionPage/CancelSuccessPage.js.map +1 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.d.ts +3 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.js +87 -0
- package/dist/manageSubscriptionPage/ManageSubscriptionPage.js.map +1 -0
- package/dist/messages.js +2 -2
- package/dist/messages.js.map +1 -1
- package/dist/routes.d.ts +9 -2
- package/dist/routes.js +26 -6
- package/dist/routes.js.map +1 -1
- package/dist/style.scss +1 -14
- package/dist/styles/components/manageSubscription.scss +454 -0
- package/dist/types.d.ts +61 -201
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/billingDetails.d.ts +3 -20
- package/dist/utils/billingDetails.js +4 -25
- package/dist/utils/billingDetails.js.map +1 -1
- package/dist/utils/edxSession.d.ts +18 -0
- package/dist/utils/edxSession.js +72 -0
- package/dist/utils/edxSession.js.map +1 -0
- package/dist/utils/formatDate.d.ts +16 -0
- package/dist/utils/formatDate.js +69 -0
- package/dist/utils/formatDate.js.map +1 -0
- package/dist/utils/graphqlClient.d.ts +9 -10
- package/dist/utils/graphqlClient.js +22 -11
- package/dist/utils/graphqlClient.js.map +1 -1
- package/dist/utils/invoiceAmount.d.ts +22 -0
- package/dist/utils/invoiceAmount.js +59 -0
- package/dist/utils/invoiceAmount.js.map +1 -0
- package/dist/utils/queries.d.ts +38 -33
- package/dist/utils/queries.js +85 -123
- package/dist/utils/queries.js.map +1 -1
- package/dist/utils/subscriptionView.d.ts +15 -0
- package/dist/utils/subscriptionView.js +50 -0
- package/dist/utils/subscriptionView.js.map +1 -0
- package/dist/utils/urls.d.ts +20 -0
- package/dist/utils/urls.js +76 -0
- package/dist/utils/urls.js.map +1 -0
- package/package.json +7 -2
- package/dist/checkoutPage/CheckoutPage.d.ts +0 -3
- package/dist/checkoutPage/CheckoutPage.js +0 -30
- package/dist/checkoutPage/CheckoutPage.js.map +0 -1
- package/dist/components/BrandMarks/BrandMarks.d.ts +0 -3
- package/dist/components/BrandMarks/BrandMarks.js +0 -9
- package/dist/components/BrandMarks/BrandMarks.js.map +0 -1
- package/dist/components/CartSummary/CartSummary.d.ts +0 -21
- package/dist/components/CartSummary/CartSummary.js +0 -30
- package/dist/components/CartSummary/CartSummary.js.map +0 -1
- package/dist/components/CartSummary/Messages.d.ts +0 -73
- package/dist/components/CartSummary/Messages.js +0 -76
- package/dist/components/CartSummary/Messages.js.map +0 -1
- package/dist/components/Checkout/Checkout.d.ts +0 -4
- package/dist/components/Checkout/Checkout.js +0 -40
- package/dist/components/Checkout/Checkout.js.map +0 -1
- package/dist/components/CheckoutGate/CheckoutGate.d.ts +0 -7
- package/dist/components/CheckoutGate/CheckoutGate.js +0 -35
- package/dist/components/CheckoutGate/CheckoutGate.js.map +0 -1
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.d.ts +0 -9
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js +0 -31
- package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js.map +0 -1
- package/dist/components/CourseEnrollmentCard/Messages.d.ts +0 -33
- package/dist/components/CourseEnrollmentCard/Messages.js +0 -35
- package/dist/components/CourseEnrollmentCard/Messages.js.map +0 -1
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.d.ts +0 -13
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js +0 -11
- package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js.map +0 -1
- package/dist/components/EnrollmentSummary/EnrollmentSummary.d.ts +0 -15
- package/dist/components/EnrollmentSummary/EnrollmentSummary.js +0 -21
- package/dist/components/EnrollmentSummary/EnrollmentSummary.js.map +0 -1
- package/dist/components/EnrollmentSummary/Messages.d.ts +0 -33
- package/dist/components/EnrollmentSummary/Messages.js +0 -35
- package/dist/components/EnrollmentSummary/Messages.js.map +0 -1
- package/dist/components/PaymentFields/PaymentFields.d.ts +0 -9
- package/dist/components/PaymentFields/PaymentFields.js +0 -7
- package/dist/components/PaymentFields/PaymentFields.js.map +0 -1
- package/dist/components/PaymentForm/Messages.d.ts +0 -88
- package/dist/components/PaymentForm/Messages.js +0 -95
- package/dist/components/PaymentForm/Messages.js.map +0 -1
- package/dist/components/PaymentForm/PaymentForm.d.ts +0 -21
- package/dist/components/PaymentForm/PaymentForm.js +0 -69
- package/dist/components/PaymentForm/PaymentForm.js.map +0 -1
- package/dist/components/StatusScreens/Messages.d.ts +0 -103
- package/dist/components/StatusScreens/Messages.js +0 -108
- package/dist/components/StatusScreens/Messages.js.map +0 -1
- package/dist/components/StatusScreens/StatusScreens.d.ts +0 -23
- package/dist/components/StatusScreens/StatusScreens.js +0 -25
- package/dist/components/StatusScreens/StatusScreens.js.map +0 -1
- package/dist/data/hooks/useCheckout.d.ts +0 -57
- package/dist/data/hooks/useCheckout.js +0 -249
- package/dist/data/hooks/useCheckout.js.map +0 -1
- package/dist/data/hooks/useCheckoutGate.d.ts +0 -15
- package/dist/data/hooks/useCheckoutGate.js +0 -39
- package/dist/data/hooks/useCheckoutGate.js.map +0 -1
- package/dist/data/hooks/useCheckoutMutations.d.ts +0 -16
- package/dist/data/hooks/useCheckoutMutations.js +0 -131
- package/dist/data/hooks/useCheckoutMutations.js.map +0 -1
- package/dist/data/hooks/useCheckoutQueries.d.ts +0 -30
- package/dist/data/hooks/useCheckoutQueries.js +0 -97
- package/dist/data/hooks/useCheckoutQueries.js.map +0 -1
- package/dist/styles/components/brandMarks.scss +0 -54
- package/dist/styles/components/cartSummary.scss +0 -18
- package/dist/styles/components/checkout.scss +0 -29
- package/dist/styles/components/checkoutStepper.scss +0 -9
- package/dist/styles/components/courseEnrollmentCard.scss +0 -38
- package/dist/styles/components/edxUnlimitedBanner.scss +0 -138
- package/dist/styles/components/enrollmentSummary.scss +0 -13
- package/dist/styles/components/paymentFields.scss +0 -15
- package/dist/styles/components/paymentForm.scss +0 -105
- package/dist/styles/components/statusScreens.scss +0 -29
- package/dist/styles/components/successScreen.scss +0 -0
- package/dist/utils/auth.d.ts +0 -7
- package/dist/utils/auth.js +0 -28
- package/dist/utils/auth.js.map +0 -1
- package/dist/utils/bootstrapApi.d.ts +0 -20
- package/dist/utils/bootstrapApi.js +0 -142
- package/dist/utils/bootstrapApi.js.map +0 -1
- package/dist/utils/cartApi.d.ts +0 -16
- package/dist/utils/cartApi.js +0 -118
- package/dist/utils/cartApi.js.map +0 -1
- package/dist/utils/checkout.d.ts +0 -6
- package/dist/utils/checkout.js +0 -28
- package/dist/utils/checkout.js.map +0 -1
- package/dist/utils/fetchActiveSubscriptions.d.ts +0 -4
- package/dist/utils/fetchActiveSubscriptions.js +0 -36
- package/dist/utils/fetchActiveSubscriptions.js.map +0 -1
- package/dist/utils/fetchBillingPlans.d.ts +0 -2
- package/dist/utils/fetchBillingPlans.js.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -17
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/provision.d.ts +0 -25
- package/dist/utils/provision.js +0 -95
- package/dist/utils/provision.js.map +0 -1
- package/dist/utils/stripe.d.ts +0 -7
- package/dist/utils/stripe.js +0 -43
- package/dist/utils/stripe.js.map +0 -1
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* query/useCheckoutQueries.ts — read-side TanStack Query hooks.
|
|
3
|
-
*
|
|
4
|
-
* useViaxSessionQuery runs on mount to exchange the edX session for a viax
|
|
5
|
-
* token. Billing plans and subscriber count wait until the session is ready.
|
|
6
|
-
*/
|
|
7
|
-
import { useQuery } from '@tanstack/react-query';
|
|
8
|
-
import { isTerminalStatus } from '../../constants';
|
|
9
|
-
import { checkoutKeys } from './keys';
|
|
10
|
-
import { fetchEdxSession, fetchUserCountry } from '../../utils/provision';
|
|
11
|
-
/** Exchange edX session cookies for a viax token on page load. */
|
|
12
|
-
export function useViaxSessionQuery(sessionUrl) {
|
|
13
|
-
return useQuery({
|
|
14
|
-
queryKey: checkoutKeys.viaxSession(),
|
|
15
|
-
enabled: !!sessionUrl,
|
|
16
|
-
queryFn: () => fetchEdxSession(sessionUrl),
|
|
17
|
-
staleTime: 5 * 60 * 1000,
|
|
18
|
-
retry: 1,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Fetches billing plans after the viax session is established.
|
|
23
|
-
* Used to display prices in CartSummary before the user starts checkout.
|
|
24
|
-
*/
|
|
25
|
-
export function useBillingPlansQuery(client, sessionReady) {
|
|
26
|
-
return useQuery({
|
|
27
|
-
queryKey: checkoutKeys.billingPlans(),
|
|
28
|
-
enabled: !!client && sessionReady,
|
|
29
|
-
queryFn: () => client.getBillingPlans(),
|
|
30
|
-
staleTime: Infinity,
|
|
31
|
-
retry: 2,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Fetches the live active subscriber count after the viax session is ready.
|
|
36
|
-
* Refreshes every 5 minutes so the number stays roughly current.
|
|
37
|
-
*/
|
|
38
|
-
export function useActiveSubscriptionsQuery(client, sessionReady) {
|
|
39
|
-
return useQuery({
|
|
40
|
-
queryKey: ['checkout', 'activeSubscriptions'],
|
|
41
|
-
enabled: !!client && sessionReady,
|
|
42
|
-
queryFn: () => client.getActiveSubscriptions(),
|
|
43
|
-
staleTime: 5 * 60 * 1000, // 5 minutes
|
|
44
|
-
retry: 1,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Fetches the user's country from their edX account profile.
|
|
49
|
-
* Derives the LMS base URL from the session URL (same origin).
|
|
50
|
-
* Returns null if the fetch fails or the field is absent — checkout stays open in that case.
|
|
51
|
-
*/
|
|
52
|
-
export function useUserCountryQuery(sessionUrl, username) {
|
|
53
|
-
return useQuery({
|
|
54
|
-
queryKey: ['checkout', 'userCountry', username],
|
|
55
|
-
enabled: !!sessionUrl && !!username,
|
|
56
|
-
queryFn: () => {
|
|
57
|
-
const lmsBaseUrl = new URL(sessionUrl).origin;
|
|
58
|
-
return fetchUserCountry(lmsBaseUrl, username);
|
|
59
|
-
},
|
|
60
|
-
staleTime: Infinity,
|
|
61
|
-
retry: 1,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
/** Polls the cart state machine every second; stops on terminal states. */
|
|
65
|
-
export function useCartStatusQuery(client, cartBiId) {
|
|
66
|
-
return useQuery({
|
|
67
|
-
queryKey: checkoutKeys.status(cartBiId !== null && cartBiId !== void 0 ? cartBiId : 'none'),
|
|
68
|
-
enabled: !!client && !!cartBiId,
|
|
69
|
-
queryFn: () => client.getCartStatus(cartBiId),
|
|
70
|
-
refetchInterval: (query) => { var _a, _b; return isTerminalStatus((_b = (_a = query.state.data) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : null) ? false : 1000; },
|
|
71
|
-
refetchOnWindowFocus: false,
|
|
72
|
-
gcTime: 0,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/** Looks up the created subscription biId after success. */
|
|
76
|
-
export function useSubscriptionIdQuery(client, cartBiId, enabled) {
|
|
77
|
-
return useQuery({
|
|
78
|
-
queryKey: checkoutKeys.subscriptionId(cartBiId !== null && cartBiId !== void 0 ? cartBiId : 'none'),
|
|
79
|
-
enabled: enabled && !!client && !!cartBiId,
|
|
80
|
-
queryFn: () => client.findSubscriptionBiId(cartBiId),
|
|
81
|
-
staleTime: Infinity,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Fetches course details when the user arrived via ?course_run_key=.
|
|
86
|
-
* Skipped entirely when no course key is present (standard checkout).
|
|
87
|
-
*/
|
|
88
|
-
export function useCourseDetailQuery(client, sessionReady, courseRunKey) {
|
|
89
|
-
return useQuery({
|
|
90
|
-
queryKey: checkoutKeys.courseDetail(courseRunKey !== null && courseRunKey !== void 0 ? courseRunKey : 'none'),
|
|
91
|
-
enabled: !!client && sessionReady && !!courseRunKey,
|
|
92
|
-
queryFn: () => client.getCourseDetail(courseRunKey),
|
|
93
|
-
staleTime: Infinity,
|
|
94
|
-
retry: 1,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=useCheckoutQueries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckoutQueries.js","sourceRoot":"","sources":["../../../src/data/hooks/useCheckoutQueries.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * query/useCheckoutQueries.ts — read-side TanStack Query hooks.\n *\n * useViaxSessionQuery runs on mount to exchange the edX session for a viax\n * token. Billing plans and subscriber count wait until the session is ready.\n */\nimport { useQuery } from '@tanstack/react-query';\nimport { isTerminalStatus } from '../../constants';\nimport { checkoutKeys } from './keys';\nimport { fetchEdxSession, fetchUserCountry } from '../../utils/provision';\nimport type { CheckoutClient, CartStatusResult, BillingPlansResult, CourseDetail } from '../../types';\n\n/** Exchange edX session cookies for a viax token on page load. */\nexport function useViaxSessionQuery(sessionUrl: string | null) {\n return useQuery({\n queryKey: checkoutKeys.viaxSession(),\n enabled: !!sessionUrl,\n queryFn: () => fetchEdxSession(sessionUrl!),\n staleTime: 5 * 60 * 1000,\n retry: 1,\n });\n}\n\n/**\n * Fetches billing plans after the viax session is established.\n * Used to display prices in CartSummary before the user starts checkout.\n */\nexport function useBillingPlansQuery(client: CheckoutClient | null, sessionReady: boolean) {\n return useQuery({\n queryKey: checkoutKeys.billingPlans(),\n enabled: !!client && sessionReady,\n queryFn: (): Promise<BillingPlansResult> => client!.getBillingPlans(),\n staleTime: Infinity,\n retry: 2,\n });\n}\n\n/**\n * Fetches the live active subscriber count after the viax session is ready.\n * Refreshes every 5 minutes so the number stays roughly current.\n */\nexport function useActiveSubscriptionsQuery(client: CheckoutClient | null, sessionReady: boolean) {\n return useQuery({\n queryKey: ['checkout', 'activeSubscriptions'],\n enabled: !!client && sessionReady,\n queryFn: () => client!.getActiveSubscriptions(),\n staleTime: 5 * 60 * 1000, // 5 minutes\n retry: 1,\n });\n}\n\n/**\n * Fetches the user's country from their edX account profile.\n * Derives the LMS base URL from the session URL (same origin).\n * Returns null if the fetch fails or the field is absent — checkout stays open in that case.\n */\nexport function useUserCountryQuery(sessionUrl: string | null, username: string | null) {\n return useQuery({\n queryKey: ['checkout', 'userCountry', username],\n enabled: !!sessionUrl && !!username,\n queryFn: () => {\n const lmsBaseUrl = new URL(sessionUrl!).origin;\n return fetchUserCountry(lmsBaseUrl, username!);\n },\n staleTime: Infinity,\n retry: 1,\n });\n}\n\n/** Polls the cart state machine every second; stops on terminal states. */\nexport function useCartStatusQuery(client: CheckoutClient | null, cartBiId: string | null) {\n return useQuery({\n queryKey: checkoutKeys.status(cartBiId ?? 'none'),\n enabled: !!client && !!cartBiId,\n queryFn: (): Promise<CartStatusResult> => client!.getCartStatus(cartBiId!),\n refetchInterval: (query) =>\n isTerminalStatus(query.state.data?.status ?? null) ? false : 1000,\n refetchOnWindowFocus: false,\n gcTime: 0,\n });\n}\n\n/** Looks up the created subscription biId after success. */\nexport function useSubscriptionIdQuery(\n client: CheckoutClient | null,\n cartBiId: string | null,\n enabled: boolean,\n) {\n return useQuery({\n queryKey: checkoutKeys.subscriptionId(cartBiId ?? 'none'),\n enabled: enabled && !!client && !!cartBiId,\n queryFn: () => client!.findSubscriptionBiId(cartBiId!),\n staleTime: Infinity,\n });\n}\n\n/**\n * Fetches course details when the user arrived via ?course_run_key=.\n * Skipped entirely when no course key is present (standard checkout).\n */\nexport function useCourseDetailQuery(\n client: CheckoutClient | null,\n sessionReady: boolean,\n courseRunKey: string | null,\n) {\n return useQuery({\n queryKey: checkoutKeys.courseDetail(courseRunKey ?? 'none'),\n enabled: !!client && sessionReady && !!courseRunKey,\n queryFn: (): Promise<CourseDetail | null> => client!.getCourseDetail(courseRunKey!),\n staleTime: Infinity,\n retry: 1,\n });\n}\n"]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
.brand-marks {
|
|
2
|
-
&__card-brands {
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
flex-shrink: 0;
|
|
6
|
-
gap: 4px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&__paypal {
|
|
10
|
-
font-family: Arial, sans-serif;
|
|
11
|
-
font-weight: 700;
|
|
12
|
-
font-style: italic;
|
|
13
|
-
font-size: 1.05rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&__paypal-pay {
|
|
17
|
-
color: #003087;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&__paypal-pal {
|
|
21
|
-
color: #009cde;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&__edx-logo {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
flex-shrink: 0;
|
|
29
|
-
width: 56px;
|
|
30
|
-
height: 40px;
|
|
31
|
-
border-radius: 6px;
|
|
32
|
-
background: #1f1f1f;
|
|
33
|
-
line-height: 1;
|
|
34
|
-
margin-right: 0.75rem;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&__edx-logo-text {
|
|
38
|
-
text-align: center;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&__edx-logo-edx {
|
|
42
|
-
color: #fff;
|
|
43
|
-
font-weight: 800;
|
|
44
|
-
font-size: 0.8rem;
|
|
45
|
-
letter-spacing: -0.02em;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&__edx-logo-unlimited {
|
|
49
|
-
color: #b1c2ff;
|
|
50
|
-
font-size: 0.5rem;
|
|
51
|
-
font-weight: 600;
|
|
52
|
-
margin-top: 1px;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// styles/components/cartSummary.scss
|
|
2
|
-
|
|
3
|
-
.cart-summary {
|
|
4
|
-
// No background — inherits the page background (off-white in the design)
|
|
5
|
-
background: transparent;
|
|
6
|
-
|
|
7
|
-
&__stats {
|
|
8
|
-
display: flex;
|
|
9
|
-
gap: 1.5rem;
|
|
10
|
-
margin-top: 1rem;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&__stat {
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
gap: 0.5rem;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
div.checkout__container {
|
|
2
|
-
padding-inline: 1.125rem; /* 18px */
|
|
3
|
-
padding-block: 3rem; /* 48px */
|
|
4
|
-
div.payment__options {
|
|
5
|
-
> div {
|
|
6
|
-
padding: 32px;
|
|
7
|
-
background-color: white;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@media (--pgn-size-breakpoint-min-width-lg) {
|
|
13
|
-
div.checkout__container {
|
|
14
|
-
padding:0;
|
|
15
|
-
div.payment__options {
|
|
16
|
-
background-color: var(--pgn-color-light-100);
|
|
17
|
-
> div {
|
|
18
|
-
padding: 32px 32px 64px 32px;
|
|
19
|
-
background-color: transparent;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
div.payment__summary {
|
|
23
|
-
padding: 48px 48px 32px 48px;
|
|
24
|
-
}
|
|
25
|
-
div.gap-5 {
|
|
26
|
-
gap: 0 !important;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.course-enrollment-card {
|
|
2
|
-
margin-top: 1.25rem;
|
|
3
|
-
padding: 1rem;
|
|
4
|
-
background: var(--pgn-color-white, #fff);
|
|
5
|
-
border: 1px solid var(--pgn-color-light-400, #e5e5e5);
|
|
6
|
-
border-radius: var(--pgn-size-border-radius-base, 0.375rem);
|
|
7
|
-
|
|
8
|
-
&__image {
|
|
9
|
-
display: block;
|
|
10
|
-
width: 4.5rem;
|
|
11
|
-
height: 3.25rem;
|
|
12
|
-
object-fit: cover;
|
|
13
|
-
border-radius: 0.25rem;
|
|
14
|
-
background: var(--pgn-color-light-300, #f2f2f2);
|
|
15
|
-
|
|
16
|
-
&--placeholder {
|
|
17
|
-
background:
|
|
18
|
-
linear-gradient(
|
|
19
|
-
to top right,
|
|
20
|
-
transparent calc(50% - 1px),
|
|
21
|
-
var(--pgn-color-light-500, #c2c2c2) 50%,
|
|
22
|
-
transparent calc(50% + 1px)
|
|
23
|
-
),
|
|
24
|
-
linear-gradient(
|
|
25
|
-
to top left,
|
|
26
|
-
transparent calc(50% - 1px),
|
|
27
|
-
var(--pgn-color-light-500, #c2c2c2) 50%,
|
|
28
|
-
transparent calc(50% + 1px)
|
|
29
|
-
),
|
|
30
|
-
var(--pgn-color-light-300, #f2f2f2);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__copy {
|
|
35
|
-
color: var(--pgn-color-gray-900, #212529);
|
|
36
|
-
line-height: 1.4;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.edx-banner {
|
|
3
|
-
background: #0a1628;
|
|
4
|
-
border-radius: 10px;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: stretch;
|
|
8
|
-
min-height: 120px;
|
|
9
|
-
position: relative;
|
|
10
|
-
|
|
11
|
-
&__content {
|
|
12
|
-
flex: 1 1 0;
|
|
13
|
-
padding: 28px 32px 28px 28px;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
gap: 10px;
|
|
18
|
-
z-index: 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&__eyebrow {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&__headline {
|
|
27
|
-
margin: 0;
|
|
28
|
-
color: #fff;
|
|
29
|
-
font-size: clamp(1.1rem, 2.2vw, 1.55rem);
|
|
30
|
-
font-weight: 700;
|
|
31
|
-
line-height: 1.25;
|
|
32
|
-
letter-spacing: -0.01em;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&__body {
|
|
36
|
-
margin: 0;
|
|
37
|
-
color: rgba(255, 255, 255, 0.78);
|
|
38
|
-
font-size: clamp(0.78rem, 1.3vw, 0.88rem);
|
|
39
|
-
line-height: 1.55;
|
|
40
|
-
max-width: 540px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&__cta-wrapper {
|
|
44
|
-
margin-top: 4px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&__cta {
|
|
48
|
-
display: inline-block;
|
|
49
|
-
background: #e2522a;
|
|
50
|
-
color: #fff;
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
font-size: 0.82rem;
|
|
53
|
-
padding: 9px 20px;
|
|
54
|
-
border-radius: 6px;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
letter-spacing: 0.01em;
|
|
57
|
-
transition: background 0.15s;
|
|
58
|
-
white-space: nowrap;
|
|
59
|
-
|
|
60
|
-
&:hover {
|
|
61
|
-
background: #c94420;
|
|
62
|
-
color: #fff;
|
|
63
|
-
text-decoration: none;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&__bullet {
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
width: 28px;
|
|
72
|
-
height: 28px;
|
|
73
|
-
border-radius: 50%;
|
|
74
|
-
background: rgba(255, 255, 255, 0.15);
|
|
75
|
-
flex-shrink: 0;
|
|
76
|
-
margin-right: 10px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&__badge {
|
|
80
|
-
display: inline-flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
gap: 0;
|
|
83
|
-
vertical-align: middle;
|
|
84
|
-
position: relative;
|
|
85
|
-
top: -2px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&__badge-edx {
|
|
89
|
-
background: #fff;
|
|
90
|
-
border-radius: 4px 0 0 4px;
|
|
91
|
-
padding: 2px 5px 2px 6px;
|
|
92
|
-
font-weight: 800;
|
|
93
|
-
font-size: 0.78em;
|
|
94
|
-
letter-spacing: -0.02em;
|
|
95
|
-
color: #000;
|
|
96
|
-
line-height: 1.15;
|
|
97
|
-
font-style: normal;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
&__badge-unlimited {
|
|
101
|
-
background: #000;
|
|
102
|
-
border-radius: 0 4px 4px 0;
|
|
103
|
-
padding: 2px 6px 2px 4px;
|
|
104
|
-
font-weight: 600;
|
|
105
|
-
font-size: 0.64em;
|
|
106
|
-
letter-spacing: 0.02em;
|
|
107
|
-
color: #c5b8ff;
|
|
108
|
-
line-height: 1.15;
|
|
109
|
-
font-style: normal;
|
|
110
|
-
text-transform: lowercase;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&__photo {
|
|
114
|
-
flex-shrink: 0;
|
|
115
|
-
width: clamp(120px, 22%, 240px);
|
|
116
|
-
position: relative;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
|
|
119
|
-
img {
|
|
120
|
-
position: absolute;
|
|
121
|
-
inset: 0;
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: 100%;
|
|
124
|
-
object-fit: cover;
|
|
125
|
-
object-position: center top;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
&__placeholder {
|
|
131
|
-
flex-shrink: 0;
|
|
132
|
-
width: clamp(100px, 20%, 200px);
|
|
133
|
-
background: rgba(255, 255, 255, 0.06);
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: center;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
.enrolled__banner {
|
|
2
|
-
div:first-child {
|
|
3
|
-
border-top-left-radius: var(--pgn-size-border-radius-base);
|
|
4
|
-
border-top-right-radius: var(--pgn-size-border-radius-base);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
div:last-child {
|
|
8
|
-
border: 1px solid var(--pgn-color-light-400);
|
|
9
|
-
border-top: 0;
|
|
10
|
-
border-bottom-left-radius: var(--pgn-size-border-radius-base);
|
|
11
|
-
border-bottom-right-radius: var(--pgn-size-border-radius-base);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.payment--field {
|
|
2
|
-
.card__expiry,
|
|
3
|
-
.card__cvc {
|
|
4
|
-
width: 10.75rem;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.form-control {
|
|
8
|
-
border-radius: 5px;
|
|
9
|
-
border: 1px solid #E6E6E6;
|
|
10
|
-
background: #FFF;
|
|
11
|
-
|
|
12
|
-
/* default/box-shadow-default */
|
|
13
|
-
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.02), 0 1px 1px 0 rgba(0, 0, 0, 0.03);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// styles/components/paymentForm.scss
|
|
2
|
-
|
|
3
|
-
.payment-form {
|
|
4
|
-
&__heading {
|
|
5
|
-
font-size: 1.1rem;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
&__help {
|
|
9
|
-
a {
|
|
10
|
-
text-decoration: underline;
|
|
11
|
-
text-underline-offset: 0.2rem;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// ── Payment method accordion ─────────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
&__method {
|
|
18
|
-
border-radius: 8px;
|
|
19
|
-
border: 1px solid #E7E9EF;
|
|
20
|
-
background: #FFF;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
background: #F6F8FA;
|
|
23
|
-
&--selected {
|
|
24
|
-
background-color: white;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Header row: radio + icon(s) + name — full-width clickable label
|
|
29
|
-
&__method-header {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
gap: 0.6rem;
|
|
33
|
-
padding: 0.9rem 1rem;
|
|
34
|
-
margin: 0;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
width: 100%;
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
font-size: 0.95rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&__radio {
|
|
42
|
-
flex-shrink: 0;
|
|
43
|
-
width: 1.1rem;
|
|
44
|
-
height: 1.1rem;
|
|
45
|
-
accent-color: #000000;
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&__method-name {
|
|
50
|
-
flex: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Expanded card panel — no extra heading, just fields
|
|
54
|
-
&__card-panel {
|
|
55
|
-
padding: 0 1rem 1rem;
|
|
56
|
-
background: #fff;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Icon badges for Google Pay / PayPal
|
|
60
|
-
&__method-icon {
|
|
61
|
-
display: inline-flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
width: 1.5rem;
|
|
65
|
-
height: 1.5rem;
|
|
66
|
-
border-radius: 4px;
|
|
67
|
-
color: #fff;
|
|
68
|
-
font-weight: 800;
|
|
69
|
-
font-size: 0.7rem;
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
|
|
72
|
-
&--gpay {
|
|
73
|
-
background: #4285f4;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&--paypal {
|
|
77
|
-
background: #003087;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.payment__field--country {
|
|
82
|
-
select {
|
|
83
|
-
border-radius: 5px;
|
|
84
|
-
border: 1px solid #E6E6E6;
|
|
85
|
-
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.02), 0 1px 1px 0 rgba(0, 0, 0, 0.03);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// ── Submit button ────────────────────────────────────────────────────────
|
|
90
|
-
&__submit {
|
|
91
|
-
border-radius: 2rem;
|
|
92
|
-
font-weight: 700;
|
|
93
|
-
padding: 0.75rem 1.5rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&__terms {
|
|
97
|
-
line-height: 1.6;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@media (--pgn-size-breakpoint-min-width-lg) {
|
|
102
|
-
.payment-form {
|
|
103
|
-
padding: 32px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// styles/components/successScreen.scss
|
|
2
|
-
|
|
3
|
-
.success-screen {
|
|
4
|
-
&__headline {
|
|
5
|
-
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
|
6
|
-
color: #1a3a2a; // dark green as in design
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&__ctas {
|
|
10
|
-
flex-wrap: wrap;
|
|
11
|
-
gap: 0.75rem;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&__cta-primary {
|
|
15
|
-
border-radius: 2rem;
|
|
16
|
-
font-weight: 700;
|
|
17
|
-
padding: 0.65rem 1.5rem;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&__benefits {
|
|
21
|
-
list-style: disc;
|
|
22
|
-
padding-left: 1.25rem;
|
|
23
|
-
|
|
24
|
-
li {
|
|
25
|
-
color: var(--gray-700, #495057);
|
|
26
|
-
line-height: 1.6;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
File without changes
|
package/dist/utils/auth.d.ts
DELETED
package/dist/utils/auth.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* api/index.ts — composes the pieces into a single checkout client and
|
|
3
|
-
* re-exports the API utilities.
|
|
4
|
-
*/
|
|
5
|
-
import { createGqlClient } from './graphqlClient';
|
|
6
|
-
import * as cart from './cartApi';
|
|
7
|
-
import * as bootstrap from './bootstrapApi';
|
|
8
|
-
export function createCheckoutClient({ apiUrl }) {
|
|
9
|
-
const { gql, setToken } = createGqlClient({ apiUrl });
|
|
10
|
-
const fetchStatus = (biId) => cart.getCartStatus(gql, biId);
|
|
11
|
-
return {
|
|
12
|
-
gql,
|
|
13
|
-
setToken,
|
|
14
|
-
createCart: (vars) => cart.createCart(gql, vars),
|
|
15
|
-
getCartItem: (biId) => cart.getCartItem(gql, biId),
|
|
16
|
-
updateCartItem: (args) => cart.updateCartItem(gql, args),
|
|
17
|
-
updateCartConsent: (args) => cart.updateCartConsent(gql, args),
|
|
18
|
-
placeOrder: (cartUid) => cart.placeOrder(gql, cartUid),
|
|
19
|
-
getCartStatus: fetchStatus,
|
|
20
|
-
findSubscriptionBiId: (biId) => cart.findSubscriptionBiId(gql, biId),
|
|
21
|
-
getSalableUid: (maId) => bootstrap.getSalableUid(gql, maId),
|
|
22
|
-
getBillingPlans: () => bootstrap.getBillingPlans(gql),
|
|
23
|
-
getActiveSubscriptions: () => bootstrap.getActiveSubscriptions(gql),
|
|
24
|
-
isCurrentUserSubscriber: () => bootstrap.isCurrentUserSubscriber(gql),
|
|
25
|
-
getCourseDetail: (courseKey) => bootstrap.getCourseDetail(gql, courseKey),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=auth.js.map
|
package/dist/utils/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/utils/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAU5C,MAAM,UAAU,oBAAoB,CAClC,EAAE,MAAM,EAAwB;IAEhC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEpE,OAAO;QACL,GAAG;QACH,QAAQ;QACR,UAAU,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;QACzD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC;QAClD,cAAc,EAAE,CAAC,IAAwB,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC;QAC5E,iBAAiB,EAAE,CAAC,IAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC;QACrF,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;QACtD,aAAa,EAAE,WAAW;QAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC;QACpE,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC;QAC3D,eAAe,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC;QACrD,sBAAsB,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,GAAG,CAAC;QACnE,uBAAuB,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC;QACrE,eAAe,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC;KAC1E,CAAC;AACJ,CAAC","sourcesContent":["/**\n * api/index.ts — composes the pieces into a single checkout client and\n * re-exports the API utilities.\n */\nimport { createGqlClient } from './graphqlClient';\nimport * as cart from './cartApi';\nimport * as bootstrap from './bootstrapApi';\nimport type {\n CheckoutClient, CartIds, UpdateCartItemArgs, UpdateCartConsentArgs,\n} from '../types';\n\ninterface CheckoutClientConfig {\n apiUrl: string,\n confirmIntentUrl?: string,\n}\n\nexport function createCheckoutClient(\n { apiUrl }: CheckoutClientConfig,\n): CheckoutClient {\n const { gql, setToken } = createGqlClient({ apiUrl });\n const fetchStatus = (biId: string) => cart.getCartStatus(gql, biId);\n\n return {\n gql,\n setToken,\n createCart: (vars: CartIds) => cart.createCart(gql, vars),\n getCartItem: (biId) => cart.getCartItem(gql, biId),\n updateCartItem: (args: UpdateCartItemArgs) => cart.updateCartItem(gql, args),\n updateCartConsent: (args: UpdateCartConsentArgs) => cart.updateCartConsent(gql, args),\n placeOrder: (cartUid) => cart.placeOrder(gql, cartUid),\n getCartStatus: fetchStatus,\n findSubscriptionBiId: (biId) => cart.findSubscriptionBiId(gql, biId),\n getSalableUid: (maId) => bootstrap.getSalableUid(gql, maId),\n getBillingPlans: () => bootstrap.getBillingPlans(gql),\n getActiveSubscriptions: () => bootstrap.getActiveSubscriptions(gql),\n isCurrentUserSubscriber: () => bootstrap.isCurrentUserSubscriber(gql),\n getCourseDetail: (courseKey) => bootstrap.getCourseDetail(gql, courseKey),\n };\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { GqlRunner, BillingPlansResult, ProductInfo, CurrentUserSubscriberResult, CourseDetail } from '../types';
|
|
2
|
-
/** Resolve the viax customer uid for the authenticated user by email. */
|
|
3
|
-
export declare function getCustomerUid(gql: GqlRunner, userEmail: string): Promise<string>;
|
|
4
|
-
/**
|
|
5
|
-
* Fetch the TwouSubscriptionPlan uid to use as biiSalable in createTwouCart.
|
|
6
|
-
* The maId is the product market-area identifier, e.g. "TWOU-SUB-PLAN-001".
|
|
7
|
-
* The returned `uid` is passed as biiSalable when creating the cart.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getSalableUid(gql: GqlRunner, maId: string): Promise<ProductInfo>;
|
|
10
|
-
/** Fetch all available customer billing plans. */
|
|
11
|
-
export declare function getBillingPlans(gql: GqlRunner): Promise<BillingPlansResult>;
|
|
12
|
-
/** Check whether the currently authenticated user already has an active subscription. */
|
|
13
|
-
export declare function isCurrentUserSubscriber(gql: GqlRunner): Promise<CurrentUserSubscriberResult | null>;
|
|
14
|
-
/** Fetch the number of active subscriptions. */
|
|
15
|
-
export declare function getActiveSubscriptions(gql: GqlRunner): Promise<{
|
|
16
|
-
active: number;
|
|
17
|
-
}>;
|
|
18
|
-
/** Fetch course details for the enrollment card by tCourseKey.
|
|
19
|
-
* Sends the course key to Viax exactly as provided (e.g. HarvardX+CS50+X). */
|
|
20
|
-
export declare function getCourseDetail(gql: GqlRunner, courseKey: string): Promise<CourseDetail | null>;
|