toeverything/AFFiNE · error · FailedToCheckout
failed_to_checkout
failed_to_checkout
Error message
Failed to create checkout session.
What it means
createCheckoutSession checks the returned Stripe session for a URL and throws FailedToCheckout when it is missing, converting a technically-successful-but-unusable Stripe response into an explicit checkout failure.
Solutions
- Check the payment provider credentials and configuration on the server.
- Verify the requested plan and price exist in the payment system.
- Inspect server logs for the upstream error and retry after fixing the configuration.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/backend/server/src/plugins/payment/resolver.ts:309 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of toeverything/AFFiNE@2af30773ae (2026-08-18).
Data as JSON: /api/errors/2cee6ed19a4f4a17.
Report an issue: GitHub.
Appendix: source
Thrown at packages/backend/server/src/plugins/payment/resolver.ts:325
if (input.plan === SubscriptionPlan.Team) {
const workspaceId = input.args?.workspaceId;
if (!workspaceId) {
throw new WorkspaceIdRequiredToUpdateTeamSubscription();
}
await this.ac
.user(user.id)
.workspace(workspaceId)
.assert('Workspace.Payment.Manage');
}
session = await this.service.checkout(input, {
user,
workspaceId: input.args?.workspaceId,
});
}
if (!session.url) {
throw new FailedToCheckout();
}
return session.url;
}
@Mutation(() => String, {
description: 'Create a stripe customer portal to manage payment methods',
})
async createCustomerPortal(@CurrentUser() user: CurrentUser) {
return this.service.createCustomerPortal(user.id);
}
@Mutation(() => SubscriptionType)
async cancelSubscription(
@CurrentUser() user: CurrentUser,
@Args({
name: 'plan',
type: () => SubscriptionPlan,View on GitHub (pinned to 2af30773ae)