Commit eb1c705
committed
[Dashboard] Improve error handling in billing checkout process (#7318)
# Add "Go back" button to Stripe redirect error page and improve error handling
This PR enhances the Stripe redirect error page by adding a "Go back" button, allowing users to navigate away from error states. It also improves error handling in the billing checkout flow by:
1. Converting `getBillingCheckoutUrl()` to return structured responses with proper error messages
2. Adding specific error messages for different HTTP status codes (402 for outstanding invoices, 429 for rate limiting)
3. Displaying these more descriptive error messages to users when checkout fails
These changes provide a better user experience when errors occur during the checkout process.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added a "Go back" button to the Stripe redirect error page, allowing users to easily return to the previous screen.
- **Bug Fixes**
- Improved error handling during the checkout process, providing clearer error messages for issues such as authentication, outstanding invoices, rate limiting, and unknown errors. Error messages are now displayed directly on the error page when checkout fails.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 9643b8d commit eb1c705
File tree
3 files changed
+54
-12
lines changed- apps/dashboard/src/app/(app)/(stripe)
- _components
- checkout/[team_slug]/[sku]
- utils
3 files changed
+54
-12
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | 29 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 66 | + | |
| 67 | + | |
70 | 68 | | |
71 | 69 | | |
72 | | - | |
| 70 | + | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | | - | |
33 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
34 | 58 | | |
35 | 59 | | |
36 | 60 | | |
37 | 61 | | |
38 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
39 | 66 | | |
40 | 67 | | |
41 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
42 | 72 | | |
43 | 73 | | |
44 | 74 | | |
| |||
0 commit comments