11import { HTTPException } from 'hono/http-exception'
22import z from 'zod'
3- import { zValidator } from '@hono/zod-validator'
43import { urlWithParams } from '@shared/utils'
54import { app } from '../../app'
65import { PaymentIdSchema } from '../../schemas/payment'
76import { OpenPaymentsService } from '../../utils/open-payments'
87import { getData , setData } from '../../utils/payments-kv'
9- import { createHTTPException } from '../../utils/utils'
8+ import { createHTTPException , validate } from '../../utils/utils'
109
1110export const PaymentStatusSuccessSchema = z . object ( {
1211 hash : z . string ( ) . min ( 1 , 'Hash is required' ) ,
@@ -33,8 +32,8 @@ export type PaymentStatusRejected = z.infer<typeof PaymentStatusRejectedSchema>
3332// as grant is accepted, outgoing-payment will be created.
3433app . get (
3534 '/payment/redirect/:paymentId' ,
36- zValidator ( 'param' , z . object ( { paymentId : PaymentIdSchema } ) ) ,
37- zValidator ( 'query' , PaymentStatusSchema ) ,
35+ validate ( 'param' , z . object ( { paymentId : PaymentIdSchema } ) ) ,
36+ validate ( 'query' , PaymentStatusSchema ) ,
3837 async ( { req, redirect, env } ) => {
3938 try {
4039 const openPayments = await OpenPaymentsService . getInstance ( env )
0 commit comments