File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/playground-web/src/app/api/paywall Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export async function GET(request: NextRequest) {
4141
4242 const amount = queryParams . get ( "amount" ) || "0.01" ;
4343 const payTo = queryParams . get ( "payTo" ) ?? undefined ;
44- const tokenAddress = queryParams . get ( "tokenAddress" ) || token . address ;
44+ const tokenAddress = queryParams . get ( "tokenAddress" ) ;
4545 const decimals = queryParams . get ( "decimals" ) || token . decimals . toString ( ) ;
4646 const waitUntil =
4747 ( queryParams . get ( "waitUntil" ) as "simulated" | "submitted" | "confirmed" ) ||
@@ -53,13 +53,13 @@ export async function GET(request: NextRequest) {
5353 paymentData,
5454 network : defineChain ( Number ( chainId ) ) ,
5555 payTo,
56- price : {
56+ price : tokenAddress ? {
5757 amount : toUnits ( amount , parseInt ( decimals ) ) . toString ( ) ,
5858 asset : {
5959 address : tokenAddress as `0x${string } `,
6060 decimals : decimals ? parseInt ( decimals ) : token . decimals ,
6161 } ,
62- } ,
62+ } : amount ,
6363 routeConfig : {
6464 description : "Access to paid content" ,
6565 } ,
You can’t perform that action at this time.
0 commit comments