import { env } from "../config/env.js";

export async function initializePayment({ provider, email, amount, reference }) {
  if (provider === "paystack") {
    return {
      provider,
      authorizationUrl: "https://checkout.paystack.com/demo",
      reference,
      amount,
      email,
      configured: Boolean(env.paystackSecret)
    };
  }
  if (provider === "flutterwave") {
    return {
      provider,
      paymentLink: "https://checkout.flutterwave.com/demo",
      reference,
      amount,
      email,
      configured: Boolean(env.flutterwaveSecret)
    };
  }
  return { provider, reference, amount, email, configured: provider === "wallet" || provider === "cod" };
}

export async function verifyPayment({ provider, reference }) {
  return { provider, reference, status: "verified", verifiedAt: new Date().toISOString() };
}
