import { apiRequest } from "@/services/apiClient";
import type { PaymentGateway } from "@/types/commerce";

export interface PublicPaymentMethod {
  id: string;
  label: string;
  description: string;
  gateway: PaymentGateway;
  icon: string;
  featured?: boolean;
  supportsSubscription?: boolean;
}

export const commercePaymentService = {
  listMethods() {
    return apiRequest<{
      methods: PublicPaymentMethod[];
      mercadopagoConfigured: boolean;
    }>("/commerce/payment-methods");
  },

  mercadoPagoConfig() {
    return apiRequest<{ configured: boolean; publicKey: string }>("/commerce/mercadopago/config");
  },
};
