@@ -17,15 +17,21 @@ export default async function CheckoutPage(props: {
1717 searchParams : Promise < {
1818 amount ?: string ;
1919 invoice_id ?: string ;
20+ project_id ?: string ;
21+ chain_id ?: string | string [ ] ;
2022 } > ;
2123} ) {
22- const params = await props . params ;
24+ const [ params , searchParams ] = await Promise . all ( [
25+ props . params ,
26+ props . searchParams ,
27+ ] ) ;
28+
29+ console . log ( "params" , params ) ;
30+ console . log ( "searchParams" , searchParams ) ;
2331
2432 switch ( params . sku ) {
2533 case "topup" : {
26- const amountUSD = Number . parseInt (
27- ( await props . searchParams ) . amount || "10" ,
28- ) ;
34+ const amountUSD = Number . parseInt ( searchParams . amount || "10" ) ;
2935 if ( Number . isNaN ( amountUSD ) ) {
3036 return < StripeRedirectErrorPage errorMessage = "Invalid amount" /> ;
3137 }
@@ -43,7 +49,7 @@ export default async function CheckoutPage(props: {
4349 break ;
4450 }
4551 case "invoice" : {
46- const invoiceId = ( await props . searchParams ) . invoice_id ;
52+ const invoiceId = searchParams . invoice_id ;
4753 if ( ! invoiceId ) {
4854 return < StripeRedirectErrorPage errorMessage = "Invalid invoice ID" /> ;
4955 }
@@ -59,10 +65,12 @@ export default async function CheckoutPage(props: {
5965 redirect ( invoice ) ;
6066 break ;
6167 }
68+
6269 default : {
6370 const response = await getBillingCheckoutUrl ( {
6471 sku : decodeURIComponent ( params . sku ) as Exclude < ProductSKU , null > ,
6572 teamSlug : params . team_slug ,
73+ params : searchParams ,
6674 } ) ;
6775
6876 if ( response . status === "error" ) {
0 commit comments