"use server";

import { PaymentsService } from "./api";

export const proceedGetPaymentMethodsAsync = async (data: {
  shipping?: boolean | undefined;
}) => {
  console.log("🚀 ~ proceedGetPaymentMethodsAsync ~ data:", data);
  try {
    return await PaymentsService.paymentsControllerGetPaymentMethods();
  } catch (error) {
    console.log("🚀 ~ proceedGetPaymentMethodsAsync ~ error:", error);
    return null;
  }
};

export const proceedGetPaymentMethodAssetsAsync = async (data: {
  methodId: number;
  shipping?: boolean | undefined;
}) => {
  try {
    return await PaymentsService.paymentsControllerGetPaymentMethodAssets(
      data.methodId,
    );
  } catch (error) {
    console.log("🚀 ~ proceedGetPaymentMethodAssetsAsync ~ error:", error);
    return null;
  }
};
