@burdenoff/microfe-billing 2026.522.1 → 2026.525.1
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/billing/modules/checkout/components/RazorpayPaymentButton.js +58 -88
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/package.json +1 -1
- package/dist/billing/BillingAdminRoutes.d.ts +0 -6
- package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
- package/dist/billing/BillingRoot.d.ts +0 -37
- package/dist/billing/BillingRoot.d.ts.map +0 -1
- package/dist/billing/BillingUserRoutes.d.ts +0 -7
- package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
- package/dist/billing/constants/permissions.d.ts +0 -18
- package/dist/billing/constants/permissions.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -36
- package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -8
- package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts +0 -30
- package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts +0 -106
- package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -14
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
- package/dist/billing/index.d.ts +0 -31
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/lib/native-purchases.d.ts +0 -51
- package/dist/billing/lib/native-purchases.d.ts.map +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -4
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
- package/dist/billing/modules/addons/components/index.d.ts +0 -5
- package/dist/billing/modules/addons/components/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/index.d.ts +0 -6
- package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -55
- package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
- package/dist/billing/modules/addons/index.d.ts +0 -7
- package/dist/billing/modules/addons/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -4
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/index.d.ts +0 -11
- package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -38
- package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/api.d.ts +0 -101
- package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/index.d.ts +0 -2
- package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -4
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/index.d.ts +0 -5
- package/dist/billing/modules/analytics/index.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -4
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/index.d.ts +0 -5
- package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/index.d.ts +0 -10
- package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -68
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -62
- package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -191
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -41
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
- package/dist/billing/modules/billing/index.d.ts +0 -7
- package/dist/billing/modules/billing/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -4
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -4
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -4
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -4
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -4
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/index.d.ts +0 -10
- package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -14
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -14
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -14
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -14
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -16
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -19
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -14
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -22
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -19
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -19
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -25
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -13
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -13
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -16
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -26
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -23
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/index.d.ts +0 -20
- package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/graphql/index.d.ts +0 -6
- package/dist/billing/modules/checkout/graphql/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/index.d.ts +0 -9
- package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -69
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -26
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -19
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -59
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
- package/dist/billing/modules/checkout/index.d.ts +0 -24
- package/dist/billing/modules/checkout/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -4
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/index.d.ts +0 -5
- package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/types/index.d.ts +0 -270
- package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -20
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
- package/dist/billing/modules/coupons/index.d.ts +0 -5
- package/dist/billing/modules/coupons/index.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -4
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -4
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -4
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -4
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/index.d.ts +0 -8
- package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/index.d.ts +0 -5
- package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -75
- package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
- package/dist/billing/modules/credits/index.d.ts +0 -6
- package/dist/billing/modules/credits/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -4
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -4
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -4
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -4
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/index.d.ts +0 -8
- package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -14
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -111
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -16
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -13
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -15
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -27
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/index.d.ts +0 -10
- package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -6
- package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -17
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -145
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/index.d.ts +0 -8
- package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -4
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts +0 -5
- package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/index.d.ts +0 -6
- package/dist/billing/modules/discounts/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -4
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/index.d.ts +0 -6
- package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/api.d.ts +0 -135
- package/dist/billing/modules/earnings/api.d.ts.map +0 -1
- package/dist/billing/modules/earnings/index.d.ts +0 -4
- package/dist/billing/modules/earnings/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -4
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -4
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -4
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/index.d.ts +0 -7
- package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -46
- package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -27
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/index.d.ts +0 -7
- package/dist/billing/modules/plans/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -4
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/index.d.ts +0 -11
- package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/index.d.ts +0 -6
- package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -102
- package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -39
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
- package/dist/billing/modules/quota/index.d.ts +0 -6
- package/dist/billing/modules/quota/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -4
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -4
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -4
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -4
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -4
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/index.d.ts +0 -9
- package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/settings/index.d.ts +0 -5
- package/dist/billing/modules/settings/index.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -4
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -4
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/index.d.ts +0 -6
- package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/store/graphql/index.d.ts +0 -6
- package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
- package/dist/billing/modules/store/index.d.ts +0 -6
- package/dist/billing/modules/store/index.d.ts.map +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -11
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -12
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -6
- package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -92
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/index.d.ts +0 -7
- package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -4
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -8
- package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/index.d.ts +0 -6
- package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -241
- package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
- package/dist/billing/modules/usage/index.d.ts +0 -6
- package/dist/billing/modules/usage/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -4
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/index.d.ts +0 -5
- package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
- package/dist/billing/providers/BillingProvider.d.ts +0 -16
- package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
- package/dist/billing/shared/components/AccessDenied.d.ts +0 -8
- package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -11
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/EmptyState.d.ts +0 -11
- package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -11
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts +0 -11
- package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
- package/dist/billing/shared/components/ServerError.d.ts +0 -11
- package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
- package/dist/billing/shared/components/StatCard.d.ts +0 -15
- package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
- package/dist/billing/shared/components/index.d.ts +0 -11
- package/dist/billing/shared/components/index.d.ts.map +0 -1
- package/dist/billing/shared/index.d.ts +0 -8
- package/dist/billing/shared/index.d.ts.map +0 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -928
- package/dist/billing/shared/types/graphql.d.ts.map +0 -1
- package/dist/billing/shared/types/index.d.ts +0 -96
- package/dist/billing/shared/types/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +0 -13
- package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +0 -13
- package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/error.d.ts +0 -30
- package/dist/billing/shared/utils/error.d.ts.map +0 -1
- package/dist/billing/shared/utils/format.d.ts +0 -28
- package/dist/billing/shared/utils/format.d.ts.map +0 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +0 -15
- package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/index.d.ts +0 -13
- package/dist/billing/shared/utils/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/navigation.d.ts +0 -2
- package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts +0 -18
- package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
- package/dist/billing/shared/utils/status.d.ts +0 -28
- package/dist/billing/shared/utils/status.d.ts.map +0 -1
- package/dist/billing/shared/utils/tokens.d.ts +0 -156
- package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
- package/dist/billing/types/index.d.ts +0 -268
- package/dist/billing/types/index.d.ts.map +0 -1
- package/dist/billing/utils/index.d.ts +0 -128
- package/dist/billing/utils/index.d.ts.map +0 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts +0 -9595
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts +0 -22485
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -61
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts +0 -49106
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts +0 -3
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1,162 +1,132 @@
|
|
|
1
1
|
import { getPaymentProviderThemeColor as e } from "../../../shared/utils/paymentTheme.js";
|
|
2
2
|
import "../../../shared/utils/index.js";
|
|
3
3
|
import { useCallback as t, useEffect as n, useState as r } from "react";
|
|
4
|
-
import { AlertCircle as i, Check as a,
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useI18n as
|
|
4
|
+
import { AlertCircle as i, Check as a, Loader2 as o, Lock as s } from "lucide-react";
|
|
5
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
7
|
//#region src/billing/modules/checkout/components/RazorpayPaymentButton.tsx
|
|
8
|
-
var
|
|
9
|
-
let { t:
|
|
10
|
-
let n =
|
|
8
|
+
var f = ({ orderId: f, keyId: p, amount: m, currency: h, name: g = "Burdenoff", description: _ = "Purchase", customerId: v, prefill: y, notes: b, onSuccess: x, onError: S, onCancel: C, disabled: w = !1 }) => {
|
|
9
|
+
let { t: T } = d(), E = (e, t) => {
|
|
10
|
+
let n = T(e);
|
|
11
11
|
return n === e ? t : n;
|
|
12
|
-
}, [
|
|
12
|
+
}, [D, O] = r("idle"), [k, A] = r(null), [j, M] = r(!1);
|
|
13
13
|
n(() => {
|
|
14
14
|
if (typeof window < "u" && !window.Razorpay) {
|
|
15
15
|
let e = document.createElement("script");
|
|
16
16
|
e.src = "https://checkout.razorpay.com/v1/checkout.js", e.async = !0, e.onload = () => {
|
|
17
|
-
|
|
17
|
+
M(!0);
|
|
18
18
|
}, e.onerror = () => {
|
|
19
|
-
|
|
19
|
+
A("Failed to load payment gateway");
|
|
20
20
|
}, document.body.appendChild(e);
|
|
21
|
-
} else window.Razorpay &&
|
|
21
|
+
} else window.Razorpay && M(!0);
|
|
22
22
|
}, []);
|
|
23
|
-
let
|
|
24
|
-
if (!
|
|
25
|
-
|
|
23
|
+
let N = t(() => {
|
|
24
|
+
if (!j || !window.Razorpay) {
|
|
25
|
+
A("Payment gateway not ready");
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
O("processing"), A(null);
|
|
29
29
|
let t = {
|
|
30
|
-
key:
|
|
31
|
-
amount:
|
|
32
|
-
currency:
|
|
33
|
-
name:
|
|
34
|
-
description:
|
|
35
|
-
order_id:
|
|
36
|
-
prefill:
|
|
37
|
-
notes:
|
|
30
|
+
key: p,
|
|
31
|
+
amount: m,
|
|
32
|
+
currency: h.toUpperCase(),
|
|
33
|
+
name: g,
|
|
34
|
+
description: _,
|
|
35
|
+
order_id: f,
|
|
36
|
+
prefill: y || {},
|
|
37
|
+
notes: b || {},
|
|
38
38
|
handler: (e) => {
|
|
39
|
-
|
|
39
|
+
O("success"), x(e);
|
|
40
40
|
},
|
|
41
41
|
modal: {
|
|
42
42
|
ondismiss: () => {
|
|
43
|
-
|
|
43
|
+
O("idle"), C?.();
|
|
44
44
|
},
|
|
45
45
|
escape: !0,
|
|
46
46
|
confirm_close: !0
|
|
47
47
|
}
|
|
48
48
|
}, n = e();
|
|
49
|
-
n && (t.theme = { color: n }),
|
|
49
|
+
n && (t.theme = { color: n }), v && (t.customer_id = v, t.remember_customer = !0);
|
|
50
50
|
try {
|
|
51
51
|
let e = window.Razorpay;
|
|
52
52
|
if (!e) throw Error("Payment gateway not ready");
|
|
53
53
|
let n = new e(t);
|
|
54
54
|
n.on("payment.failed", (e) => {
|
|
55
55
|
let t = e, n = t?.error?.description || t?.error?.reason || "Payment failed";
|
|
56
|
-
|
|
56
|
+
A(n), O("error"), S(n);
|
|
57
57
|
}), n.open();
|
|
58
58
|
} catch (e) {
|
|
59
59
|
let t = e instanceof Error ? e.message : "Failed to open payment gateway";
|
|
60
|
-
|
|
60
|
+
A(t), O("error"), S(t);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
j,
|
|
64
|
+
p,
|
|
65
|
+
m,
|
|
64
66
|
h,
|
|
65
67
|
g,
|
|
66
68
|
_,
|
|
67
69
|
v,
|
|
70
|
+
f,
|
|
68
71
|
y,
|
|
69
72
|
b,
|
|
70
|
-
m,
|
|
71
73
|
x,
|
|
72
74
|
S,
|
|
73
|
-
C
|
|
74
|
-
|
|
75
|
-
T
|
|
76
|
-
]), I = (g / 100).toLocaleString("en-IN", {
|
|
75
|
+
C
|
|
76
|
+
]), P = (m / 100).toLocaleString("en-IN", {
|
|
77
77
|
style: "currency",
|
|
78
78
|
currency: "INR"
|
|
79
79
|
});
|
|
80
|
-
return
|
|
80
|
+
return D === "success" ? /* @__PURE__ */ l("div", {
|
|
81
81
|
className: "p-6 rounded-lg border border-border-subtle bg-status-success-bg-subtle",
|
|
82
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ u("div", {
|
|
83
83
|
className: "flex items-center gap-3",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ l("div", {
|
|
85
85
|
className: "p-2 rounded-full bg-status-success-bg-subtle text-status-success-text",
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
}), /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ l(a, { className: "h-6 w-6" })
|
|
87
|
+
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
88
88
|
className: "font-semibold text-status-success-text",
|
|
89
89
|
children: "Payment Successful!"
|
|
90
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ l("p", {
|
|
91
91
|
className: "text-sm text-status-success-text",
|
|
92
92
|
children: "Your payment has been processed successfully."
|
|
93
93
|
})] })]
|
|
94
94
|
})
|
|
95
|
-
}) : /* @__PURE__ */
|
|
95
|
+
}) : /* @__PURE__ */ u("div", {
|
|
96
96
|
className: "space-y-4",
|
|
97
97
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
className: "flex items-center justify-
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
-
className: "flex items-center gap-2",
|
|
102
|
-
children: [/* @__PURE__ */ f("div", {
|
|
103
|
-
className: "flex items-center gap-1",
|
|
104
|
-
children: [/* @__PURE__ */ d(o, { className: "h-5 w-5 text-muted-foreground" }), /* @__PURE__ */ d(l, { className: "h-4 w-4 text-muted-foreground" })]
|
|
105
|
-
}), /* @__PURE__ */ d("span", {
|
|
106
|
-
className: "font-medium text-foreground",
|
|
107
|
-
children: "Razorpay Payment"
|
|
108
|
-
})]
|
|
109
|
-
}), /* @__PURE__ */ f("div", {
|
|
110
|
-
className: "flex items-center gap-1 text-xs text-muted-foreground",
|
|
111
|
-
children: [/* @__PURE__ */ d(c, { className: "h-3 w-3" }), "Secured by Razorpay"]
|
|
112
|
-
})]
|
|
113
|
-
}),
|
|
114
|
-
/* @__PURE__ */ f("div", {
|
|
115
|
-
className: "p-4 rounded-lg border border-border bg-muted/30",
|
|
116
|
-
children: [/* @__PURE__ */ d("p", {
|
|
117
|
-
className: "text-sm text-muted-foreground mb-3",
|
|
118
|
-
children: "Pay using any of these methods:"
|
|
119
|
-
}), /* @__PURE__ */ d("div", {
|
|
120
|
-
className: "grid grid-cols-2 sm:grid-cols-4 gap-2",
|
|
121
|
-
children: [
|
|
122
|
-
"UPI",
|
|
123
|
-
"Cards",
|
|
124
|
-
"Netbanking",
|
|
125
|
-
"Wallets"
|
|
126
|
-
].map((e) => /* @__PURE__ */ d("div", {
|
|
127
|
-
className: "px-3 py-2 rounded border border-border bg-background text-center text-sm text-foreground",
|
|
128
|
-
children: e
|
|
129
|
-
}, e))
|
|
130
|
-
})]
|
|
98
|
+
/* @__PURE__ */ u("div", {
|
|
99
|
+
className: "flex items-center justify-center gap-1.5 text-xs text-muted-foreground",
|
|
100
|
+
children: [/* @__PURE__ */ l(s, { className: "h-3 w-3" }), "Secured by Razorpay"]
|
|
131
101
|
}),
|
|
132
|
-
|
|
102
|
+
k && /* @__PURE__ */ u("div", {
|
|
133
103
|
className: "flex items-center gap-2 p-3 rounded-lg bg-destructive/10 text-destructive text-sm",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ l(i, { className: "h-4 w-4 shrink-0" }), k]
|
|
135
105
|
}),
|
|
136
|
-
!
|
|
106
|
+
!j && /* @__PURE__ */ u("div", {
|
|
137
107
|
className: "flex items-center justify-center gap-2 py-4 text-muted-foreground",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ l(o, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ l("span", {
|
|
139
109
|
className: "text-sm",
|
|
140
|
-
children:
|
|
110
|
+
children: E("billing.checkout.loadingGateway", "Loading payment gateway...")
|
|
141
111
|
})]
|
|
142
112
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ u("div", {
|
|
144
114
|
className: "flex gap-3",
|
|
145
|
-
children: [
|
|
115
|
+
children: [C && /* @__PURE__ */ l("button", {
|
|
146
116
|
type: "button",
|
|
147
|
-
onClick:
|
|
148
|
-
disabled:
|
|
117
|
+
onClick: C,
|
|
118
|
+
disabled: D === "processing" || w,
|
|
149
119
|
className: "flex-1 px-4 py-3 rounded-lg border border-border text-foreground font-medium\n hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
150
120
|
children: "Cancel"
|
|
151
|
-
}), /* @__PURE__ */
|
|
121
|
+
}), /* @__PURE__ */ l("button", {
|
|
152
122
|
type: "button",
|
|
153
|
-
onClick:
|
|
154
|
-
disabled: !
|
|
123
|
+
onClick: N,
|
|
124
|
+
disabled: !j || D === "processing" || w,
|
|
155
125
|
className: "flex-1 px-4 py-3 rounded-lg bg-action-primary-bg text-action-primary-text font-medium\n hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\n flex items-center justify-center gap-2",
|
|
156
|
-
children:
|
|
126
|
+
children: D === "processing" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(o, { className: "h-4 w-4 animate-spin" }), "Processing..."] }) : /* @__PURE__ */ u(c, { children: ["Pay ", P] })
|
|
157
127
|
})]
|
|
158
128
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ l("p", {
|
|
160
130
|
className: "text-center text-xs text-muted-foreground",
|
|
161
131
|
children: "Your payment is secured with 256-bit encryption. Powered by Razorpay."
|
|
162
132
|
})
|
|
@@ -164,6 +134,6 @@ var m = ({ orderId: m, keyId: h, amount: g, currency: _, name: v = "Burdenoff",
|
|
|
164
134
|
});
|
|
165
135
|
};
|
|
166
136
|
//#endregion
|
|
167
|
-
export {
|
|
137
|
+
export { f as RazorpayPaymentButton };
|
|
168
138
|
|
|
169
139
|
//# sourceMappingURL=RazorpayPaymentButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RazorpayPaymentButton.js","names":[],"sources":["../../../../../src/billing/modules/checkout/components/RazorpayPaymentButton.tsx"],"sourcesContent":["/**\n * {tr('billing.checkout.razorpayPayment', 'Razorpay Payment')} Button Component\n * Integrates with Razorpay checkout for INR payments\n */\n\nimport { type FC, useState, useCallback, useEffect } from 'react';\nimport { CreditCard, Lock, Loader2, Check, AlertCircle, Smartphone } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport type {\n RazorpaySuccessResponse,\n CheckoutRazorpayOptions,\n CheckoutRazorpayInstance,\n} from '../types';\nimport { getPaymentProviderThemeColor } from '../../../shared/utils';\n\ntype RazorpayCheckoutOptions = CheckoutRazorpayOptions & {\n customer_id?: string;\n remember_customer?: boolean;\n handler: (response: RazorpaySuccessResponse) => void;\n};\n\ninterface RazorpayPaymentButtonProps {\n orderId: string;\n keyId: string;\n amount: number; // In paise (smallest currency unit)\n currency: string;\n name?: string;\n description?: string;\n customerId?: string; // Razorpay customer ID for saved cards\n prefill?: {\n name?: string;\n email?: string;\n contact?: string;\n };\n notes?: Record<string, string>;\n onSuccess: (response: RazorpaySuccessResponse) => void;\n onError: (error: string) => void;\n onCancel?: () => void;\n disabled?: boolean;\n}\n\ntype PaymentState = 'idle' | 'loading' | 'processing' | 'success' | 'error';\n\nexport const RazorpayPaymentButton: FC<RazorpayPaymentButtonProps> = ({\n orderId,\n keyId,\n amount,\n currency,\n name = 'Burdenoff',\n description = 'Purchase',\n customerId,\n prefill,\n notes,\n onSuccess,\n onError,\n onCancel,\n disabled = false,\n}) => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const [paymentState, setPaymentState] = useState<PaymentState>('idle');\n const [error, setError] = useState<string | null>(null);\n const [isRazorpayLoaded, setIsRazorpayLoaded] = useState(false);\n\n // Load Razorpay SDK dynamically\n useEffect(() => {\n if (typeof window !== 'undefined' && !window.Razorpay) {\n const script = document.createElement('script');\n script.src = 'https://checkout.razorpay.com/v1/checkout.js';\n script.async = true;\n script.onload = () => {\n setIsRazorpayLoaded(true);\n };\n script.onerror = () => {\n setError('Failed to load payment gateway');\n };\n document.body.appendChild(script);\n } else if (window.Razorpay) {\n setIsRazorpayLoaded(true);\n }\n }, []);\n\n const handlePayment = useCallback(() => {\n if (!isRazorpayLoaded || !window.Razorpay) {\n setError('Payment gateway not ready');\n return;\n }\n\n setPaymentState('processing');\n setError(null);\n\n // Build Razorpay options - customer_id enables saved cards feature\n const options: RazorpayCheckoutOptions = {\n key: keyId,\n amount: amount, // Amount in paise\n currency: currency.toUpperCase(),\n name,\n description,\n order_id: orderId,\n prefill: prefill || {},\n notes: notes || {},\n handler: (response: RazorpaySuccessResponse) => {\n setPaymentState('success');\n onSuccess(response);\n },\n modal: {\n ondismiss: () => {\n setPaymentState('idle');\n onCancel?.();\n },\n escape: true,\n confirm_close: true,\n },\n };\n\n const providerThemeColor = getPaymentProviderThemeColor();\n if (providerThemeColor) {\n options.theme = { color: providerThemeColor };\n }\n\n // Add customer_id for saved cards feature\n if (customerId) {\n options.customer_id = customerId;\n options.remember_customer = true;\n }\n\n try {\n const RazorpayConstructor = (\n window as unknown as {\n Razorpay?: new (options: RazorpayCheckoutOptions) => CheckoutRazorpayInstance;\n }\n ).Razorpay;\n\n if (!RazorpayConstructor) {\n throw new Error('Payment gateway not ready');\n }\n\n const razorpay = new RazorpayConstructor(options);\n\n razorpay.on('payment.failed', (response: unknown) => {\n const errorResponse = response as {\n error?: {\n code?: string;\n description?: string;\n reason?: string;\n };\n };\n const errorMessage =\n errorResponse?.error?.description || errorResponse?.error?.reason || 'Payment failed';\n setError(errorMessage);\n setPaymentState('error');\n onError(errorMessage);\n });\n\n razorpay.open();\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Failed to open payment gateway';\n setError(errorMessage);\n setPaymentState('error');\n onError(errorMessage);\n }\n }, [\n isRazorpayLoaded,\n keyId,\n amount,\n currency,\n name,\n description,\n customerId,\n orderId,\n prefill,\n notes,\n onSuccess,\n onError,\n onCancel,\n ]);\n\n // Format amount for display (convert from paise to rupees)\n const displayAmount = (amount / 100).toLocaleString('en-IN', {\n style: 'currency',\n currency: 'INR',\n });\n\n // Render success state\n if (paymentState === 'success') {\n return (\n <div className=\"p-6 rounded-lg border border-border-subtle bg-status-success-bg-subtle\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-status-success-bg-subtle text-status-success-text\">\n <Check className=\"h-6 w-6\" />\n </div>\n <div>\n <h3 className=\"font-semibold text-status-success-text\">Payment Successful!</h3>\n <p className=\"text-sm text-status-success-text\">\n Your payment has been processed successfully.\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n {/* Header */}\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center gap-1\">\n <CreditCard className=\"h-5 w-5 text-muted-foreground\" />\n <Smartphone className=\"h-4 w-4 text-muted-foreground\" />\n </div>\n <span className=\"font-medium text-foreground\">Razorpay Payment</span>\n </div>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Lock className=\"h-3 w-3\" />\n Secured by Razorpay\n </div>\n </div>\n\n {/* Payment methods info */}\n <div className=\"p-4 rounded-lg border border-border bg-muted/30\">\n <p className=\"text-sm text-muted-foreground mb-3\">Pay using any of these methods:</p>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-2\">\n {['UPI', 'Cards', 'Netbanking', 'Wallets'].map((method) => (\n <div\n key={method}\n className=\"px-3 py-2 rounded border border-border bg-background text-center text-sm text-foreground\"\n >\n {method}\n </div>\n ))}\n </div>\n </div>\n\n {/* Error message */}\n {error && (\n <div className=\"flex items-center gap-2 p-3 rounded-lg bg-destructive/10 text-destructive text-sm\">\n <AlertCircle className=\"h-4 w-4 shrink-0\" />\n {error}\n </div>\n )}\n\n {/* Loading state */}\n {!isRazorpayLoaded && (\n <div className=\"flex items-center justify-center gap-2 py-4 text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span className=\"text-sm\">\n {tr('billing.checkout.loadingGateway', 'Loading payment gateway...')}\n </span>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n {onCancel && (\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={paymentState === 'processing' || disabled}\n className=\"flex-1 px-4 py-3 rounded-lg border border-border text-foreground font-medium\n hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n >\n Cancel\n </button>\n )}\n <button\n type=\"button\"\n onClick={handlePayment}\n disabled={!isRazorpayLoaded || paymentState === 'processing' || disabled}\n className=\"flex-1 px-4 py-3 rounded-lg bg-action-primary-bg text-action-primary-text font-medium\n hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\n flex items-center justify-center gap-2\"\n >\n {paymentState === 'processing' ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Processing...\n </>\n ) : (\n <>Pay {displayAmount}</>\n )}\n </button>\n </div>\n\n {/* Security note */}\n <p className=\"text-center text-xs text-muted-foreground\">\n Your payment is secured with 256-bit encryption. Powered by Razorpay.\n </p>\n </div>\n );\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"RazorpayPaymentButton.js","names":[],"sources":["../../../../../src/billing/modules/checkout/components/RazorpayPaymentButton.tsx"],"sourcesContent":["/**\n * {tr('billing.checkout.razorpayPayment', 'Razorpay Payment')} Button Component\n * Integrates with Razorpay checkout for INR payments\n */\n\nimport { type FC, useState, useCallback, useEffect } from 'react';\nimport { Lock, Loader2, Check, AlertCircle } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport type {\n RazorpaySuccessResponse,\n CheckoutRazorpayOptions,\n CheckoutRazorpayInstance,\n} from '../types';\nimport { getPaymentProviderThemeColor } from '../../../shared/utils';\n\ntype RazorpayCheckoutOptions = CheckoutRazorpayOptions & {\n customer_id?: string;\n remember_customer?: boolean;\n handler: (response: RazorpaySuccessResponse) => void;\n};\n\ninterface RazorpayPaymentButtonProps {\n orderId: string;\n keyId: string;\n amount: number; // In paise (smallest currency unit)\n currency: string;\n name?: string;\n description?: string;\n customerId?: string; // Razorpay customer ID for saved cards\n prefill?: {\n name?: string;\n email?: string;\n contact?: string;\n };\n notes?: Record<string, string>;\n onSuccess: (response: RazorpaySuccessResponse) => void;\n onError: (error: string) => void;\n onCancel?: () => void;\n disabled?: boolean;\n}\n\ntype PaymentState = 'idle' | 'loading' | 'processing' | 'success' | 'error';\n\nexport const RazorpayPaymentButton: FC<RazorpayPaymentButtonProps> = ({\n orderId,\n keyId,\n amount,\n currency,\n name = 'Burdenoff',\n description = 'Purchase',\n customerId,\n prefill,\n notes,\n onSuccess,\n onError,\n onCancel,\n disabled = false,\n}) => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const [paymentState, setPaymentState] = useState<PaymentState>('idle');\n const [error, setError] = useState<string | null>(null);\n const [isRazorpayLoaded, setIsRazorpayLoaded] = useState(false);\n\n // Load Razorpay SDK dynamically\n useEffect(() => {\n if (typeof window !== 'undefined' && !window.Razorpay) {\n const script = document.createElement('script');\n script.src = 'https://checkout.razorpay.com/v1/checkout.js';\n script.async = true;\n script.onload = () => {\n setIsRazorpayLoaded(true);\n };\n script.onerror = () => {\n setError('Failed to load payment gateway');\n };\n document.body.appendChild(script);\n } else if (window.Razorpay) {\n setIsRazorpayLoaded(true);\n }\n }, []);\n\n const handlePayment = useCallback(() => {\n if (!isRazorpayLoaded || !window.Razorpay) {\n setError('Payment gateway not ready');\n return;\n }\n\n setPaymentState('processing');\n setError(null);\n\n // Build Razorpay options - customer_id enables saved cards feature\n const options: RazorpayCheckoutOptions = {\n key: keyId,\n amount: amount, // Amount in paise\n currency: currency.toUpperCase(),\n name,\n description,\n order_id: orderId,\n prefill: prefill || {},\n notes: notes || {},\n handler: (response: RazorpaySuccessResponse) => {\n setPaymentState('success');\n onSuccess(response);\n },\n modal: {\n ondismiss: () => {\n setPaymentState('idle');\n onCancel?.();\n },\n escape: true,\n confirm_close: true,\n },\n };\n\n const providerThemeColor = getPaymentProviderThemeColor();\n if (providerThemeColor) {\n options.theme = { color: providerThemeColor };\n }\n\n // Add customer_id for saved cards feature\n if (customerId) {\n options.customer_id = customerId;\n options.remember_customer = true;\n }\n\n try {\n const RazorpayConstructor = (\n window as unknown as {\n Razorpay?: new (options: RazorpayCheckoutOptions) => CheckoutRazorpayInstance;\n }\n ).Razorpay;\n\n if (!RazorpayConstructor) {\n throw new Error('Payment gateway not ready');\n }\n\n const razorpay = new RazorpayConstructor(options);\n\n razorpay.on('payment.failed', (response: unknown) => {\n const errorResponse = response as {\n error?: {\n code?: string;\n description?: string;\n reason?: string;\n };\n };\n const errorMessage =\n errorResponse?.error?.description || errorResponse?.error?.reason || 'Payment failed';\n setError(errorMessage);\n setPaymentState('error');\n onError(errorMessage);\n });\n\n razorpay.open();\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Failed to open payment gateway';\n setError(errorMessage);\n setPaymentState('error');\n onError(errorMessage);\n }\n }, [\n isRazorpayLoaded,\n keyId,\n amount,\n currency,\n name,\n description,\n customerId,\n orderId,\n prefill,\n notes,\n onSuccess,\n onError,\n onCancel,\n ]);\n\n // Format amount for display (convert from paise to rupees)\n const displayAmount = (amount / 100).toLocaleString('en-IN', {\n style: 'currency',\n currency: 'INR',\n });\n\n // Render success state\n if (paymentState === 'success') {\n return (\n <div className=\"p-6 rounded-lg border border-border-subtle bg-status-success-bg-subtle\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-status-success-bg-subtle text-status-success-text\">\n <Check className=\"h-6 w-6\" />\n </div>\n <div>\n <h3 className=\"font-semibold text-status-success-text\">Payment Successful!</h3>\n <p className=\"text-sm text-status-success-text\">\n Your payment has been processed successfully.\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4\">\n {/* Security badge */}\n <div className=\"flex items-center justify-center gap-1.5 text-xs text-muted-foreground\">\n <Lock className=\"h-3 w-3\" />\n Secured by Razorpay\n </div>\n\n {/* Error message */}\n {error && (\n <div className=\"flex items-center gap-2 p-3 rounded-lg bg-destructive/10 text-destructive text-sm\">\n <AlertCircle className=\"h-4 w-4 shrink-0\" />\n {error}\n </div>\n )}\n\n {/* Loading state */}\n {!isRazorpayLoaded && (\n <div className=\"flex items-center justify-center gap-2 py-4 text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span className=\"text-sm\">\n {tr('billing.checkout.loadingGateway', 'Loading payment gateway...')}\n </span>\n </div>\n )}\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n {onCancel && (\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={paymentState === 'processing' || disabled}\n className=\"flex-1 px-4 py-3 rounded-lg border border-border text-foreground font-medium\n hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n >\n Cancel\n </button>\n )}\n <button\n type=\"button\"\n onClick={handlePayment}\n disabled={!isRazorpayLoaded || paymentState === 'processing' || disabled}\n className=\"flex-1 px-4 py-3 rounded-lg bg-action-primary-bg text-action-primary-text font-medium\n hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\n flex items-center justify-center gap-2\"\n >\n {paymentState === 'processing' ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Processing...\n </>\n ) : (\n <>Pay {displayAmount}</>\n )}\n </button>\n </div>\n\n {/* Security note */}\n <p className=\"text-center text-xs text-muted-foreground\">\n Your payment is secured with 256-bit encryption. Powered by Razorpay.\n </p>\n </div>\n );\n};\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admin-only billing routes.
|
|
3
|
-
* Includes plans/addons/quota-templates CRUD, coupons, discounts, refunds, and analytics.
|
|
4
|
-
*/
|
|
5
|
-
export declare function BillingAdminRoutes(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=BillingAdminRoutes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BillingAdminRoutes.d.ts","sourceRoot":"","sources":["../../src/billing/BillingAdminRoutes.tsx"],"names":[],"mappings":"AA+KA;;;GAGG;AACH,wBAAgB,kBAAkB,4CAgUjC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { BillingRootProps } from './types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Root component for the Billing microfrontend.
|
|
6
|
-
*
|
|
7
|
-
* This is the main entry point that host applications import and render.
|
|
8
|
-
* It sets up the necessary providers and renders the internal routing.
|
|
9
|
-
* Automatically registers navigation items with the shell if registration functions are provided.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* import { BillingRoot, type BillingRootProps } from '@burdenoff/microfe-billing';
|
|
14
|
-
*
|
|
15
|
-
* function App() {
|
|
16
|
-
* const props: BillingRootProps = {
|
|
17
|
-
* basePath: '/billing',
|
|
18
|
-
* navigate: (path) => router.push(path),
|
|
19
|
-
* currentUser: { id: '1', email: 'user@example.com', firstName: 'John', lastName: 'Doe' },
|
|
20
|
-
* workspaceId: 'ws-123',
|
|
21
|
-
* orgId: 'org-123',
|
|
22
|
-
* apiGatewayUrl: 'https://api.example.com/tenant/graphql',
|
|
23
|
-
* authToken: 'token',
|
|
24
|
-
* stripePublishableKey: 'pk_test_...',
|
|
25
|
-
* razorpayKey: 'rzp_test_...',
|
|
26
|
-
* onSubscriptionCreate: (subscription) => console.log('Subscription created:', subscription),
|
|
27
|
-
* onSubscriptionUpdate: (subscription) => console.log('Subscription updated:', subscription),
|
|
28
|
-
* onPaymentProcess: (payment) => console.log('Payment processed:', payment),
|
|
29
|
-
* registerNavItems: (items) => { return () => {}; },
|
|
30
|
-
* };
|
|
31
|
-
*
|
|
32
|
-
* return <BillingRoot {...props} />;
|
|
33
|
-
* }
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare const BillingRoot: FC<BillingRootProps>;
|
|
37
|
-
//# sourceMappingURL=BillingRoot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BillingRoot.d.ts","sourceRoot":"","sources":["../../src/billing/BillingRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAoBhC,OAAO,KAAK,EAAW,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA8M5C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User-facing billing routes.
|
|
3
|
-
* Includes overview, subscriptions, plan/addon browsing (read-only),
|
|
4
|
-
* invoices, payments, credits, quota usage, checkout, and settings.
|
|
5
|
-
*/
|
|
6
|
-
export declare function BillingUserRoutes(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=BillingUserRoutes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BillingUserRoutes.d.ts","sourceRoot":"","sources":["../../src/billing/BillingUserRoutes.tsx"],"names":[],"mappings":"AAyLA;;;;GAIG;AACH,wBAAgB,iBAAiB,4CAyehC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Billing Permission Constants
|
|
3
|
-
*
|
|
4
|
-
* Permission strings matching the @rbac directives on global-billing-svc.
|
|
5
|
-
* Use with fe-libs usePermissions hook: hasPermission(BILLING_PERMISSIONS.BILLING_READ)
|
|
6
|
-
*
|
|
7
|
-
* Resource type: billing
|
|
8
|
-
* Actions: read, create, update, delete, manage
|
|
9
|
-
*/
|
|
10
|
-
export declare const BILLING_PERMISSIONS: {
|
|
11
|
-
readonly BILLING_READ: "billing:read";
|
|
12
|
-
readonly BILLING_CREATE: "billing:create";
|
|
13
|
-
readonly BILLING_UPDATE: "billing:update";
|
|
14
|
-
readonly BILLING_DELETE: "billing:delete";
|
|
15
|
-
readonly BILLING_MANAGE: "billing:manage";
|
|
16
|
-
};
|
|
17
|
-
export type BillingPermission = (typeof BILLING_PERMISSIONS)[keyof typeof BILLING_PERMISSIONS];
|
|
18
|
-
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/billing/constants/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB;;;;;;CAOtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for managing billing account selection per org
|
|
3
|
-
* Persists the selected account to localStorage and syncs across pages.
|
|
4
|
-
* Keys are scoped by profile and org to support multi-user/multi-org usage.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Get stored account ID (handles finding active profile)
|
|
8
|
-
*/
|
|
9
|
-
export declare const getStoredBillingAccountId: (orgId: string) => string | null;
|
|
10
|
-
/**
|
|
11
|
-
* Set stored account ID
|
|
12
|
-
*/
|
|
13
|
-
export declare const setStoredBillingAccountId: (orgId: string, accountId: string | null) => void;
|
|
14
|
-
interface UseBillingAccountSelectionOptions {
|
|
15
|
-
orgId: string;
|
|
16
|
-
/** Available billing accounts to validate against */
|
|
17
|
-
billingAccounts?: Array<{
|
|
18
|
-
id: string;
|
|
19
|
-
isDefault?: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
/** Whether to sync from URL query param on navigation */
|
|
22
|
-
syncFromUrl?: boolean;
|
|
23
|
-
/** URL query param name (default: 'billingAccountId') */
|
|
24
|
-
urlParamName?: string;
|
|
25
|
-
}
|
|
26
|
-
interface UseBillingAccountSelectionResult {
|
|
27
|
-
/** Currently selected billing account ID */
|
|
28
|
-
selectedAccountId: string | null;
|
|
29
|
-
/** Set the selected billing account (persists to localStorage) */
|
|
30
|
-
setSelectedAccountId: (accountId: string | null) => void;
|
|
31
|
-
/** Clear the stored selection */
|
|
32
|
-
clearSelection: () => void;
|
|
33
|
-
}
|
|
34
|
-
export declare function useBillingAccountSelection({ orgId, billingAccounts, syncFromUrl, urlParamName, }: UseBillingAccountSelectionOptions): UseBillingAccountSelectionResult;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=useBillingAccountSelection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingAccountSelection.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingAccountSelection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAQlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,EAAE,WAAW,MAAM,GAAG,IAAI,SAYhF,CAAC;AAEF,UAAU,iCAAiC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC7D,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,gCAAgC;IACxC,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,iCAAiC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,0BAA0B,CAAC,EACzC,KAAK,EACL,eAAe,EACf,WAAmB,EACnB,YAAiC,GAClC,EAAE,iCAAiC,GAAG,gCAAgC,CA8EtE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BillingLifecyclePayload } from '@burdenoff/fe-libs/shared/events';
|
|
2
|
-
|
|
3
|
-
export type BillingDomainEvent = 'billing.billing_account.viewed' | 'billing.billing_account.created' | 'billing.billing_account.updated' | 'billing.billing_account.archived' | 'billing.subscription.viewed' | 'billing.subscription.cancelled' | 'billing.plan.viewed' | 'billing.addon.viewed' | 'billing.checkout.viewed' | 'billing.checkout.initiated' | 'billing.checkout.failed' | 'billing.payment.succeeded' | 'billing.payment.failed' | 'billing.invoice.viewed' | 'billing.payment_method.viewed' | 'billing.payment_method.added' | 'billing.payment_method.default_set' | 'billing.payment_method.deleted' | 'billing.credit.viewed' | 'billing.credits.spent' | 'billing.credits.granted' | 'billing.credits.withdrawal_requested' | 'billing.quota.viewed' | 'billing.usage.viewed' | 'billing.transaction.viewed' | 'billing.affiliate.viewed' | 'billing.affiliate_code.created' | 'billing.affiliate_code.updated' | 'billing.affiliate_code.deactivated' | 'billing.affiliate_code.note_added' | 'billing.earning.viewed' | 'billing.payout.viewed' | 'billing.payout_account.added' | 'billing.payout_account.updated' | 'billing.payout_account.archived' | 'billing.payout.requested' | 'billing.payout.approved' | 'billing.payout.rejected' | 'billing.payout.processed';
|
|
4
|
-
export type BillingEventPayload = BillingLifecyclePayload;
|
|
5
|
-
export declare function useBillingEventEmitter(): {
|
|
6
|
-
emit: (event: BillingDomainEvent, payload?: BillingEventPayload) => void;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=useBillingEventEmitter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingEventEmitter.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingEventEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,MAAM,MAAM,kBAAkB,GAC1B,gCAAgC,GAChC,iCAAiC,GACjC,iCAAiC,GACjC,kCAAkC,GAClC,6BAA6B,GAC7B,gCAAgC,GAChC,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,GACzB,4BAA4B,GAC5B,yBAAyB,GACzB,2BAA2B,GAC3B,wBAAwB,GACxB,wBAAwB,GACxB,+BAA+B,GAC/B,8BAA8B,GAC9B,oCAAoC,GACpC,gCAAgC,GAChC,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,sCAAsC,GACtC,sBAAsB,GACtB,sBAAsB,GACtB,4BAA4B,GAC5B,0BAA0B,GAC1B,gCAAgC,GAChC,gCAAgC,GAChC,oCAAoC,GACpC,mCAAmC,GACnC,wBAAwB,GACxB,uBAAuB,GACvB,8BAA8B,GAC9B,gCAAgC,GAChC,iCAAiC,GACjC,0BAA0B,GAC1B,yBAAyB,GACzB,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,wBAAgB,sBAAsB,IAAI;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC1E,CAeA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom navigation hook for the Billing microfrontend.
|
|
3
|
-
* Properly handles basePath when navigating within billing routes.
|
|
4
|
-
*/
|
|
5
|
-
export interface NavigateOptions {
|
|
6
|
-
replace?: boolean;
|
|
7
|
-
state?: unknown;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Hook that returns a navigation function that properly prepends the basePath.
|
|
11
|
-
* This ensures all navigation within the billing microfrontend works correctly
|
|
12
|
-
* when integrated into a shell application with a basePath (e.g., '/billing').
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* const navigateTo = useBillingNavigate();
|
|
17
|
-
*
|
|
18
|
-
* // Navigate to checkout
|
|
19
|
-
* navigateTo('/checkout/credits');
|
|
20
|
-
* // When basePath is '/billing', this navigates to '/billing/checkout/credits'
|
|
21
|
-
*
|
|
22
|
-
* // Navigate with state
|
|
23
|
-
* navigateTo('/checkout/plan-123', { state: { fromUpgrade: true } });
|
|
24
|
-
*
|
|
25
|
-
* // Navigate back in history
|
|
26
|
-
* navigateTo(-1);
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function useBillingNavigate(): (pathOrDelta: string | number, options?: NavigateOptions) => void;
|
|
30
|
-
//# sourceMappingURL=useBillingNavigate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingNavigate.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingNavigate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,kBAKhB,MAAM,GAAG,MAAM,YAAY,eAAe,UAoC3D"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for billing-specific RBAC permissions.
|
|
3
|
-
*
|
|
4
|
-
* Permission model aligns with the `@rbac` directives on global-billing-svc:
|
|
5
|
-
* resource: "billing"
|
|
6
|
-
* actions: "read" – view billing data
|
|
7
|
-
* "create" – create billing accounts, initiate payments
|
|
8
|
-
* "update" – modify billing accounts, payment methods, usage
|
|
9
|
-
* "delete" – remove payment methods, cancel subscriptions
|
|
10
|
-
* "manage" – admin-only (plans, addons, quotas, discounts, refunds, tax rates)
|
|
11
|
-
*
|
|
12
|
-
* The RBAC service resolves these via `billingAccount.*` permission strings:
|
|
13
|
-
* billingAccount.read → action: "read"
|
|
14
|
-
* billingAccount.create → action: "create"
|
|
15
|
-
* billingAccount.update → action: "update"
|
|
16
|
-
* billingAccount.delete → action: "delete"
|
|
17
|
-
* billingAccount.all → action: "manage" (admin bypass)
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export interface UseBillingPermissionsOptions {
|
|
21
|
-
/**
|
|
22
|
-
* Caller-resolved billing account ID. When provided, this overrides the
|
|
23
|
-
* hook's internal `useBillingAccountSelection` resolution. Use this when
|
|
24
|
-
* the calling page already resolves a billing account (e.g. via the
|
|
25
|
-
* `useBillingAccounts` + `useBillingAccountSelection` pair) so the
|
|
26
|
-
* billing-scope permission fetch observes the *same* account ID and
|
|
27
|
-
* doesn't lag behind for first-time users whose default account only
|
|
28
|
-
* resolves once the accounts list loads.
|
|
29
|
-
*/
|
|
30
|
-
billingAccountIdOverride?: string | null;
|
|
31
|
-
}
|
|
32
|
-
export declare function useBillingPermissions(options?: UseBillingPermissionsOptions): {
|
|
33
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
34
|
-
canViewBillingAccount: boolean;
|
|
35
|
-
/** @rbac(action: "create", resource: "billing") */
|
|
36
|
-
canCreateBillingAccount: boolean;
|
|
37
|
-
/** @rbac(action: "update", resource: "billing") */
|
|
38
|
-
canManageBillingAccount: boolean;
|
|
39
|
-
/** @rbac(action: "delete", resource: "billing") — archiveBillingAccount */
|
|
40
|
-
canArchiveBillingAccount: boolean;
|
|
41
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
42
|
-
canViewSubscriptions: boolean;
|
|
43
|
-
/** @rbac(action: "create", resource: "billing") — initiatePayment for plans */
|
|
44
|
-
canCreateSubscription: boolean;
|
|
45
|
-
/** @rbac(action: "update", resource: "billing") */
|
|
46
|
-
canUpdateSubscription: boolean;
|
|
47
|
-
/** @rbac(action: "delete", resource: "billing") — cancelSubscription */
|
|
48
|
-
canCancelSubscription: boolean;
|
|
49
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
50
|
-
canViewPlans: boolean;
|
|
51
|
-
/** @rbac(action: "manage", resource: "billing") — createPlan, updatePlan, togglePlan */
|
|
52
|
-
canManagePlans: boolean;
|
|
53
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
54
|
-
canViewAddons: boolean;
|
|
55
|
-
/** @rbac(action: "manage", resource: "billing") — createAddOns, updateAddOnDetails, toggleAddOn */
|
|
56
|
-
canManageAddons: boolean;
|
|
57
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
58
|
-
canViewQuotas: boolean;
|
|
59
|
-
/** @rbac(action: "manage", resource: "billing") — createQuota, updateQuota */
|
|
60
|
-
canManageQuotas: boolean;
|
|
61
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
62
|
-
canViewInvoices: boolean;
|
|
63
|
-
/** @rbac(action: "update", resource: "billing") — payInvoice */
|
|
64
|
-
canPayInvoice: boolean;
|
|
65
|
-
/** @rbac(action: "manage", resource: "billing") — voidInvoice, generateInvoice */
|
|
66
|
-
canVoidInvoice: boolean;
|
|
67
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
68
|
-
canViewPayments: boolean;
|
|
69
|
-
/** @rbac(action: "create", resource: "billing") — initiatePayment */
|
|
70
|
-
canProcessPayment: boolean;
|
|
71
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
72
|
-
canViewPaymentMethods: boolean;
|
|
73
|
-
/** @rbac(action: "update", resource: "billing") — addPaymentMethod, updatePaymentMethod */
|
|
74
|
-
canManagePaymentMethods: boolean;
|
|
75
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
76
|
-
canViewUsage: boolean;
|
|
77
|
-
/** @rbac(action: "update", resource: "billing") — addUsage, freeUpUsage */
|
|
78
|
-
canRecordUsage: boolean;
|
|
79
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
80
|
-
canViewCredits: boolean;
|
|
81
|
-
/** @rbac(action: "update", resource: "billing") — spendCredits */
|
|
82
|
-
canIssueCredit: boolean;
|
|
83
|
-
/** @rbac(action: "update", resource: "billing") — requestCreditWithdrawal */
|
|
84
|
-
canWithdrawCredits: boolean;
|
|
85
|
-
/** @rbac(action: "manage", resource: "billing") — grantCredits */
|
|
86
|
-
canGrantCredits: boolean;
|
|
87
|
-
/** @rbac(action: "update", resource: "billing") — applyBillingDiscount */
|
|
88
|
-
canApplyDiscount: boolean;
|
|
89
|
-
/** @rbac(action: "manage", resource: "billing") — createDiscount, updateDiscount, deleteDiscount */
|
|
90
|
-
canManageDiscounts: boolean;
|
|
91
|
-
/** @rbac(action: "read", resource: "billing") */
|
|
92
|
-
canViewAnalytics: boolean;
|
|
93
|
-
/** @rbac(action: "manage", resource: "billing") — processRefund, skipRefund, retryRefund */
|
|
94
|
-
canProcessRefund: boolean;
|
|
95
|
-
/** @rbac(action: "manage", resource: "billing") */
|
|
96
|
-
canManageRecurringBilling: boolean;
|
|
97
|
-
/** @rbac(action: "manage", resource: "billing") — createEntitlement, updateEntitlement, deleteEntitlement */
|
|
98
|
-
canManageEntitlements: boolean;
|
|
99
|
-
/** @rbac(action: "manage", resource: "billing") — createTaxRate, updateTaxRate, deleteTaxRate */
|
|
100
|
-
canManageTaxRates: boolean;
|
|
101
|
-
/** Full billing admin (billing:manage) */
|
|
102
|
-
isBillingAdmin: boolean;
|
|
103
|
-
/** Whether permissions are still being loaded from RBAC service */
|
|
104
|
-
isLoading: boolean;
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=useBillingPermissions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingPermissions.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingPermissions.ts"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,4BAA4B;IAyExE,iDAAiD;;IAEjD,mDAAmD;;IAEnD,mDAAmD;;IAEnD,2EAA2E;;IAI3E,iDAAiD;;IAEjD,+EAA+E;;IAE/E,mDAAmD;;IAEnD,wEAAwE;;IAIxE,iDAAiD;;IAEjD,wFAAwF;;IAIxF,iDAAiD;;IAEjD,mGAAmG;;IAInG,iDAAiD;;IAEjD,8EAA8E;;IAI9E,iDAAiD;;IAEjD,gEAAgE;;IAEhE,kFAAkF;;IAIlF,iDAAiD;;IAEjD,qEAAqE;;IAIrE,iDAAiD;;IAEjD,2FAA2F;;IAI3F,iDAAiD;;IAEjD,2EAA2E;;IAI3E,iDAAiD;;IAEjD,kEAAkE;;IAElE,6EAA6E;;IAE7E,kEAAkE;;IAIlE,0EAA0E;;IAE1E,oGAAoG;;IAIpG,iDAAiD;;IAIjD,4FAA4F;;IAI5F,mDAAmD;;IAInD,6GAA6G;;IAI7G,iGAAiG;;IAIjG,0CAA0C;;IAI1C,mEAAmE;;EAGtE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the currency of the user's default billing account (e.g. "INR", "USD").
|
|
3
|
-
* Falls back to "USD" while loading or if no billing account exists.
|
|
4
|
-
*/
|
|
5
|
-
export declare function useDefaultBillingCurrency(): string;
|
|
6
|
-
/**
|
|
7
|
-
* Given a plan/addon's base price + currency and an optional currencyPrices map,
|
|
8
|
-
* returns the best price/currency to display for the given target currency.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getDisplayPrice(basePrice: number, baseCurrency: string, currencyPrices: Record<string, number> | null | undefined, targetCurrency: string): {
|
|
11
|
-
price: number;
|
|
12
|
-
currency: string;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=useDefaultBillingCurrency.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultBillingCurrency.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useDefaultBillingCurrency.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAGlD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EACzD,cAAc,EAAE,MAAM,GACrB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQrC"}
|