import { gql, TypedDocumentNode } from "@apollo/client";
import { CreateCheckoutPaymentMethodResponse } from "@/types/checkout/type";

export const CREATE_CHECKOUT_PAYMENT_METHODS: TypedDocumentNode<CreateCheckoutPaymentMethodResponse> = gql`
  mutation CreateCheckoutPaymentMethod(
    $paymentMethod: String!
    $successUrl: String
    $failureUrl: String
    $cancelUrl: String
  ) {
    createCheckoutPaymentMethod(
      input: {
        paymentMethod: $paymentMethod
        paymentSuccessUrl: $successUrl
        paymentFailureUrl: $failureUrl
        paymentCancelUrl: $cancelUrl
      }
    ) {
      checkoutPaymentMethod {
        success
        message
        paymentGatewayUrl
        paymentData
      }
    }
  }
`;
