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.
Source
Thrown at packages/backend/server/src/plugins/payment/resolver.ts:309
session = await this.service.checkout(input, {
plan: input.plan as any,
quantity: input.args?.quantity ?? 10,
user,
});
} else {
if (!user) {
throw new AuthenticationRequired();
}
session = await this.service.checkout(input, {
plan: input.plan as any,
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 b4c8548c09)
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@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/2cee6ed19a4f4a17.
Report an issue: GitHub.