@fantastic.dev/better-stripe 0.4.0-bootstrap.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/CHANGELOG.md +318 -0
- package/README.md +1117 -0
- package/dist/client/billing/checkout.d.ts +75 -0
- package/dist/client/billing/checkout.d.ts.map +1 -0
- package/dist/client/billing/checkout.js +260 -0
- package/dist/client/billing/checkout.js.map +1 -0
- package/dist/client/billing/invoices.d.ts +37 -0
- package/dist/client/billing/invoices.d.ts.map +1 -0
- package/dist/client/billing/invoices.js +29 -0
- package/dist/client/billing/invoices.js.map +1 -0
- package/dist/client/billing/subscriptions.d.ts +179 -0
- package/dist/client/billing/subscriptions.d.ts.map +1 -0
- package/dist/client/billing/subscriptions.js +346 -0
- package/dist/client/billing/subscriptions.js.map +1 -0
- package/dist/client/connect/disputes.d.ts +112 -0
- package/dist/client/connect/disputes.d.ts.map +1 -0
- package/dist/client/connect/disputes.js +186 -0
- package/dist/client/connect/disputes.js.map +1 -0
- package/dist/client/connect/paymentMethodUtils.d.ts +17 -0
- package/dist/client/connect/paymentMethodUtils.d.ts.map +1 -0
- package/dist/client/connect/paymentMethodUtils.js +24 -0
- package/dist/client/connect/paymentMethodUtils.js.map +1 -0
- package/dist/client/connect/paymentMethods.d.ts +23 -0
- package/dist/client/connect/paymentMethods.d.ts.map +1 -0
- package/dist/client/connect/paymentMethods.js +27 -0
- package/dist/client/connect/paymentMethods.js.map +1 -0
- package/dist/client/connect/payouts.d.ts +47 -0
- package/dist/client/connect/payouts.d.ts.map +1 -0
- package/dist/client/connect/payouts.js +52 -0
- package/dist/client/connect/payouts.js.map +1 -0
- package/dist/client/connect/refundActor.d.ts +50 -0
- package/dist/client/connect/refundActor.d.ts.map +1 -0
- package/dist/client/connect/refundActor.js +17 -0
- package/dist/client/connect/refundActor.js.map +1 -0
- package/dist/client/connect/refunds.d.ts +75 -0
- package/dist/client/connect/refunds.d.ts.map +1 -0
- package/dist/client/connect/refunds.js +141 -0
- package/dist/client/connect/refunds.js.map +1 -0
- package/dist/client/connect/transfers.d.ts +189 -0
- package/dist/client/connect/transfers.d.ts.map +1 -0
- package/dist/client/connect/transfers.js +347 -0
- package/dist/client/connect/transfers.js.map +1 -0
- package/dist/client/constants.d.ts +15 -0
- package/dist/client/constants.d.ts.map +1 -0
- package/dist/client/constants.js +14 -0
- package/dist/client/constants.js.map +1 -0
- package/dist/client/core/accountLinks.d.ts +68 -0
- package/dist/client/core/accountLinks.d.ts.map +1 -0
- package/dist/client/core/accountLinks.js +131 -0
- package/dist/client/core/accountLinks.js.map +1 -0
- package/dist/client/core/accountStatus.d.ts +12 -0
- package/dist/client/core/accountStatus.d.ts.map +1 -0
- package/dist/client/core/accountStatus.js +56 -0
- package/dist/client/core/accountStatus.js.map +1 -0
- package/dist/client/core/accounts.d.ts +181 -0
- package/dist/client/core/accounts.d.ts.map +1 -0
- package/dist/client/core/accounts.js +359 -0
- package/dist/client/core/accounts.js.map +1 -0
- package/dist/client/core/config.d.ts +5 -0
- package/dist/client/core/config.d.ts.map +1 -0
- package/dist/client/core/config.js +11 -0
- package/dist/client/core/config.js.map +1 -0
- package/dist/client/core/descriptors.d.ts +24 -0
- package/dist/client/core/descriptors.d.ts.map +1 -0
- package/dist/client/core/descriptors.js +43 -0
- package/dist/client/core/descriptors.js.map +1 -0
- package/dist/client/core/fees.d.ts +83 -0
- package/dist/client/core/fees.d.ts.map +1 -0
- package/dist/client/core/fees.js +178 -0
- package/dist/client/core/fees.js.map +1 -0
- package/dist/client/errors.d.ts +20 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +31 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/helpers.d.ts +20 -0
- package/dist/client/helpers.d.ts.map +1 -0
- package/dist/client/helpers.js +46 -0
- package/dist/client/helpers.js.map +1 -0
- package/dist/client/index.d.ts +880 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +791 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/products/prices.d.ts +61 -0
- package/dist/client/products/prices.d.ts.map +1 -0
- package/dist/client/products/prices.js +92 -0
- package/dist/client/products/prices.js.map +1 -0
- package/dist/client/products/products.d.ts +65 -0
- package/dist/client/products/products.d.ts.map +1 -0
- package/dist/client/products/products.js +186 -0
- package/dist/client/products/products.js.map +1 -0
- package/dist/client/stripe-types.d.ts +44 -0
- package/dist/client/stripe-types.d.ts.map +1 -0
- package/dist/client/stripe-types.js +2 -0
- package/dist/client/stripe-types.js.map +1 -0
- package/dist/client/types/documents.d.ts +195 -0
- package/dist/client/types/documents.d.ts.map +1 -0
- package/dist/client/types/documents.js +2 -0
- package/dist/client/types/documents.js.map +1 -0
- package/dist/client/types/events.d.ts +43 -0
- package/dist/client/types/events.d.ts.map +1 -0
- package/dist/client/types/events.js +2 -0
- package/dist/client/types/events.js.map +1 -0
- package/dist/client/types/index.d.ts +5 -0
- package/dist/client/types/index.d.ts.map +1 -0
- package/dist/client/types/index.js +2 -0
- package/dist/client/types/index.js.map +1 -0
- package/dist/client/types/options.d.ts +79 -0
- package/dist/client/types/options.d.ts.map +1 -0
- package/dist/client/types/options.js +2 -0
- package/dist/client/types/options.js.map +1 -0
- package/dist/client/types/triggers.d.ts +101 -0
- package/dist/client/types/triggers.d.ts.map +1 -0
- package/dist/client/types/triggers.js +2 -0
- package/dist/client/types/triggers.js.map +1 -0
- package/dist/client/types.d.ts +2 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/utils/data.d.ts +10 -0
- package/dist/client/utils/data.d.ts.map +1 -0
- package/dist/client/utils/data.js +13 -0
- package/dist/client/utils/data.js.map +1 -0
- package/dist/client/utils/owner.d.ts +22 -0
- package/dist/client/utils/owner.d.ts.map +1 -0
- package/dist/client/utils/owner.js +20 -0
- package/dist/client/utils/owner.js.map +1 -0
- package/dist/client/utils/stripeDashboardUrl.d.ts +12 -0
- package/dist/client/utils/stripeDashboardUrl.d.ts.map +1 -0
- package/dist/client/utils/stripeDashboardUrl.js +39 -0
- package/dist/client/utils/stripeDashboardUrl.js.map +1 -0
- package/dist/client/utils/webhookEndpoints.d.ts +83 -0
- package/dist/client/utils/webhookEndpoints.d.ts.map +1 -0
- package/dist/client/utils/webhookEndpoints.js +185 -0
- package/dist/client/utils/webhookEndpoints.js.map +1 -0
- package/dist/client/webhooks/handler.d.ts +4 -0
- package/dist/client/webhooks/handler.d.ts.map +1 -0
- package/dist/client/webhooks/handler.js +170 -0
- package/dist/client/webhooks/handler.js.map +1 -0
- package/dist/client/webhooks/helpers.d.ts +56 -0
- package/dist/client/webhooks/helpers.d.ts.map +1 -0
- package/dist/client/webhooks/helpers.js +229 -0
- package/dist/client/webhooks/helpers.js.map +1 -0
- package/dist/client/webhooks/hooks.d.ts +11 -0
- package/dist/client/webhooks/hooks.d.ts.map +1 -0
- package/dist/client/webhooks/hooks.js +134 -0
- package/dist/client/webhooks/hooks.js.map +1 -0
- package/dist/client/webhooks/index.d.ts +23 -0
- package/dist/client/webhooks/index.d.ts.map +1 -0
- package/dist/client/webhooks/index.js +35 -0
- package/dist/client/webhooks/index.js.map +1 -0
- package/dist/client/webhooks/processors.d.ts +4 -0
- package/dist/client/webhooks/processors.d.ts.map +1 -0
- package/dist/client/webhooks/processors.js +932 -0
- package/dist/client/webhooks/processors.js.map +1 -0
- package/dist/client/webhooks/v2.d.ts +11 -0
- package/dist/client/webhooks/v2.d.ts.map +1 -0
- package/dist/client/webhooks/v2.js +94 -0
- package/dist/client/webhooks/v2.js.map +1 -0
- package/dist/client/webhooks.d.ts +2 -0
- package/dist/client/webhooks.d.ts.map +1 -0
- package/dist/client/webhooks.js +4 -0
- package/dist/client/webhooks.js.map +1 -0
- package/dist/component/_generated/component.d.ts +1262 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +129 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +79 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/billing/mutations.d.ts +86 -0
- package/dist/component/billing/mutations.d.ts.map +1 -0
- package/dist/component/billing/mutations.js +131 -0
- package/dist/component/billing/mutations.js.map +1 -0
- package/dist/component/billing/queries.d.ts +425 -0
- package/dist/component/billing/queries.d.ts.map +1 -0
- package/dist/component/billing/queries.js +304 -0
- package/dist/component/billing/queries.js.map +1 -0
- package/dist/component/billing/schema.d.ts +228 -0
- package/dist/component/billing/schema.d.ts.map +1 -0
- package/dist/component/billing/schema.js +33 -0
- package/dist/component/billing/schema.js.map +1 -0
- package/dist/component/billing/validators.d.ts +364 -0
- package/dist/component/billing/validators.d.ts.map +1 -0
- package/dist/component/billing/validators.js +98 -0
- package/dist/component/billing/validators.js.map +1 -0
- package/dist/component/connect/mutations.d.ts +182 -0
- package/dist/component/connect/mutations.d.ts.map +1 -0
- package/dist/component/connect/mutations.js +480 -0
- package/dist/component/connect/mutations.js.map +1 -0
- package/dist/component/connect/queries.d.ts +347 -0
- package/dist/component/connect/queries.d.ts.map +1 -0
- package/dist/component/connect/queries.js +449 -0
- package/dist/component/connect/queries.js.map +1 -0
- package/dist/component/connect/schema.d.ts +258 -0
- package/dist/component/connect/schema.d.ts.map +1 -0
- package/dist/component/connect/schema.js +70 -0
- package/dist/component/connect/schema.js.map +1 -0
- package/dist/component/connect/validators.d.ts +468 -0
- package/dist/component/connect/validators.d.ts.map +1 -0
- package/dist/component/connect/validators.js +250 -0
- package/dist/component/connect/validators.js.map +1 -0
- package/dist/component/convex.config.d.ts +5 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +17 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/core/mutations.d.ts +52 -0
- package/dist/component/core/mutations.d.ts.map +1 -0
- package/dist/component/core/mutations.js +153 -0
- package/dist/component/core/mutations.js.map +1 -0
- package/dist/component/core/queries.d.ts +95 -0
- package/dist/component/core/queries.d.ts.map +1 -0
- package/dist/component/core/queries.js +86 -0
- package/dist/component/core/queries.js.map +1 -0
- package/dist/component/core/schema.d.ts +41 -0
- package/dist/component/core/schema.d.ts.map +1 -0
- package/dist/component/core/schema.js +12 -0
- package/dist/component/core/schema.js.map +1 -0
- package/dist/component/core/validators.d.ts +65 -0
- package/dist/component/core/validators.d.ts.map +1 -0
- package/dist/component/core/validators.js +35 -0
- package/dist/component/core/validators.js.map +1 -0
- package/dist/component/lib/fees.d.ts +74 -0
- package/dist/component/lib/fees.d.ts.map +1 -0
- package/dist/component/lib/fees.js +51 -0
- package/dist/component/lib/fees.js.map +1 -0
- package/dist/component/lib/idempotency.d.ts +9 -0
- package/dist/component/lib/idempotency.d.ts.map +1 -0
- package/dist/component/lib/idempotency.js +18 -0
- package/dist/component/lib/idempotency.js.map +1 -0
- package/dist/component/lib/reversals.d.ts +48 -0
- package/dist/component/lib/reversals.d.ts.map +1 -0
- package/dist/component/lib/reversals.js +79 -0
- package/dist/component/lib/reversals.js.map +1 -0
- package/dist/component/lib/stripeFactory.d.ts +7 -0
- package/dist/component/lib/stripeFactory.d.ts.map +1 -0
- package/dist/component/lib/stripeFactory.js +28 -0
- package/dist/component/lib/stripeFactory.js.map +1 -0
- package/dist/component/products/mutations.d.ts +22 -0
- package/dist/component/products/mutations.d.ts.map +1 -0
- package/dist/component/products/mutations.js +63 -0
- package/dist/component/products/mutations.js.map +1 -0
- package/dist/component/products/queries.d.ts +109 -0
- package/dist/component/products/queries.d.ts.map +1 -0
- package/dist/component/products/queries.js +122 -0
- package/dist/component/products/queries.js.map +1 -0
- package/dist/component/products/schema.d.ts +58 -0
- package/dist/component/products/schema.d.ts.map +1 -0
- package/dist/component/products/schema.js +20 -0
- package/dist/component/products/schema.js.map +1 -0
- package/dist/component/products/validators.d.ts +86 -0
- package/dist/component/products/validators.d.ts.map +1 -0
- package/dist/component/products/validators.js +47 -0
- package/dist/component/products/validators.js.map +1 -0
- package/dist/component/schema.d.ts +555 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +28 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/webhooks/mutations.d.ts +30 -0
- package/dist/component/webhooks/mutations.d.ts.map +1 -0
- package/dist/component/webhooks/mutations.js +124 -0
- package/dist/component/webhooks/mutations.js.map +1 -0
- package/dist/component/webhooks/queries.d.ts +35 -0
- package/dist/component/webhooks/queries.d.ts.map +1 -0
- package/dist/component/webhooks/queries.js +41 -0
- package/dist/component/webhooks/queries.js.map +1 -0
- package/dist/component/webhooks/schema.d.ts +22 -0
- package/dist/component/webhooks/schema.d.ts.map +1 -0
- package/dist/component/webhooks/schema.js +9 -0
- package/dist/component/webhooks/schema.js.map +1 -0
- package/dist/component/webhooks/validators.d.ts +37 -0
- package/dist/component/webhooks/validators.d.ts.map +1 -0
- package/dist/component/webhooks/validators.js +22 -0
- package/dist/component/webhooks/validators.js.map +1 -0
- package/dist/react/components/AccountCloseButton.d.ts +42 -0
- package/dist/react/components/AccountCloseButton.d.ts.map +1 -0
- package/dist/react/components/AccountCloseButton.js +33 -0
- package/dist/react/components/AccountCloseButton.js.map +1 -0
- package/dist/react/components/AccountCloseCard.d.ts +31 -0
- package/dist/react/components/AccountCloseCard.d.ts.map +1 -0
- package/dist/react/components/AccountCloseCard.js +22 -0
- package/dist/react/components/AccountCloseCard.js.map +1 -0
- package/dist/react/components/AccountCreateButton.d.ts +37 -0
- package/dist/react/components/AccountCreateButton.d.ts.map +1 -0
- package/dist/react/components/AccountCreateButton.js +30 -0
- package/dist/react/components/AccountCreateButton.js.map +1 -0
- package/dist/react/components/AccountCreateCard.d.ts +48 -0
- package/dist/react/components/AccountCreateCard.d.ts.map +1 -0
- package/dist/react/components/AccountCreateCard.js +29 -0
- package/dist/react/components/AccountCreateCard.js.map +1 -0
- package/dist/react/components/AccountLoginButton.d.ts +31 -0
- package/dist/react/components/AccountLoginButton.d.ts.map +1 -0
- package/dist/react/components/AccountLoginButton.js +31 -0
- package/dist/react/components/AccountLoginButton.js.map +1 -0
- package/dist/react/components/AccountLoginCard.d.ts +33 -0
- package/dist/react/components/AccountLoginCard.d.ts.map +1 -0
- package/dist/react/components/AccountLoginCard.js +19 -0
- package/dist/react/components/AccountLoginCard.js.map +1 -0
- package/dist/react/components/AccountOnboardingButton.d.ts +37 -0
- package/dist/react/components/AccountOnboardingButton.d.ts.map +1 -0
- package/dist/react/components/AccountOnboardingButton.js +30 -0
- package/dist/react/components/AccountOnboardingButton.js.map +1 -0
- package/dist/react/components/AccountOnboardingCard.d.ts +56 -0
- package/dist/react/components/AccountOnboardingCard.d.ts.map +1 -0
- package/dist/react/components/AccountOnboardingCard.js +36 -0
- package/dist/react/components/AccountOnboardingCard.js.map +1 -0
- package/dist/react/components/AddCardForm.d.ts +18 -0
- package/dist/react/components/AddCardForm.d.ts.map +1 -0
- package/dist/react/components/AddCardForm.js +49 -0
- package/dist/react/components/AddCardForm.js.map +1 -0
- package/dist/react/components/BillingPortalLink.d.ts +23 -0
- package/dist/react/components/BillingPortalLink.d.ts.map +1 -0
- package/dist/react/components/BillingPortalLink.js +55 -0
- package/dist/react/components/BillingPortalLink.js.map +1 -0
- package/dist/react/components/BuyerBillingView.d.ts +80 -0
- package/dist/react/components/BuyerBillingView.d.ts.map +1 -0
- package/dist/react/components/BuyerBillingView.js +44 -0
- package/dist/react/components/BuyerBillingView.js.map +1 -0
- package/dist/react/components/CheckoutSessionProvider.d.ts +34 -0
- package/dist/react/components/CheckoutSessionProvider.d.ts.map +1 -0
- package/dist/react/components/CheckoutSessionProvider.js +38 -0
- package/dist/react/components/CheckoutSessionProvider.js.map +1 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.d.ts +36 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.d.ts.map +1 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.js +36 -0
- package/dist/react/components/CheckoutSessionProviderWithKey.js.map +1 -0
- package/dist/react/components/CheckoutStatus.d.ts +25 -0
- package/dist/react/components/CheckoutStatus.d.ts.map +1 -0
- package/dist/react/components/CheckoutStatus.js +22 -0
- package/dist/react/components/CheckoutStatus.js.map +1 -0
- package/dist/react/components/ConnectProvider.d.ts +29 -0
- package/dist/react/components/ConnectProvider.d.ts.map +1 -0
- package/dist/react/components/ConnectProvider.js +25 -0
- package/dist/react/components/ConnectProvider.js.map +1 -0
- package/dist/react/components/ConnectRequirements.d.ts +55 -0
- package/dist/react/components/ConnectRequirements.d.ts.map +1 -0
- package/dist/react/components/ConnectRequirements.js +58 -0
- package/dist/react/components/ConnectRequirements.js.map +1 -0
- package/dist/react/components/ConnectStatusBadge.d.ts +26 -0
- package/dist/react/components/ConnectStatusBadge.d.ts.map +1 -0
- package/dist/react/components/ConnectStatusBadge.js +20 -0
- package/dist/react/components/ConnectStatusBadge.js.map +1 -0
- package/dist/react/components/DeletePaymentMethodDialog.d.ts +25 -0
- package/dist/react/components/DeletePaymentMethodDialog.d.ts.map +1 -0
- package/dist/react/components/DeletePaymentMethodDialog.js +16 -0
- package/dist/react/components/DeletePaymentMethodDialog.js.map +1 -0
- package/dist/react/components/DisputeDetail.d.ts +42 -0
- package/dist/react/components/DisputeDetail.d.ts.map +1 -0
- package/dist/react/components/DisputeDetail.js +34 -0
- package/dist/react/components/DisputeDetail.js.map +1 -0
- package/dist/react/components/DisputesList.d.ts +42 -0
- package/dist/react/components/DisputesList.d.ts.map +1 -0
- package/dist/react/components/DisputesList.js +47 -0
- package/dist/react/components/DisputesList.js.map +1 -0
- package/dist/react/components/EarningsSummary.d.ts +53 -0
- package/dist/react/components/EarningsSummary.d.ts.map +1 -0
- package/dist/react/components/EarningsSummary.js +37 -0
- package/dist/react/components/EarningsSummary.js.map +1 -0
- package/dist/react/components/EmbeddedCheckout.d.ts +18 -0
- package/dist/react/components/EmbeddedCheckout.d.ts.map +1 -0
- package/dist/react/components/EmbeddedCheckout.js +17 -0
- package/dist/react/components/EmbeddedCheckout.js.map +1 -0
- package/dist/react/components/EmbeddedDisputes.d.ts +21 -0
- package/dist/react/components/EmbeddedDisputes.d.ts.map +1 -0
- package/dist/react/components/EmbeddedDisputes.js +17 -0
- package/dist/react/components/EmbeddedDisputes.js.map +1 -0
- package/dist/react/components/EvidenceForm.d.ts +63 -0
- package/dist/react/components/EvidenceForm.d.ts.map +1 -0
- package/dist/react/components/EvidenceForm.js +79 -0
- package/dist/react/components/EvidenceForm.js.map +1 -0
- package/dist/react/components/IntervalSelector.d.ts +20 -0
- package/dist/react/components/IntervalSelector.d.ts.map +1 -0
- package/dist/react/components/IntervalSelector.js +15 -0
- package/dist/react/components/IntervalSelector.js.map +1 -0
- package/dist/react/components/PaymentMethodActions.d.ts +27 -0
- package/dist/react/components/PaymentMethodActions.d.ts.map +1 -0
- package/dist/react/components/PaymentMethodActions.js +23 -0
- package/dist/react/components/PaymentMethodActions.js.map +1 -0
- package/dist/react/components/PaymentMethodsList.d.ts +32 -0
- package/dist/react/components/PaymentMethodsList.d.ts.map +1 -0
- package/dist/react/components/PaymentMethodsList.js +18 -0
- package/dist/react/components/PaymentMethodsList.js.map +1 -0
- package/dist/react/components/PayoutSchedule.d.ts +55 -0
- package/dist/react/components/PayoutSchedule.d.ts.map +1 -0
- package/dist/react/components/PayoutSchedule.js +51 -0
- package/dist/react/components/PayoutSchedule.js.map +1 -0
- package/dist/react/components/PriceBadge.d.ts +19 -0
- package/dist/react/components/PriceBadge.d.ts.map +1 -0
- package/dist/react/components/PriceBadge.js +25 -0
- package/dist/react/components/PriceBadge.js.map +1 -0
- package/dist/react/components/PriceCard.d.ts +34 -0
- package/dist/react/components/PriceCard.d.ts.map +1 -0
- package/dist/react/components/PriceCard.js +20 -0
- package/dist/react/components/PriceCard.js.map +1 -0
- package/dist/react/components/PricePicker.d.ts +28 -0
- package/dist/react/components/PricePicker.d.ts.map +1 -0
- package/dist/react/components/PricePicker.js +32 -0
- package/dist/react/components/PricePicker.js.map +1 -0
- package/dist/react/components/SplitBreakdown.d.ts +45 -0
- package/dist/react/components/SplitBreakdown.d.ts.map +1 -0
- package/dist/react/components/SplitBreakdown.js +48 -0
- package/dist/react/components/SplitBreakdown.js.map +1 -0
- package/dist/react/components/StripeProvider.d.ts +30 -0
- package/dist/react/components/StripeProvider.d.ts.map +1 -0
- package/dist/react/components/StripeProvider.js +38 -0
- package/dist/react/components/StripeProvider.js.map +1 -0
- package/dist/react/components/StripeProviderWithKey.d.ts +33 -0
- package/dist/react/components/StripeProviderWithKey.d.ts.map +1 -0
- package/dist/react/components/StripeProviderWithKey.js +44 -0
- package/dist/react/components/StripeProviderWithKey.js.map +1 -0
- package/dist/react/components/SubscriptionActions.d.ts +31 -0
- package/dist/react/components/SubscriptionActions.d.ts.map +1 -0
- package/dist/react/components/SubscriptionActions.js +30 -0
- package/dist/react/components/SubscriptionActions.js.map +1 -0
- package/dist/react/components/SubscriptionCard.d.ts +41 -0
- package/dist/react/components/SubscriptionCard.d.ts.map +1 -0
- package/dist/react/components/SubscriptionCard.js +18 -0
- package/dist/react/components/SubscriptionCard.js.map +1 -0
- package/dist/react/components/SubscriptionLineItems.d.ts +23 -0
- package/dist/react/components/SubscriptionLineItems.d.ts.map +1 -0
- package/dist/react/components/SubscriptionLineItems.js +20 -0
- package/dist/react/components/SubscriptionLineItems.js.map +1 -0
- package/dist/react/components/TrialAlert.d.ts +19 -0
- package/dist/react/components/TrialAlert.d.ts.map +1 -0
- package/dist/react/components/TrialAlert.js +16 -0
- package/dist/react/components/TrialAlert.js.map +1 -0
- package/dist/react/hooks/useAccount.d.ts +14 -0
- package/dist/react/hooks/useAccount.d.ts.map +1 -0
- package/dist/react/hooks/useAccount.js +18 -0
- package/dist/react/hooks/useAccount.js.map +1 -0
- package/dist/react/hooks/useAccountOnboarding.d.ts +15 -0
- package/dist/react/hooks/useAccountOnboarding.d.ts.map +1 -0
- package/dist/react/hooks/useAccountOnboarding.js +19 -0
- package/dist/react/hooks/useAccountOnboarding.js.map +1 -0
- package/dist/react/hooks/useCheckout.d.ts +14 -0
- package/dist/react/hooks/useCheckout.d.ts.map +1 -0
- package/dist/react/hooks/useCheckout.js +18 -0
- package/dist/react/hooks/useCheckout.js.map +1 -0
- package/dist/react/hooks/useCheckoutSession.d.ts +62 -0
- package/dist/react/hooks/useCheckoutSession.d.ts.map +1 -0
- package/dist/react/hooks/useCheckoutSession.js +68 -0
- package/dist/react/hooks/useCheckoutSession.js.map +1 -0
- package/dist/react/hooks/useConfirmPayment.d.ts +38 -0
- package/dist/react/hooks/useConfirmPayment.d.ts.map +1 -0
- package/dist/react/hooks/useConfirmPayment.js +91 -0
- package/dist/react/hooks/useConfirmPayment.js.map +1 -0
- package/dist/react/hooks/useDisputeWithCountdown.d.ts +25 -0
- package/dist/react/hooks/useDisputeWithCountdown.d.ts.map +1 -0
- package/dist/react/hooks/useDisputeWithCountdown.js +19 -0
- package/dist/react/hooks/useDisputeWithCountdown.js.map +1 -0
- package/dist/react/hooks/useDisputes.d.ts +14 -0
- package/dist/react/hooks/useDisputes.d.ts.map +1 -0
- package/dist/react/hooks/useDisputes.js +15 -0
- package/dist/react/hooks/useDisputes.js.map +1 -0
- package/dist/react/hooks/useEarnings.d.ts +92 -0
- package/dist/react/hooks/useEarnings.d.ts.map +1 -0
- package/dist/react/hooks/useEarnings.js +35 -0
- package/dist/react/hooks/useEarnings.js.map +1 -0
- package/dist/react/hooks/useInvoices.d.ts +11 -0
- package/dist/react/hooks/useInvoices.d.ts.map +1 -0
- package/dist/react/hooks/useInvoices.js +11 -0
- package/dist/react/hooks/useInvoices.js.map +1 -0
- package/dist/react/hooks/usePaymentMethodActions.d.ts +74 -0
- package/dist/react/hooks/usePaymentMethodActions.d.ts.map +1 -0
- package/dist/react/hooks/usePaymentMethodActions.js +156 -0
- package/dist/react/hooks/usePaymentMethodActions.js.map +1 -0
- package/dist/react/hooks/usePaymentMethods.d.ts +23 -0
- package/dist/react/hooks/usePaymentMethods.d.ts.map +1 -0
- package/dist/react/hooks/usePaymentMethods.js +18 -0
- package/dist/react/hooks/usePaymentMethods.js.map +1 -0
- package/dist/react/hooks/usePrices.d.ts +12 -0
- package/dist/react/hooks/usePrices.d.ts.map +1 -0
- package/dist/react/hooks/usePrices.js +16 -0
- package/dist/react/hooks/usePrices.js.map +1 -0
- package/dist/react/hooks/useProducts.d.ts +10 -0
- package/dist/react/hooks/useProducts.d.ts.map +1 -0
- package/dist/react/hooks/useProducts.js +11 -0
- package/dist/react/hooks/useProducts.js.map +1 -0
- package/dist/react/hooks/useSplitBreakdown.d.ts +58 -0
- package/dist/react/hooks/useSplitBreakdown.d.ts.map +1 -0
- package/dist/react/hooks/useSplitBreakdown.js +59 -0
- package/dist/react/hooks/useSplitBreakdown.js.map +1 -0
- package/dist/react/hooks/useStripeConfig.d.ts +14 -0
- package/dist/react/hooks/useStripeConfig.d.ts.map +1 -0
- package/dist/react/hooks/useStripeConfig.js +21 -0
- package/dist/react/hooks/useStripeConfig.js.map +1 -0
- package/dist/react/hooks/useStripeMode.d.ts +3 -0
- package/dist/react/hooks/useStripeMode.d.ts.map +1 -0
- package/dist/react/hooks/useStripeMode.js +6 -0
- package/dist/react/hooks/useStripeMode.js.map +1 -0
- package/dist/react/hooks/useStripePublishableKey.d.ts +2 -0
- package/dist/react/hooks/useStripePublishableKey.d.ts.map +1 -0
- package/dist/react/hooks/useStripePublishableKey.js +6 -0
- package/dist/react/hooks/useStripePublishableKey.js.map +1 -0
- package/dist/react/hooks/useSubscription.d.ts +17 -0
- package/dist/react/hooks/useSubscription.d.ts.map +1 -0
- package/dist/react/hooks/useSubscription.js +30 -0
- package/dist/react/hooks/useSubscription.js.map +1 -0
- package/dist/react/hooks/useSubscriptions.d.ts +11 -0
- package/dist/react/hooks/useSubscriptions.d.ts.map +1 -0
- package/dist/react/hooks/useSubscriptions.js +13 -0
- package/dist/react/hooks/useSubscriptions.js.map +1 -0
- package/dist/react/index.d.ts +108 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +87 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/lib/connect-requirement-keys.d.ts +14 -0
- package/dist/react/lib/connect-requirement-keys.d.ts.map +1 -0
- package/dist/react/lib/connect-requirement-keys.js +57 -0
- package/dist/react/lib/connect-requirement-keys.js.map +1 -0
- package/dist/react/lib/price-helpers.d.ts +31 -0
- package/dist/react/lib/price-helpers.d.ts.map +1 -0
- package/dist/react/lib/price-helpers.js +46 -0
- package/dist/react/lib/price-helpers.js.map +1 -0
- package/dist/react/lib/stripe-element-styles.d.ts +91 -0
- package/dist/react/lib/stripe-element-styles.d.ts.map +1 -0
- package/dist/react/lib/stripe-element-styles.js +131 -0
- package/dist/react/lib/stripe-element-styles.js.map +1 -0
- package/dist/react/lib/subscription-helpers.d.ts +33 -0
- package/dist/react/lib/subscription-helpers.d.ts.map +1 -0
- package/dist/react/lib/subscription-helpers.js +47 -0
- package/dist/react/lib/subscription-helpers.js.map +1 -0
- package/dist/react/types.d.ts +20 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +2 -0
- package/dist/react/types.js.map +1 -0
- package/dist/testing/assert-test-env.d.ts +6 -0
- package/dist/testing/assert-test-env.d.ts.map +1 -0
- package/dist/testing/assert-test-env.js +15 -0
- package/dist/testing/assert-test-env.js.map +1 -0
- package/dist/testing/fixtures.d.ts +38 -0
- package/dist/testing/fixtures.d.ts.map +1 -0
- package/dist/testing/fixtures.js +54 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-webhooks.d.ts +19 -0
- package/dist/testing/mock-webhooks.d.ts.map +1 -0
- package/dist/testing/mock-webhooks.js +81 -0
- package/dist/testing/mock-webhooks.js.map +1 -0
- package/package.json +131 -0
- package/src/client/billing/checkout.test.ts +1234 -0
- package/src/client/billing/checkout.ts +416 -0
- package/src/client/billing/invoices.test.ts +237 -0
- package/src/client/billing/invoices.ts +93 -0
- package/src/client/billing/subscriptions.test.ts +987 -0
- package/src/client/billing/subscriptions.ts +604 -0
- package/src/client/component-api-types.test.ts +137 -0
- package/src/client/connect/disputes.test.ts +487 -0
- package/src/client/connect/disputes.ts +302 -0
- package/src/client/connect/paymentMethodUtils.test.ts +83 -0
- package/src/client/connect/paymentMethodUtils.ts +28 -0
- package/src/client/connect/paymentMethods.test.ts +66 -0
- package/src/client/connect/paymentMethods.ts +55 -0
- package/src/client/connect/payouts.test.ts +132 -0
- package/src/client/connect/payouts.ts +105 -0
- package/src/client/connect/refundActor.test.ts +121 -0
- package/src/client/connect/refundActor.ts +60 -0
- package/src/client/connect/refunds.test.ts +341 -0
- package/src/client/connect/refunds.ts +256 -0
- package/src/client/connect/transfers.test.ts +492 -0
- package/src/client/connect/transfers.ts +572 -0
- package/src/client/constants.ts +15 -0
- package/src/client/core/accountLinks.test.ts +378 -0
- package/src/client/core/accountLinks.ts +211 -0
- package/src/client/core/accountStatus.test.ts +102 -0
- package/src/client/core/accountStatus.ts +91 -0
- package/src/client/core/accounts.test.ts +1496 -0
- package/src/client/core/accounts.ts +667 -0
- package/src/client/core/config.test.ts +68 -0
- package/src/client/core/config.ts +27 -0
- package/src/client/core/descriptors.test.ts +68 -0
- package/src/client/core/descriptors.ts +46 -0
- package/src/client/core/fees.test.ts +377 -0
- package/src/client/core/fees.ts +268 -0
- package/src/client/errors.test.ts +66 -0
- package/src/client/errors.ts +70 -0
- package/src/client/helpers.test.ts +74 -0
- package/src/client/helpers.ts +94 -0
- package/src/client/index.test.ts +1848 -0
- package/src/client/index.ts +1872 -0
- package/src/client/products/prices.test.ts +345 -0
- package/src/client/products/prices.ts +194 -0
- package/src/client/products/products.test.ts +476 -0
- package/src/client/products/products.ts +335 -0
- package/src/client/setup.test.ts +47 -0
- package/src/client/stripe-types.ts +108 -0
- package/src/client/types/documents.ts +245 -0
- package/src/client/types/events.ts +72 -0
- package/src/client/types/index.ts +43 -0
- package/src/client/types/options.ts +103 -0
- package/src/client/types/triggers.ts +293 -0
- package/src/client/types.ts +35 -0
- package/src/client/utils/data.test.ts +59 -0
- package/src/client/utils/data.ts +22 -0
- package/src/client/utils/owner.test.ts +35 -0
- package/src/client/utils/owner.ts +27 -0
- package/src/client/utils/stripeDashboardUrl.test.ts +71 -0
- package/src/client/utils/stripeDashboardUrl.ts +71 -0
- package/src/client/utils/webhookEndpoints.test.ts +454 -0
- package/src/client/utils/webhookEndpoints.ts +271 -0
- package/src/client/webhook-handlers.test.ts +603 -0
- package/src/client/webhooks/handler.test.ts +604 -0
- package/src/client/webhooks/handler.ts +256 -0
- package/src/client/webhooks/helpers.test.ts +330 -0
- package/src/client/webhooks/helpers.ts +277 -0
- package/src/client/webhooks/hooks.test.ts +111 -0
- package/src/client/webhooks/hooks.ts +177 -0
- package/src/client/webhooks/index.ts +51 -0
- package/src/client/webhooks/processors.test.ts +2392 -0
- package/src/client/webhooks/processors.ts +1166 -0
- package/src/client/webhooks/v2.test.ts +396 -0
- package/src/client/webhooks/v2.ts +124 -0
- package/src/client/webhooks.test.ts +1689 -0
- package/src/client/webhooks.ts +3 -0
- package/src/component/_generated/api.ts +86 -0
- package/src/component/_generated/component.ts +1758 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +164 -0
- package/src/component/billing/mutations.ts +155 -0
- package/src/component/billing/queries.ts +378 -0
- package/src/component/billing/schema.ts +40 -0
- package/src/component/billing/validators.ts +137 -0
- package/src/component/config-queries.test.ts +47 -0
- package/src/component/connect/mutations.ts +624 -0
- package/src/component/connect/queries.ts +537 -0
- package/src/component/connect/schema.ts +90 -0
- package/src/component/connect/validators.ts +333 -0
- package/src/component/connect.test.ts +721 -0
- package/src/component/convex.config.ts +17 -0
- package/src/component/core/mutations.ts +182 -0
- package/src/component/core/queries.ts +100 -0
- package/src/component/core/schema.ts +13 -0
- package/src/component/core/validators.ts +55 -0
- package/src/component/earnings-totals.test.ts +196 -0
- package/src/component/fee-routing.test.ts +124 -0
- package/src/component/lib/fees.ts +64 -0
- package/src/component/lib/idempotency.test.ts +37 -0
- package/src/component/lib/idempotency.ts +20 -0
- package/src/component/lib/reversals.ts +113 -0
- package/src/component/lib/stripeFactory.ts +30 -0
- package/src/component/products/mutations.ts +73 -0
- package/src/component/products/queries.ts +149 -0
- package/src/component/products/schema.ts +22 -0
- package/src/component/products/validators.ts +63 -0
- package/src/component/public.test.ts +1858 -0
- package/src/component/reversal-races.test.ts +920 -0
- package/src/component/schema.ts +45 -0
- package/src/component/subscription-scoping.test.ts +118 -0
- package/src/component/transfers.test.ts +402 -0
- package/src/component/triggers.test.ts +359 -0
- package/src/component/webhooks/mutations.ts +151 -0
- package/src/component/webhooks/queries.ts +44 -0
- package/src/component/webhooks/schema.ts +10 -0
- package/src/component/webhooks/validators.ts +30 -0
- package/src/react/components/AccountCloseButton.tsx +91 -0
- package/src/react/components/AccountCloseCard.tsx +84 -0
- package/src/react/components/AccountCreateButton.tsx +83 -0
- package/src/react/components/AccountCreateCard.tsx +123 -0
- package/src/react/components/AccountLoginButton.tsx +69 -0
- package/src/react/components/AccountLoginCard.tsx +99 -0
- package/src/react/components/AccountOnboardingButton.tsx +83 -0
- package/src/react/components/AccountOnboardingCard.test.ts +27 -0
- package/src/react/components/AccountOnboardingCard.tsx +152 -0
- package/src/react/components/AddCardForm.tsx +80 -0
- package/src/react/components/BillingPortalLink.tsx +93 -0
- package/src/react/components/BuyerBillingView.render.test.tsx +207 -0
- package/src/react/components/BuyerBillingView.tsx +193 -0
- package/src/react/components/CheckoutSessionProvider.tsx +70 -0
- package/src/react/components/CheckoutSessionProviderWithKey.tsx +99 -0
- package/src/react/components/CheckoutStatus.tsx +71 -0
- package/src/react/components/ConnectProvider.tsx +58 -0
- package/src/react/components/ConnectRequirements.tsx +159 -0
- package/src/react/components/ConnectStatusBadge.tsx +60 -0
- package/src/react/components/DeletePaymentMethodDialog.tsx +61 -0
- package/src/react/components/DisputeDetail.render.test.tsx +143 -0
- package/src/react/components/DisputeDetail.tsx +111 -0
- package/src/react/components/DisputesList.render.test.tsx +244 -0
- package/src/react/components/DisputesList.tsx +120 -0
- package/src/react/components/EarningsSummary.render.test.tsx +153 -0
- package/src/react/components/EarningsSummary.tsx +131 -0
- package/src/react/components/EmbeddedCheckout.test.ts +25 -0
- package/src/react/components/EmbeddedCheckout.tsx +54 -0
- package/src/react/components/EmbeddedDisputes.render.test.tsx +142 -0
- package/src/react/components/EmbeddedDisputes.tsx +38 -0
- package/src/react/components/EvidenceForm.render.test.tsx +215 -0
- package/src/react/components/EvidenceForm.tsx +176 -0
- package/src/react/components/IntervalSelector.tsx +58 -0
- package/src/react/components/PaymentMethodActions.tsx +68 -0
- package/src/react/components/PaymentMethodsList.tsx +81 -0
- package/src/react/components/PayoutSchedule.render.test.tsx +178 -0
- package/src/react/components/PayoutSchedule.tsx +148 -0
- package/src/react/components/PriceBadge.render.test.tsx +134 -0
- package/src/react/components/PriceBadge.tsx +49 -0
- package/src/react/components/PriceCard.render.test.tsx +135 -0
- package/src/react/components/PriceCard.tsx +83 -0
- package/src/react/components/PricePicker.tsx +95 -0
- package/src/react/components/SplitBreakdown.render.test.tsx +168 -0
- package/src/react/components/SplitBreakdown.tsx +121 -0
- package/src/react/components/StripeProvider.test.ts +45 -0
- package/src/react/components/StripeProvider.tsx +80 -0
- package/src/react/components/StripeProviderWithKey.tsx +95 -0
- package/src/react/components/SubscriptionActions.tsx +79 -0
- package/src/react/components/SubscriptionCard.tsx +92 -0
- package/src/react/components/SubscriptionLineItems.tsx +62 -0
- package/src/react/components/TrialAlert.render.test.tsx +132 -0
- package/src/react/components/TrialAlert.tsx +44 -0
- package/src/react/hooks/skipSentinel.test.ts +85 -0
- package/src/react/hooks/useAccount.ts +28 -0
- package/src/react/hooks/useAccountOnboarding.test.ts +75 -0
- package/src/react/hooks/useAccountOnboarding.ts +35 -0
- package/src/react/hooks/useCheckout.ts +33 -0
- package/src/react/hooks/useCheckoutSession.ts +110 -0
- package/src/react/hooks/useConfirmPayment.ts +117 -0
- package/src/react/hooks/useDisputeWithCountdown.test.ts +90 -0
- package/src/react/hooks/useDisputeWithCountdown.ts +48 -0
- package/src/react/hooks/useDisputes.test.ts +75 -0
- package/src/react/hooks/useDisputes.ts +28 -0
- package/src/react/hooks/useEarnings.test.ts +159 -0
- package/src/react/hooks/useEarnings.ts +132 -0
- package/src/react/hooks/useInvoices.test.ts +79 -0
- package/src/react/hooks/useInvoices.ts +25 -0
- package/src/react/hooks/usePaymentMethodActions.ts +206 -0
- package/src/react/hooks/usePaymentMethods.ts +44 -0
- package/src/react/hooks/usePrices.ts +26 -0
- package/src/react/hooks/useProducts.test.ts +75 -0
- package/src/react/hooks/useProducts.ts +24 -0
- package/src/react/hooks/useSplitBreakdown.test.ts +151 -0
- package/src/react/hooks/useSplitBreakdown.ts +118 -0
- package/src/react/hooks/useStripeConfig.ts +31 -0
- package/src/react/hooks/useStripeMode.test.ts +49 -0
- package/src/react/hooks/useStripeMode.ts +9 -0
- package/src/react/hooks/useStripePublishableKey.test.ts +35 -0
- package/src/react/hooks/useStripePublishableKey.ts +9 -0
- package/src/react/hooks/useSubscription.ts +52 -0
- package/src/react/hooks/useSubscriptions.ts +33 -0
- package/src/react/index.payment-element.test.ts +41 -0
- package/src/react/index.test.ts +167 -0
- package/src/react/index.ts +279 -0
- package/src/react/lib/connect-requirement-keys.test.ts +73 -0
- package/src/react/lib/connect-requirement-keys.ts +66 -0
- package/src/react/lib/price-helpers.test.ts +199 -0
- package/src/react/lib/price-helpers.ts +68 -0
- package/src/react/lib/stripe-element-styles.test.ts +94 -0
- package/src/react/lib/stripe-element-styles.ts +178 -0
- package/src/react/lib/subscription-helpers.test.ts +127 -0
- package/src/react/lib/subscription-helpers.ts +64 -0
- package/src/react/types.ts +32 -0
- package/src/test.ts +5 -0
- package/src/testing/assert-test-env.test.ts +33 -0
- package/src/testing/assert-test-env.ts +20 -0
- package/src/testing/fixtures.ts +95 -0
- package/src/testing/index.ts +13 -0
- package/src/testing/mock-webhooks.test.ts +97 -0
- package/src/testing/mock-webhooks.ts +101 -0
- package/src/vite-env.d.ts +4 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
import { AccountOnboardingButton } from "./AccountOnboardingButton.js";
|
|
6
|
+
|
|
7
|
+
export type AccountOnboardingCardRenderProps = {
|
|
8
|
+
status: string | undefined;
|
|
9
|
+
isComplete: boolean;
|
|
10
|
+
progress: number;
|
|
11
|
+
missingRequirements: string[];
|
|
12
|
+
onContinue?: () => void;
|
|
13
|
+
onReset?: () => void;
|
|
14
|
+
dashboardUrl?: string;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type AccountOnboardingCardProps = {
|
|
19
|
+
status: "pending" | "in_progress" | "complete" | "restricted" | undefined;
|
|
20
|
+
missingRequirements?: string[];
|
|
21
|
+
onContinue?: () => void;
|
|
22
|
+
onReset?: () => void;
|
|
23
|
+
/** Externally computed progress (0–100). If omitted, derived from status. */
|
|
24
|
+
progress?: number;
|
|
25
|
+
/** URL to open when onboarding is complete */
|
|
26
|
+
dashboardUrl?: string;
|
|
27
|
+
/** Whether an async action is in progress */
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
titleLabel?: string;
|
|
30
|
+
completeLabel?: string;
|
|
31
|
+
continueLabel?: string;
|
|
32
|
+
resetLabel?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Render prop for a progress bar section */
|
|
35
|
+
renderProgress?: (props: { progress: number }) => ReactNode;
|
|
36
|
+
/** Render prop for step-by-step checklist */
|
|
37
|
+
renderSteps?: (props: { status: string | undefined }) => ReactNode;
|
|
38
|
+
/** Render prop for a status badge */
|
|
39
|
+
renderStatusBadge?: () => ReactNode;
|
|
40
|
+
/** Render prop for requirements section */
|
|
41
|
+
renderRequirements?: () => ReactNode;
|
|
42
|
+
/** Render prop for the reset confirmation UI (e.g. a modal trigger) */
|
|
43
|
+
renderResetConfirmation?: (props: { onConfirm: () => void }) => ReactNode;
|
|
44
|
+
/** Render prop for the dashboard link shown when onboarding is complete */
|
|
45
|
+
renderDashboardLink?: (props: { url: string; label: string }) => ReactNode;
|
|
46
|
+
/** Full render prop — overrides all default rendering */
|
|
47
|
+
children?: (props: AccountOnboardingCardRenderProps) => ReactNode;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Headless Connect account onboarding progress card.
|
|
52
|
+
*/
|
|
53
|
+
export function AccountOnboardingCard({
|
|
54
|
+
status,
|
|
55
|
+
missingRequirements = [],
|
|
56
|
+
onContinue,
|
|
57
|
+
onReset,
|
|
58
|
+
progress: externalProgress,
|
|
59
|
+
dashboardUrl,
|
|
60
|
+
isLoading = false,
|
|
61
|
+
titleLabel = "Account setup",
|
|
62
|
+
completeLabel = "Your account is verified and ready.",
|
|
63
|
+
continueLabel = "Continue setup",
|
|
64
|
+
resetLabel = "Reset account",
|
|
65
|
+
className,
|
|
66
|
+
renderProgress,
|
|
67
|
+
renderSteps,
|
|
68
|
+
renderStatusBadge,
|
|
69
|
+
renderRequirements,
|
|
70
|
+
renderResetConfirmation,
|
|
71
|
+
renderDashboardLink,
|
|
72
|
+
children,
|
|
73
|
+
}: AccountOnboardingCardProps) {
|
|
74
|
+
const isComplete = status === "complete";
|
|
75
|
+
const progress =
|
|
76
|
+
externalProgress ??
|
|
77
|
+
(status === "complete"
|
|
78
|
+
? 100
|
|
79
|
+
: status === "in_progress"
|
|
80
|
+
? 50
|
|
81
|
+
: status === "restricted"
|
|
82
|
+
? 25
|
|
83
|
+
: 0);
|
|
84
|
+
|
|
85
|
+
if (children) {
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
{children({
|
|
89
|
+
status,
|
|
90
|
+
isComplete,
|
|
91
|
+
progress,
|
|
92
|
+
missingRequirements,
|
|
93
|
+
onContinue,
|
|
94
|
+
onReset,
|
|
95
|
+
dashboardUrl,
|
|
96
|
+
isLoading,
|
|
97
|
+
})}
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<div className={className}>
|
|
104
|
+
<div>
|
|
105
|
+
<h3>{titleLabel}</h3>
|
|
106
|
+
{renderStatusBadge?.()}
|
|
107
|
+
</div>
|
|
108
|
+
{renderProgress?.({ progress })}
|
|
109
|
+
{renderSteps?.({ status })}
|
|
110
|
+
{isComplete ? (
|
|
111
|
+
<>
|
|
112
|
+
<p>{completeLabel}</p>
|
|
113
|
+
{dashboardUrl &&
|
|
114
|
+
(renderDashboardLink ? (
|
|
115
|
+
renderDashboardLink({
|
|
116
|
+
url: dashboardUrl,
|
|
117
|
+
label: "Open dashboard",
|
|
118
|
+
})
|
|
119
|
+
) : (
|
|
120
|
+
<a href={dashboardUrl} target="_blank" rel="noopener noreferrer">
|
|
121
|
+
Open dashboard
|
|
122
|
+
</a>
|
|
123
|
+
))}
|
|
124
|
+
</>
|
|
125
|
+
) : (
|
|
126
|
+
<>
|
|
127
|
+
{missingRequirements.length > 0 && (
|
|
128
|
+
<p>{missingRequirements.length} items remaining</p>
|
|
129
|
+
)}
|
|
130
|
+
{renderRequirements?.()}
|
|
131
|
+
<div>
|
|
132
|
+
{onReset &&
|
|
133
|
+
(renderResetConfirmation ? (
|
|
134
|
+
renderResetConfirmation({ onConfirm: onReset })
|
|
135
|
+
) : (
|
|
136
|
+
<button type="button" onClick={onReset} disabled={isLoading}>
|
|
137
|
+
{resetLabel}
|
|
138
|
+
</button>
|
|
139
|
+
))}
|
|
140
|
+
{onContinue && (
|
|
141
|
+
<AccountOnboardingButton
|
|
142
|
+
onContinue={onContinue}
|
|
143
|
+
isLoading={isLoading}
|
|
144
|
+
continueLabel={continueLabel}
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
</>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type ReactNode, useState } from "react";
|
|
4
|
+
|
|
5
|
+
import { CardElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
6
|
+
|
|
7
|
+
export type AddCardFormProps = {
|
|
8
|
+
onSuccess?: (paymentMethodId: string) => void;
|
|
9
|
+
onError?: (error: string) => void;
|
|
10
|
+
submitLabel?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: (props: {
|
|
13
|
+
handleSubmit: () => Promise<void>;
|
|
14
|
+
isProcessing: boolean;
|
|
15
|
+
error: string | null;
|
|
16
|
+
}) => ReactNode;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Headless add card / payment method form.
|
|
21
|
+
* Must be rendered inside a StripeProvider.
|
|
22
|
+
*/
|
|
23
|
+
export function AddCardForm({
|
|
24
|
+
onSuccess,
|
|
25
|
+
onError,
|
|
26
|
+
submitLabel = "Add card",
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
}: AddCardFormProps) {
|
|
30
|
+
const stripe = useStripe();
|
|
31
|
+
const elements = useElements();
|
|
32
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
33
|
+
const [error, setError] = useState<string | null>(null);
|
|
34
|
+
|
|
35
|
+
const handleSubmit = async () => {
|
|
36
|
+
if (!stripe || !elements || isProcessing) return;
|
|
37
|
+
const cardElement = elements.getElement(CardElement);
|
|
38
|
+
if (!cardElement) return;
|
|
39
|
+
|
|
40
|
+
setIsProcessing(true);
|
|
41
|
+
setError(null);
|
|
42
|
+
try {
|
|
43
|
+
const { error: stripeError, paymentMethod } =
|
|
44
|
+
await stripe.createPaymentMethod({ type: "card", card: cardElement });
|
|
45
|
+
if (stripeError) {
|
|
46
|
+
const message = stripeError.message ?? "Failed to add card";
|
|
47
|
+
setError(message);
|
|
48
|
+
onError?.(message);
|
|
49
|
+
} else if (paymentMethod) {
|
|
50
|
+
onSuccess?.(paymentMethod.id);
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
// createPaymentMethod normally resolves with { error }, but network
|
|
54
|
+
// failures and timeouts reject — surface those the same way.
|
|
55
|
+
const message = err instanceof Error ? err.message : "Failed to add card";
|
|
56
|
+
setError(message);
|
|
57
|
+
onError?.(message);
|
|
58
|
+
} finally {
|
|
59
|
+
setIsProcessing(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (children) {
|
|
64
|
+
return <>{children({ handleSubmit, isProcessing, error })}</>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className={className}>
|
|
69
|
+
<CardElement />
|
|
70
|
+
{error && <div role="alert">{error}</div>}
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
onClick={handleSubmit}
|
|
74
|
+
disabled={!stripe || isProcessing}
|
|
75
|
+
>
|
|
76
|
+
{submitLabel}
|
|
77
|
+
</button>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type ReactNode, useState } from "react";
|
|
4
|
+
|
|
5
|
+
export type BillingPortalLinkProps = {
|
|
6
|
+
/** URL to Stripe billing portal (from createBillingPortalSession) */
|
|
7
|
+
portalUrl?: string | null;
|
|
8
|
+
/** Called to create a billing portal session on demand */
|
|
9
|
+
onCreateSession?: () => Promise<string | void>;
|
|
10
|
+
/** Called when onCreateSession throws; failures are also logged to the console */
|
|
11
|
+
onError?: (error: string) => void;
|
|
12
|
+
label?: string;
|
|
13
|
+
loadingLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
children?: (props: {
|
|
16
|
+
url: string | null;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
}) => ReactNode;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Headless billing portal link/button.
|
|
24
|
+
* Opens Stripe's hosted billing portal for subscription management.
|
|
25
|
+
*/
|
|
26
|
+
export function BillingPortalLink({
|
|
27
|
+
portalUrl,
|
|
28
|
+
onCreateSession,
|
|
29
|
+
onError,
|
|
30
|
+
label = "Manage billing",
|
|
31
|
+
loadingLabel = "Loading...",
|
|
32
|
+
className,
|
|
33
|
+
children,
|
|
34
|
+
}: BillingPortalLinkProps) {
|
|
35
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
36
|
+
|
|
37
|
+
const handleClick = async () => {
|
|
38
|
+
if (portalUrl) {
|
|
39
|
+
window.open(portalUrl, "_blank");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (onCreateSession && !isLoading) {
|
|
43
|
+
// Open synchronously inside the user gesture so popup blockers allow it;
|
|
44
|
+
// navigate it once the session URL arrives.
|
|
45
|
+
const portalWindow = window.open("", "_blank");
|
|
46
|
+
setIsLoading(true);
|
|
47
|
+
try {
|
|
48
|
+
const url = await onCreateSession();
|
|
49
|
+
if (url) {
|
|
50
|
+
if (portalWindow) {
|
|
51
|
+
portalWindow.location.href = url;
|
|
52
|
+
} else {
|
|
53
|
+
// Popup was blocked anyway — fall back to same-tab navigation.
|
|
54
|
+
window.location.href = url;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
portalWindow?.close();
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
portalWindow?.close();
|
|
61
|
+
const message =
|
|
62
|
+
err instanceof Error ? err.message : "Failed to open billing portal";
|
|
63
|
+
console.error("[better-stripe] BillingPortalLink:", err);
|
|
64
|
+
onError?.(message);
|
|
65
|
+
} finally {
|
|
66
|
+
setIsLoading(false);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
if (children) {
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{children({
|
|
75
|
+
url: portalUrl ?? null,
|
|
76
|
+
onClick: handleClick,
|
|
77
|
+
isLoading,
|
|
78
|
+
})}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
onClick={handleClick}
|
|
87
|
+
className={className}
|
|
88
|
+
disabled={isLoading}
|
|
89
|
+
>
|
|
90
|
+
{isLoading ? loadingLabel : label}
|
|
91
|
+
</button>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behavioral render tests for <BuyerBillingView> (BTS-39).
|
|
3
|
+
*
|
|
4
|
+
* BuyerBillingView is the buyer's in-app, embedded-only billing surface: it
|
|
5
|
+
* shows the buyer their subscriptions grouped by store (reusing the client
|
|
6
|
+
* `groupSubscriptionsByStore` util — the REUSEPROFILE per-store view) with
|
|
7
|
+
* per-store cancel/reactivate, plus the ONE reusable saved payment method that
|
|
8
|
+
* spans every store and an embedded (no-redirect) card-update slot.
|
|
9
|
+
*
|
|
10
|
+
* Like the other headless components it is pure and hook-free (the app feeds it
|
|
11
|
+
* the buyer's subscriptions + saved card via the existing queries/hooks), so we
|
|
12
|
+
* render it to a static HTML string with react-dom/server (no jsdom) and assert
|
|
13
|
+
* on the markup.
|
|
14
|
+
*/
|
|
15
|
+
import { createElement } from "react";
|
|
16
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
17
|
+
import { describe, expect, it } from "vitest";
|
|
18
|
+
|
|
19
|
+
import { BuyerBillingView as BarrelExport } from "../index.js";
|
|
20
|
+
import {
|
|
21
|
+
BuyerBillingView,
|
|
22
|
+
type BuyerBillingSubscription,
|
|
23
|
+
type BuyerBillingViewRenderProps,
|
|
24
|
+
} from "./BuyerBillingView.js";
|
|
25
|
+
|
|
26
|
+
const activeSub: BuyerBillingSubscription = {
|
|
27
|
+
id: "sub_active",
|
|
28
|
+
destinationAccountId: "acct_store_a",
|
|
29
|
+
status: "active",
|
|
30
|
+
isTrialing: false,
|
|
31
|
+
cancelAtPeriodEnd: false,
|
|
32
|
+
currentPeriodEnd: "2026-08-01T00:00:00.000Z",
|
|
33
|
+
productName: "Store A Pro",
|
|
34
|
+
price: {
|
|
35
|
+
unitAmount: 1500,
|
|
36
|
+
currency: "usd",
|
|
37
|
+
interval: "month",
|
|
38
|
+
intervalCount: 1,
|
|
39
|
+
type: "recurring",
|
|
40
|
+
active: true,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const cancelingSub: BuyerBillingSubscription = {
|
|
45
|
+
id: "sub_canceling",
|
|
46
|
+
destinationAccountId: "acct_store_b",
|
|
47
|
+
status: "active",
|
|
48
|
+
isTrialing: false,
|
|
49
|
+
cancelAtPeriodEnd: true,
|
|
50
|
+
currentPeriodEnd: "2026-08-01T00:00:00.000Z",
|
|
51
|
+
productName: "Store B Basic",
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const paymentMethod = {
|
|
55
|
+
id: "pm_1",
|
|
56
|
+
type: "card",
|
|
57
|
+
card: { brand: "visa", last4: "4242", expMonth: 12, expYear: 2030 },
|
|
58
|
+
isDefault: true,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
describe("BuyerBillingView", () => {
|
|
62
|
+
it("renders the loading label while data is pending", () => {
|
|
63
|
+
const html = renderToStaticMarkup(
|
|
64
|
+
createElement(BuyerBillingView, { isLoading: true }),
|
|
65
|
+
);
|
|
66
|
+
expect(html).toContain("Loading billing");
|
|
67
|
+
expect(html).toContain('role="status"');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("renders the empty label with no subscriptions and no saved card", () => {
|
|
71
|
+
const html = renderToStaticMarkup(
|
|
72
|
+
createElement(BuyerBillingView, { subscriptions: [], paymentMethod: null }),
|
|
73
|
+
);
|
|
74
|
+
expect(html).toContain("No billing yet");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("groups subscriptions by store, first-seen order preserved", () => {
|
|
78
|
+
const html = renderToStaticMarkup(
|
|
79
|
+
createElement(BuyerBillingView, {
|
|
80
|
+
subscriptions: [activeSub, cancelingSub],
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
// Both store groups render, each with its own subscription.
|
|
84
|
+
expect(html).toContain("acct_store_a");
|
|
85
|
+
expect(html).toContain("acct_store_b");
|
|
86
|
+
expect(html).toContain("Store A Pro");
|
|
87
|
+
expect(html).toContain("Store B Basic");
|
|
88
|
+
// Order preserved: store A appears before store B.
|
|
89
|
+
expect(html.indexOf("acct_store_a")).toBeLessThan(
|
|
90
|
+
html.indexOf("acct_store_b"),
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("shows the reusable saved payment method spanning all stores", () => {
|
|
95
|
+
const html = renderToStaticMarkup(
|
|
96
|
+
createElement(BuyerBillingView, {
|
|
97
|
+
subscriptions: [activeSub],
|
|
98
|
+
paymentMethod,
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
// Brand + last4, and the reusable-across-stores note.
|
|
102
|
+
expect(html.toLowerCase()).toContain("visa");
|
|
103
|
+
expect(html).toContain("4242");
|
|
104
|
+
expect(html).toContain("Used across all stores");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("offers per-store cancel on an active subscription and reactivate on a canceling one", () => {
|
|
108
|
+
const html = renderToStaticMarkup(
|
|
109
|
+
createElement(BuyerBillingView, {
|
|
110
|
+
subscriptions: [activeSub, cancelingSub],
|
|
111
|
+
onCancel: () => {},
|
|
112
|
+
onReactivate: () => {},
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
// active (not canceling) → cancel; active + cancelAtPeriodEnd → reactivate.
|
|
116
|
+
expect(html).toContain("Cancel subscription");
|
|
117
|
+
expect(html).toContain("Reactivate");
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("renders an embedded card-update surface (no redirect link)", () => {
|
|
121
|
+
const html = renderToStaticMarkup(
|
|
122
|
+
createElement(BuyerBillingView, {
|
|
123
|
+
subscriptions: [activeSub],
|
|
124
|
+
paymentMethod,
|
|
125
|
+
updateCardSlot: createElement("div", { "data-testid": "embedded-card" }),
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
expect(html).toContain('data-testid="embedded-card"');
|
|
129
|
+
expect(html).toContain("Update card");
|
|
130
|
+
// Embedded means in-app — never a redirect anchor.
|
|
131
|
+
expect(html).not.toContain("<a");
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("resolves store display names via the storeName override", () => {
|
|
135
|
+
const html = renderToStaticMarkup(
|
|
136
|
+
createElement(BuyerBillingView, {
|
|
137
|
+
subscriptions: [activeSub],
|
|
138
|
+
storeName: (id: string | null) =>
|
|
139
|
+
id === "acct_store_a" ? "Acme Store" : "Other",
|
|
140
|
+
}),
|
|
141
|
+
);
|
|
142
|
+
expect(html).toContain("Acme Store");
|
|
143
|
+
expect(html).not.toContain("acct_store_a");
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("labels the platform-direct (null store) group", () => {
|
|
147
|
+
const platformSub: BuyerBillingSubscription = {
|
|
148
|
+
...activeSub,
|
|
149
|
+
id: "sub_platform",
|
|
150
|
+
destinationAccountId: undefined,
|
|
151
|
+
};
|
|
152
|
+
const html = renderToStaticMarkup(
|
|
153
|
+
createElement(BuyerBillingView, {
|
|
154
|
+
subscriptions: [platformSub],
|
|
155
|
+
platformStoreLabel: "Direct",
|
|
156
|
+
}),
|
|
157
|
+
);
|
|
158
|
+
expect(html).toContain("Direct");
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("honours i18n label overrides", () => {
|
|
162
|
+
const html = renderToStaticMarkup(
|
|
163
|
+
createElement(BuyerBillingView, {
|
|
164
|
+
subscriptions: [activeSub],
|
|
165
|
+
paymentMethod,
|
|
166
|
+
paymentMethodHeading: "Your card",
|
|
167
|
+
reusableNoteLabel: "Reused everywhere",
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
expect(html).toContain("Your card");
|
|
171
|
+
expect(html).toContain("Reused everywhere");
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it("applies className to the root element", () => {
|
|
175
|
+
const html = renderToStaticMarkup(
|
|
176
|
+
createElement(BuyerBillingView, {
|
|
177
|
+
subscriptions: [activeSub],
|
|
178
|
+
className: "buyer-billing",
|
|
179
|
+
}),
|
|
180
|
+
);
|
|
181
|
+
expect(html).toContain('class="buyer-billing"');
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("invokes the children render-prop with grouped billing state", () => {
|
|
185
|
+
let received: BuyerBillingViewRenderProps | undefined;
|
|
186
|
+
renderToStaticMarkup(
|
|
187
|
+
createElement(BuyerBillingView, {
|
|
188
|
+
subscriptions: [activeSub, cancelingSub],
|
|
189
|
+
paymentMethod,
|
|
190
|
+
children: (props: BuyerBillingViewRenderProps) => {
|
|
191
|
+
received = props;
|
|
192
|
+
return createElement("section", null, "custom");
|
|
193
|
+
},
|
|
194
|
+
}),
|
|
195
|
+
);
|
|
196
|
+
expect(received!.groups).toHaveLength(2);
|
|
197
|
+
expect(received!.groups[0].storeAccountId).toBe("acct_store_a");
|
|
198
|
+
expect(received!.groups[1].storeAccountId).toBe("acct_store_b");
|
|
199
|
+
expect(received!.paymentMethod).toBe(paymentMethod);
|
|
200
|
+
expect(received!.paymentMethodLabel?.toLowerCase()).toContain("visa");
|
|
201
|
+
expect(received!.paymentMethodLabel).toContain("4242");
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("exports from the correct module via the react barrel", () => {
|
|
205
|
+
expect(BarrelExport).toBe(BuyerBillingView);
|
|
206
|
+
});
|
|
207
|
+
});
|