import express from "express";

import { Payment } from "$controllers/index.js";
import {
  ensureSepahVerified,
  ensureTadbirVerified,
  jwt,
  requireSejamVerified,
} from "$middlewares/index.js";

const router = express.Router();

router.post(
  "/fund/:fundId/confirm",
  jwt,
  requireSejamVerified,
  ensureSepahVerified,
  ensureTadbirVerified,
  Payment.CONFIRM,
);
router.post(
  "/sepah/request/:requestId/check",
  jwt,
  requireSejamVerified,
  Payment.CHECK_SEPAH_PAYMENT,
);
router.post(
  "/parsian/callback",
  express.urlencoded({ extended: false }),
  Payment.PARSIAN_CALLBACK,
);
router.get("/receipt/:orderId", Payment.RECEIPT);

export default router;
