// This file is the default. To override, add to connector.js
import { getCurrency, getCustomExchange } from "./Modifiers";

export const blockedPaymentErrorBodyForIssuingCountry = {
  status: 200,
  expectBlockedPayment: true,
  body: {
    error: {
      type: "blocked",
      message:
        "Cards issued in your region aren't supported for this transaction, please try a different card",
      code: "HE_03",
      reason: "Blocked",
    },
  },
};

export const blockedPaymentErrorBodyForDebitCard = {
  status: 200,
  expectBlockedPayment: true,
  body: {
    error: {
      type: "blocked",
      message:
        "Debit cards are not accepted for this transaction, please try a different card",
      code: "HE_03",
      reason: "Blocked",
    },
  },
};

export const blockedPaymentErrorBodyForCardSubtype = {
  status: 200,
  expectBlockedPayment: true,
  body: {
    error: {
      type: "blocked",
      message:
        "This card is not accepted for this transaction, please try a different card",
      code: "HE_03",
      reason: "Blocked",
    },
  },
};

export const blockedPaymentErrorBodyForBinUnavailable = {
  status: 200,
  expectBlockedPayment: true,
  body: {
    error: {
      type: "blocked",
      message:
        "We're unable to accept this card, please try another card or a different payment method",
      code: "HE_03",
      reason: "Blocked",
    },
  },
};

export const customerAcceptance = {
  acceptance_type: "offline",
  accepted_at: "1963-05-03T04:07:52.723Z",
  online: {
    ip_address: "127.0.0.1",
    user_agent:
      "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/22F76 [FBAN/FBIOS;FBAV/520.0.0.38.101;FBBV/756351453;FBDV/iPhone14,7;FBMD/iPhone;FBSN/iOS;FBSV/18.5;FBSS/3;FBID/phone;FBLC/fr_FR;FBOP/5;FBRV/760683563;IABMV/1]",
  },
};

export const cardCreditEnabled = [
  {
    payment_method: "card",
    payment_method_types: [
      {
        payment_method_type: "credit",
        card_networks: [
          "Visa",
          "Mastercard",
          "AmericanExpress",
          "Discover",
          "JCB",
          "DinersClub",
          "UnionPay",
          "RuPay",
          "Interac",
        ],
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: true,
      },
    ],
  },
];

export const successfulNo3DSCardDetails = {
  card_number: "4111111111111111",
  card_exp_month: "08",
  card_exp_year: "30",
  card_holder_name: "joseph Doe",
  card_cvc: "999",
};

const blocklistedCardDetails = {
  card_number: "4242424242424242",
  card_exp_month: "01",
  card_exp_year: "2050",
  card_holder_name: "John Smith",
  card_cvc: "349",
  card_network: "Visa",
};

const successfulThreeDSTestCardDetails = {
  card_number: "4111111111111111",
  card_exp_month: "10",
  card_exp_year: "30",
  card_holder_name: "morino",
  card_cvc: "999",
};

const PaymentMethodCardDetails = {
  card_number: "4111111145551142",
  card_exp_month: "03",
  card_exp_year: "30",
  card_holder_name: "Joseph Doe",
};

export const singleUseMandateData = {
  customer_acceptance: customerAcceptance,
  mandate_type: {
    single_use: {
      amount: 8000,
      currency: "USD",
    },
  },
};

export const multiUseMandateData = {
  customer_acceptance: customerAcceptance,
  mandate_type: {
    multi_use: {
      amount: 8000,
      currency: "USD",
    },
  },
};

export const standardBillingAddress = {
  address: {
    line1: "1467",
    line2: "Harrison Street",
    line3: "Harrison Street",
    city: "San Fransico",
    state: "CA",
    zip: "94122",
    country: "US",
    first_name: "John",
    last_name: "Doe",
  },
  phone: {
    number: "8056594427",
    country_code: "+91",
  },
};

export const cardRequiredField = {
  "payment_method_data.card.card_number": {
    required_field: "payment_method_data.card.card_number",
    display_name: "card_number",
    field_type: "user_card_number",
    value: null,
  },
  "payment_method_data.card.card_exp_year": {
    required_field: "payment_method_data.card.card_exp_year",
    display_name: "card_exp_year",
    field_type: "user_card_expiry_year",
    value: null,
  },
  "payment_method_data.card.card_cvc": {
    required_field: "payment_method_data.card.card_cvc",
    display_name: "card_cvc",
    field_type: "user_card_cvc",
    value: null,
  },
  "payment_method_data.card.card_exp_month": {
    required_field: "payment_method_data.card.card_exp_month",
    display_name: "card_exp_month",
    field_type: "user_card_expiry_month",
    value: null,
  },
};

export const fullNameRequiredField = {
  "billing.address.last_name": {
    required_field: "payment_method_data.billing.address.last_name",
    display_name: "card_holder_name",
    field_type: "user_full_name",
    value: "Doe",
  },
  "billing.address.first_name": {
    required_field: "payment_method_data.billing.address.first_name",
    display_name: "card_holder_name",
    field_type: "user_full_name",
    value: "joseph",
  },
};

export const billingRequiredField = {};

// Bank debit specific billing addresses - derived from standardBillingAddress
export const sepaBillingAddress = {
  address: {
    ...standardBillingAddress.address,
    city: "Amsterdam",
    state: "North Holland",
    zip: "1012",
    country: "NL",
  },
  email: "test@example.com",
};

export const achBillingAddress = {
  address: {
    ...standardBillingAddress.address,
    city: "San Francisco",
    state: "California",
  },
  email: "test@example.com",
};

export const bacsBillingAddress = {
  address: {
    ...standardBillingAddress.address,
    city: "London",
    state: "England",
    zip: "SW1A 1AA",
    country: "GB",
  },
  email: "test@example.com",
};

export const payment_methods_enabled = [
  {
    payment_method: "bank_redirect",
    payment_method_types: [
      {
        payment_method_type: "blik",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "eps",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "ideal",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "giropay",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "local_bank_redirect",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "przelewy24",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "open_banking_uk",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "online_banking_fpx",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "sofort",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "interac",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "bancontact_card",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "eft",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "bank_debit",
    payment_method_types: [
      {
        payment_method_type: "sepa",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "bank_transfer",
    payment_method_types: [
      {
        payment_method_type: "pix",
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "ach",
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: false,
      },
      {
        payment_method_type: "instant_bank_transfer_finland",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "instant_bank_transfer_poland",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "bank_debit",
    payment_method_types: [
      {
        payment_method_type: "ach",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "sepa",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "bacs",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "becs",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "card",
    payment_method_types: [
      {
        payment_method_type: "credit",
        card_networks: [
          "AmericanExpress",
          "Discover",
          "Interac",
          "JCB",
          "Mastercard",
          "Visa",
          "DinersClub",
          "UnionPay",
          "RuPay",
        ],
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: true,
      },
      {
        payment_method_type: "debit",
        card_networks: [
          "AmericanExpress",
          "Discover",
          "Interac",
          "JCB",
          "Mastercard",
          "Visa",
          "DinersClub",
          "UnionPay",
          "RuPay",
        ],
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "real_time_payment",
    payment_method_types: [
      {
        payment_method_type: "duit_now",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
      {
        payment_method_type: "fps",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
      {
        payment_method_type: "prompt_pay",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
      {
        payment_method_type: "viet_qr",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
      {
        payment_method_type: "qris",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: false,
        payment_experience: "redirect_to_url",
      },
    ],
  },
  {
    payment_method: "upi",
    payment_method_types: [
      {
        payment_method_type: "upi_collect",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
      {
        payment_method_type: "upi_intent",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "redirect_to_url",
      },
    ],
  },
  {
    payment_method: "wallet",
    payment_method_types: [
      {
        payment_method_type: "apple_pay",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "invoke_sdk_client",
      },
      {
        payment_method_type: "google_pay",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
        payment_experience: "invoke_sdk_client",
      },
      {
        payment_method_type: "bluecode",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "skrill",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "ali_pay_hk",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "mifinity",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "paypal",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "kakao_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "ali_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "gcash",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "we_chat_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "momo",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "twint",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "vipps",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "dana",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "go_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "mb_way",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "amazon_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "cashapp",
        payment_experience: "display_qr_code",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "revolut_pay",
        payment_experience: "redirect_to_url",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "reward",
    payment_method_types: [
      {
        payment_method_type: "evoucher",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "classic",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "voucher",
    payment_method_types: [
      {
        payment_method_type: "boleto",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "oxxo",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "alfamart",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "indomaret",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "seven_eleven",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "lawson",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "mini_stop",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "family_mart",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "seicomart",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "pay_easy",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "gift_card",
    payment_method_types: [
      {
        payment_method_type: "givex",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "pay_safe_card",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "crypto",
    payment_method_types: [
      {
        payment_method_type: "crypto_currency",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 0,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "pay_later",
    payment_method_types: [
      {
        payment_method_type: "klarna",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "payjustnow",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: {
          type: "enable_only",
          list: ["ZAR"],
        },
        accepted_countries: {
          type: "enable_only",
          list: ["ZA"],
        },
        minimum_amount: 100,
        maximum_amount: 100000000,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "affirm",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "atome",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "afterpay_clearpay",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "alma",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
      {
        payment_method_type: "walley",
        payment_experience: "redirect_to_url",
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
    ],
  },
  {
    payment_method: "card_redirect",
    payment_method_types: [
      {
        payment_method_type: "card_redirect",
        payment_experience: null,
        card_networks: null,
        accepted_currencies: null,
        accepted_countries: null,
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: true,
        installment_payment_enabled: true,
      },
    ],
  },
  {
    payment_method: "open_banking",
    payment_method_types: [
      {
        payment_method_type: "open_banking_pis",
        minimum_amount: 1,
        maximum_amount: 68607706,
        recurring_enabled: false,
        installment_payment_enabled: false,
      },
    ],
  },
];

export const connectorDetails = {
  bank_transfer_pm: {
    PaymentIntent: (paymentMethodType) =>
      getCustomExchange({
        Request: {
          currency: getCurrency(paymentMethodType),
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      }),

    Pix: getCustomExchange({
      Request: {
        payment_method: "bank_transfer",
        payment_method_type: "pix",
        payment_method_data: {
          bank_transfer: {
            pix: {},
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "BR",
            first_name: "john",
            last_name: "doe",
          },
        },
        currency: "BRL",
      },
    }),
    Ach: getCustomExchange({
      Request: {
        payment_method: "bank_transfer",
        payment_method_type: "ach",
        payment_method_data: {
          bank_transfer: {
            ach_bank_transfer: {},
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "BR",
            first_name: "john",
            last_name: "doe",
          },
        },
        currency: "BRL",
      },
    }),
    InstantBankTransferFinland: getCustomExchange({
      Request: {
        payment_method: "bank_transfer",
        payment_method_type: "instant_bank_transfer_finland",
        payment_method_data: {
          bank_transfer: {
            instant_bank_transfer_finland: {},
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "FI",
            first_name: "john",
            last_name: "doe",
          },
        },
        currency: "EUR",
      },
    }),
    InstantBankTransferPoland: getCustomExchange({
      Request: {
        payment_method: "bank_transfer",
        payment_method_type: "instant_bank_transfer_poland",
        payment_method_data: {
          bank_transfer: {
            instant_bank_transfer_poland: {},
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "PL",
            first_name: "john",
            last_name: "doe",
          },
        },
        currency: "PLN",
      },
    }),
  },
  bank_redirect_pm: {
    PaymentIntent: (paymentMethodType) =>
      getCustomExchange({
        Request: {
          currency: getCurrency(paymentMethodType),
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      }),
    Ideal: {
      ...getCustomExchange({
        Request: {
          payment_method: "bank_redirect",
          payment_method_type: "ideal",
          payment_method_data: {
            bank_redirect: {
              ideal: {
                bank_name: "ing",
                country: "NL",
              },
            },
          },
          billing: {
            address: {
              line1: "1467",
              line2: "Harrison Street",
              line3: "Harrison Street",
              city: "San Fransico",
              state: "California",
              zip: "94122",
              country: "NL",
              first_name: "john",
              last_name: "doe",
            },
          },
        },
      }),
      MandateSingleUseAutoCapture: getCustomExchange({
        Request: {},
        Response: {
          status: 200,
          body: {
            status: "requires_customer_action",
          },
        },
        Configs: {
          TRIGGER_SKIP: true,
        },
      }),
    },
    BancontactCard: {
      ...getCustomExchange({
        Request: {
          payment_method: "bank_redirect",
          payment_method_type: "bancontact_card",
          payment_method_data: {
            bank_redirect: {
              bancontact_card: {
                card_number: "6703444444444449",
                card_exp_month: "03",
                card_exp_year: "2030",
              },
            },
          },
          billing: standardBillingAddress,
        },
      }),
      MandateSingleUseAutoCapture: getCustomExchange({
        Request: {},
        Response: {
          status: 200,
          body: {
            status: "requires_customer_action",
          },
        },
      }),
    },
    OpenBankingUk: {
      ...getCustomExchange({
        Request: {
          payment_method: "bank_redirect",
          payment_method_type: "open_banking_uk",
          payment_method_data: {
            bank_redirect: {
              open_banking_uk: {
                issuer: "citi",
                country: "GB",
              },
            },
          },
          billing: standardBillingAddress,
        },
      }),
      MandateSingleUseAutoCapture: getCustomExchange({
        Request: {},
        Response: {
          status: 200,
          body: {
            status: "requires_customer_action",
          },
        },
        Configs: {
          TRIGGER_SKIP: true,
        },
      }),
    },
    OnlineBankingFpx: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "online_banking_fpx",
        payment_method_data: {
          bank_redirect: {
            online_banking_fpx: {
              issuer: "affin_bank",
            },
          },
        },
        billing: standardBillingAddress,
      },
    }),
    Giropay: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "giropay",
        payment_method_data: {
          bank_redirect: {
            giropay: {
              bank_name: "",
              bank_account_bic: "",
              bank_account_iban: "",
              preferred_language: "en",
              country: "DE",
            },
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "DE",
            first_name: "john",
            last_name: "doe",
          },
        },
      },
    }),
    Sofort: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "sofort",
        payment_method_data: {
          bank_redirect: {
            sofort: {
              country: "DE",
              preferred_language: "en",
            },
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "DE",
            first_name: "john",
            last_name: "doe",
          },
        },
      },
    }),
    Eps: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "eps",
        payment_method_data: {
          bank_redirect: {
            eps: {
              bank_name: "ing",
            },
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "AT",
            first_name: "john",
            last_name: "doe",
          },
        },
      },
    }),
    Przelewy24: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "przelewy24",
        payment_method_data: {
          bank_redirect: {
            przelewy24: {
              bank_name: "citi",
              billing_details: {
                email: "guest@juspay.in",
              },
            },
          },
        },
      },
    }),
    Blik: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "blik",
        payment_method_data: {
          bank_redirect: {
            blik: {
              blik_code: "777987",
            },
          },
        },
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "PL",
            first_name: "john",
            last_name: "doe",
          },
        },
      },
    }),
    Interac: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "interac",
        payment_method_data: {
          bank_redirect: {
            interac: {
              bank_name: "ing",
            },
          },
        },
        billing: {
          ...standardBillingAddress,
          address: {
            ...standardBillingAddress.address,
            country: "CA",
          },
        },
      },
    }),
    Trustly: {
      ...getCustomExchange({
        Configs: {
          TRIGGER_SKIP: true,
        },
        Request: {
          payment_method: "bank_redirect",
          payment_method_type: "trustly",
          payment_method_data: {
            bank_redirect: {
              trustly: {
                country: "NL",
              },
            },
          },
          billing: standardBillingAddress,
        },
      }),
      MandateSingleUseAutoCapture: getCustomExchange({
        Configs: {
          TRIGGER_SKIP: true,
        },
        Request: {},
        Response: {
          status: 200,
          body: {
            status: "requires_customer_action",
          },
        },
      }),
    },
    Eft: getCustomExchange({
      Request: {
        payment_method: "bank_redirect",
        payment_method_type: "eft",
        payment_method_data: {
          bank_redirect: {
            eft: {
              provider: "ozow",
            },
          },
        },
      },
    }),
  },
  bank_debit_pm: {
    PaymentIntent: (paymentMethodType) => {
      const currencyMap = { Sepa: "EUR", Ach: "USD", Becs: "AUD", Bacs: "GBP" };
      return getCustomExchange({
        Request: {
          currency: currencyMap[paymentMethodType] || "USD",
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      });
    },
    Sepa: getCustomExchange({
      Request: {
        payment_method: "bank_debit",
        payment_method_type: "sepa",
        payment_method_data: {
          bank_debit: {
            sepa_bank_debit: {
              iban: "DE89370400440532013000",
              bank_account_holder_name: "Test Account",
            },
          },
        },
        billing: {
          address: {
            country: "DE",
          },
          email: "test@example.com",
        },
      },
    }),
    Ach: getCustomExchange({
      Request: {
        payment_method: "bank_debit",
        payment_method_type: "ach",
        payment_method_data: {
          bank_debit: {
            ach_bank_debit: {
              account_number: "000123456789",
              routing_number: "110000000",
              bank_account_holder_name: "Test Account",
            },
          },
        },
        billing: {
          address: {
            country: "US",
          },
          email: "test@example.com",
        },
      },
    }),
    Becs: getCustomExchange({
      Request: {
        payment_method: "bank_debit",
        payment_method_type: "becs",
        payment_method_data: {
          bank_debit: {
            becs_bank_debit: {
              account_number: "000123456",
              bsb_number: "000000",
              bank_account_holder_name: "Test Account",
            },
          },
        },
        billing: {
          address: {
            country: "AU",
          },
          email: "test@example.com",
        },
      },
    }),
    Bacs: getCustomExchange({
      Request: {
        payment_method: "bank_debit",
        payment_method_type: "bacs",
        payment_method_data: {
          bank_debit: {
            bacs_bank_debit: {
              account_number: "00012345",
              sort_code: "108800",
              bank_account_holder_name: "Test Account",
            },
          },
        },
        billing: {
          address: {
            country: "GB",
          },
          email: "test@example.com",
        },
      },
    }),
    get MandateSingleUseSepa() {
      return this.Sepa;
    },
    get MandateSingleUseBecs() {
      return this.Becs;
    },
    get MandateSingleUseAch() {
      return this.Ach;
    },
    get MandateSingleUseBacs() {
      return this.Bacs;
    },
    MITAutoCaptureSepa: getCustomExchange({
      Request: {
        amount: 6540,
        off_session: true,
        confirm: true,
        currency: "EUR",
      },
    }),
    MITAutoCaptureBecs: getCustomExchange({
      Request: {
        amount: 6540,
        off_session: true,
        confirm: true,
        currency: "AUD",
      },
    }),
    MITAutoCaptureAch: getCustomExchange({
      Request: {
        amount: 6540,
        off_session: true,
        confirm: true,
        currency: "USD",
      },
    }),
    MITAutoCaptureBacs: getCustomExchange({
      Request: {
        amount: 6540,
        off_session: true,
        confirm: true,
        currency: "GBP",
      },
    }),
    BankdebitMIT: getCustomExchange({
      Request: {
        currency: "EUR",
        off_session: true,
      },
    }),
    SepaMandate: getCustomExchange({
      Request: {
        payment_method: "bank_debit",
        payment_method_type: "sepa",
        payment_method_data: {
          bank_debit: {
            sepa_bank_debit: {
              iban: "DE89370400440532013000",
              bank_account_holder_name: "Test Account",
            },
          },
        },
        billing: {
          address: {
            country: "DE",
          },
          email: "test@example.com",
        },
      },
    }),
  },
  wallet_pm: {
    PaymentIntent: (paymentMethodType) =>
      getCustomExchange({
        Request: {
          currency: getCurrency(paymentMethodType),
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      }),
    Bluecode: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "bluecode",
        payment_method_data: {
          wallet: {
            bluecode_redirect: {},
          },
        },
        billing: {
          ...standardBillingAddress,
          address: {
            ...standardBillingAddress.address,
            country: "AT",
          },
        },
      },
    }),
    AliPayHk: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "ali_pay_hk",
        payment_method_data: {
          wallet: {
            ali_pay_hk_redirect: {},
          },
        },
        billing: {
          ...standardBillingAddress,
          address: {
            ...standardBillingAddress.address,
            country: "HK",
          },
        },
      },
      Configs: {
        TRIGGER_SKIP: true,
      },
    }),
    Mifinity: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "mifinity",
        authentication_type: "no_three_ds",
        billing: {
          ...standardBillingAddress,
          address: {
            ...standardBillingAddress.address,
            country: "GB",
          },
          phone: {
            number: "1234567890",
            country_code: "+44",
          },
          email: "test@example.com",
        },
        payment_method_data: {
          wallet: {
            mifinity: {
              date_of_birth: "1990-01-01",
              language_preference: "en",
            },
          },
        },
      },
    }),
    PaypalRedirect: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "paypal",
        authentication_type: "no_three_ds",
        payment_method_data: {
          wallet: {
            paypal_redirect: {},
          },
        },
        billing: standardBillingAddress,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
        },
      },
    }),
    PaypalRedirectMandateCIT: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "paypal",
        authentication_type: "no_three_ds",
        billing: standardBillingAddress,
        payment_method_data: {
          wallet: {
            paypal_redirect: {},
          },
        },
        setup_future_usage: "off_session",
        mandate_data: {
          customer_acceptance: customerAcceptance,
          mandate_type: {
            single_use: {
              amount: 8000,
              currency: "EUR",
            },
          },
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
        },
      },
    }),
    Skrill: getCustomExchange({
      Request: {
        payment_method: "wallet",
        payment_method_type: "skrill",
        payment_method_data: {
          wallet: {
            skrill: {},
          },
        },
      },
    }),
  },
  pay_later_pm: {
    PaymentIntent: (paymentMethodType) =>
      getCustomExchange({
        Request: {
          currency: getCurrency(paymentMethodType),
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      }),
    Klarna: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "klarna",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            klarna_redirect: {
              billing_email: "guest@juspay.in",
              billing_country: "DE",
            },
          },
        },
        billing: {
          email: "guest@juspay.in",
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "DE",
            first_name: "joseph",
            last_name: "Doe",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    Affirm: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "affirm",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            affirm_redirect: {},
          },
        },
        billing: {
          email: "guest@juspay.in",
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "California",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    AutoCapture: getCustomExchange({
      Request: {
        currency: "EUR",
        capture_method: "automatic",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    ManualCapture: getCustomExchange({
      Request: {
        currency: "EUR",
        capture_method: "manual",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    AffirmManualCapture: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "affirm",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            affirm_redirect: {
              billing_email: "guest@juspay.in",
              billing_country: "US",
            },
          },
        },
        billing: {
          email: "guest@juspay.in",
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Francisco",
            state: "California",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
          phone: {
            number: "8056599999",
            country_code: "+1",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    Capture: getCustomExchange({
      Request: {
        amount_to_capture: 6000,
      },
    }),
    Refund: getCustomExchange({
      Request: {
        amount: 6000,
      },
    }),
    PartialRefund: getCustomExchange({
      Request: {
        amount: 2000,
      },
    }),
    SyncRefund: getCustomExchange({}),
    Payjustnow: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "payjustnow",
        payment_method_data: {
          pay_later: {
            payjustnow_redirect: {},
          },
        },
        billing: {
          email: "customer@payjustnow.co.za",
          address: {
            line1: "123 Main Street",
            line2: "",
            line3: "",
            city: "Johannesburg",
            state: "Gauteng",
            zip: "2001",
            country: "ZA",
            first_name: "Test",
            last_name: "Customer",
          },
        },
      },
    }),
    Payjustnowinstore: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "payjustnow",
        payment_method_data: {
          pay_later: {
            payjustnow_redirect: {},
          },
        },
        billing: {
          email: "customer@payjustnow.co.za",
          address: {
            line1: "123 Main Street",
            line2: "",
            line3: "",
            city: "Johannesburg",
            state: "Gauteng",
            zip: "2001",
            country: "ZA",
            first_name: "Test",
            last_name: "Customer",
          },
        },
      },
    }),
    SyncRefundScheduled: getCustomExchange({}),
    AfterpayClearpay: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "afterpay_clearpay",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            afterpay_clearpay_redirect: {},
          },
        },
        billing: {
          phone: {
            number: "4155552671",
            country_code: "+1",
          },
          address: {
            line1: "1467",
            line2: "Harrison Street",
            city: "San Francisco",
            state: "California",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
        },
        shipping: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            city: "San Francisco",
            state: "California",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    Alma: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "alma",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            alma_redirect: {},
          },
        },
        billing: {
          email: "test@test.com",
          phone: {
            number: "612345678",
            country_code: "+33",
          },
          address: {
            line1: "123 Rue de Test",
            city: "Paris",
            state: "Ile-de-France",
            zip: "75001",
            country: "FR",
            first_name: "Jean",
            last_name: "Dupont",
          },
        },
        shipping: {
          address: {
            line1: "123 Rue de Test",
            city: "Paris",
            state: "Ile-de-France",
            zip: "75001",
            country: "FR",
            first_name: "Jean",
            last_name: "Dupont",
          },
        },
      },
    }),
    Atome: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "atome",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            atome_redirect: {},
          },
        },
        billing: {
          phone: {
            number: "91234567",
            country_code: "+65",
          },
          address: {
            line1: "123 Test Street",
            city: "Singapore",
            state: "Singapore",
            zip: "018956",
            country: "SG",
            first_name: "John",
            last_name: "Doe",
          },
        },
        shipping: {
          address: {
            line1: "123 Test Street",
            city: "Singapore",
            state: "Singapore",
            zip: "018956",
            country: "SG",
            first_name: "John",
            last_name: "Doe",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    Walley: getCustomExchange({
      Request: {
        payment_method: "pay_later",
        payment_method_type: "walley",
        payment_experience: "redirect_to_url",
        payment_method_data: {
          pay_later: {
            walley_redirect: {},
          },
        },
        billing: {
          email: "test@test.com",
          phone: {
            number: "0701234567",
            country_code: "+46",
          },
          address: {
            line1: "123 Test Street",
            city: "Stockholm",
            state: "Stockholm",
            zip: "11122",
            country: "SE",
            first_name: "Lars",
            last_name: "Eriksson",
          },
        },
        shipping: {
          address: {
            line1: "123 Test Street",
            city: "Stockholm",
            state: "Stockholm",
            zip: "11122",
            country: "SE",
            first_name: "Lars",
            last_name: "Eriksson",
          },
        },
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
    }),
    CaptureOnWrongStatus: getCustomExchange({
      Request: {
        amount_to_capture: 6000,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "This Payment could not be captured because it has a payment.status of requires_customer_action. The expected state is requires_capture, partially_captured_and_capturable, processing",
            code: "IR_14",
          },
        },
      },
    }),
    ConfirmWithoutPmData: getCustomExchange({
      Request: {
        payment_method: undefined,
        payment_method_type: undefined,
        payment_experience: undefined,
        payment_method_data: undefined,
        order_details: undefined,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            code: "IR_04",
          },
        },
      },
    }),
  },
  real_time_payment_pm: {
    PaymentIntent: getCustomExchange({
      Request: {
        currency: "MYR",
        customer_acceptance: null,
        setup_future_usage: "on_session",
        billing: standardBillingAddress,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    DuitNow: getCustomExchange({
      Request: {
        payment_method: "real_time_payment",
        payment_method_type: "duit_now",
        payment_method_data: {
          real_time_payment: {
            duit_now: {},
          },
        },
        billing: standardBillingAddress,
      },
    }),
    Qris: getCustomExchange({
      Request: {
        payment_method: "real_time_payment",
        payment_method_type: "qris",
        payment_method_data: {
          real_time_payment: {
            qris: {},
          },
        },
        billing: standardBillingAddress,
      },
    }),
    QrisMandate: getCustomExchange({
      Request: {
        payment_method: "real_time_payment",
        payment_method_type: "qris",
        payment_method_data: {
          real_time_payment: {
            qris: {},
          },
        },
        billing: standardBillingAddress,
        setup_future_usage: "off_session",
        mandate_data: {
          customer_acceptance: {
            acceptance_type: "online",
            accepted_at: "2026-07-13T18:09:53Z",
            online: {
              ip_address: "127.0.0.1",
              user_agent: "test-agent",
            },
          },
        },
      },
    }),
  },
  card_pm: {
    PaymentIntent: getCustomExchange({
      Request: {
        currency: "USD",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    PaymentIntentOffSession: getCustomExchange({
      Request: {
        currency: "USD",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    PaymentIntentWithShippingCost: getCustomExchange({
      Request: {
        currency: "USD",
        shipping_cost: 50,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
          shipping_cost: 50,
          amount: 6000,
        },
      },
    }),
    PaymentIntentWithBillingDescriptor: getCustomExchange({
      Request: {
        currency: "USD",
        billing_descriptor: {
          name: "Test Business",
          city: "San Francisco",
          phone: "1234567890",
          statement_descriptor: "Test Descriptor",
          statement_descriptor_suffix: "Suffix",
          reference: "REF123",
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    PaymentConfirmWithBillingDescriptor: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        billing_descriptor: {
          name: "Test Business",
          city: "San Francisco",
          phone: "1234567890",
          statement_descriptor: "Test Descriptor",
          statement_descriptor_suffix: "Suffix",
          reference: "REF123",
        },
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    PaymentConfirmWithShippingCost: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    "3DSManualCapture": getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    "3DSAutoCapture": getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    SessionToken: {
      Response: {
        status: 200,
        body: {
          session_token: [],
        },
      },
    },
    No3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    No3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    ExtendedCardInfo: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    No3DSFailPayment: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
    }),
    ManualRetryPaymentDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 400,
        body: {
          type: "invalid_request",
          message:
            "You cannot confirm this payment because it has status failed, you can enable `manual_retry` in profile to try this payment again",
          code: "IR_16",
        },
      },
    }),
    ManualRetryPaymentEnabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
          payment_method: "card",
          attempt_count: 2,
        },
      },
    }),
    ManualRetryPaymentCutoffExpired: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 400,
        body: {
          type: "invalid_request",
          message:
            "You cannot confirm this payment using `manual_retry` because the allowed duration has expired",
          code: "IR_16",
        },
      },
    }),
    PaymentIntentWithSessionExpiry: getCustomExchange({
      Request: {
        currency: "USD",
        session_expiry: 60,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    SessionExpiredConfirmPayment: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "The provided client_secret has expired",
            code: "IR_08",
          },
        },
      },
    }),
    Capture: getCustomExchange({
      Request: {
        amount_to_capture: 6000,
      },
    }),
    PartialCapture: getCustomExchange({
      Request: {
        amount_to_capture: 2000,
      },
    }),
    MultipleCapture: getCustomExchange({
      Request: {
        amount_to_capture: 3000,
      },
    }),
    MultipleCapturePartial: getCustomExchange({
      Request: {
        amount_to_capture: 2000,
      },
    }),
    MultipleCaptureFinal: getCustomExchange({
      Request: {
        amount_to_capture: 2000,
      },
    }),
    MultipleCaptureRetrieve: getCustomExchange({}),
    MultipleCaptureOvercapture: getCustomExchange({
      Request: {
        amount_to_capture: 7000,
      },
    }),
    Void: getCustomExchange({
      Request: {},
      Response: {
        status: 200,
        body: {
          status: "cancelled",
          capture_method: "manual",
        },
      },
      ResponseCustom: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "You cannot cancel this payment because it has status succeeded",
            code: "IR_16",
          },
        },
      },
    }),
    VoidAfterConfirm: getCustomExchange({
      Request: {},
      Response: {
        status: 200,
        body: {
          status: "cancelled",
          capture_method: "manual",
        },
      },
      ResponseCustom: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "You cannot cancel this payment because it has status succeeded",
            code: "IR_16",
          },
        },
      },
    }),
    Refund: getCustomExchange({
      Request: {
        amount: 6000,
      },
    }),
    manualPaymentRefund: getCustomExchange({
      Request: {
        amount: 6000,
      },
      Response: {
        status: 200,
        body: {
          status: "pending",
        },
      },
    }),
    manualPaymentPartialRefund: getCustomExchange({
      Request: {
        amount: 2000,
      },
      Response: {
        status: 200,
        body: {
          status: "pending",
        },
      },
    }),
    ManualRefundUpdate: getCustomExchange({
      Request: {
        status: "failed",
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    ManualRefundUpdateErrorCode: getCustomExchange({
      Request: {
        status: "failed",
        error_code: {
          set: "TEST_ERROR_CODE",
        },
        error_message: {
          set: "Test error message for manual update",
        },
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    ManualRefundUpdatePartialRefund: getCustomExchange({
      Request: {
        status: "failed",
        error_code: {
          set: "PARTIAL_REFUND_FAILED",
        },
        error_message: {
          set: "Partial refund failed via manual update",
        },
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    ManualRefundUpdateIdempotency: getCustomExchange({
      Request: {
        status: "failed",
        error_code: {
          set: "IDEMPOTENCY_TEST",
        },
        error_message: {
          set: "First manual update for idempotency test",
        },
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    ManualRefundUpdateUnset: getCustomExchange({
      Request: {
        error_code: {
          unset: null,
        },
        error_message: {
          unset: null,
        },
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    SyncRefundManualUpdateFailed: getCustomExchange({
      Response: {
        status: 200,
        body: {
          status: "failed",
        },
      },
    }),
    SyncRefundManualUpdateErrorCode: getCustomExchange({
      Response: {
        status: 200,
        body: {
          status: "failed",
          error_code: "TEST_ERROR_CODE",
          error_message: "Test error message for manual update",
        },
      },
    }),
    SyncRefundManualUpdatePartialRefund: getCustomExchange({
      Response: {
        status: 200,
        body: {
          status: "failed",
          error_code: "PARTIAL_REFUND_FAILED",
          error_message: "Partial refund failed via manual update",
        },
      },
    }),
    SyncRefundManualUpdateIdempotency: getCustomExchange({
      Response: {
        status: 200,
        body: {
          status: "failed",
          error_code: "IDEMPOTENCY_TEST",
          error_message: "First manual update for idempotency test",
        },
      },
    }),
    SyncRefundManualUpdateUnset: getCustomExchange({
      Response: {
        status: 200,
        body: {
          status: "failed",
        },
      },
    }),
    PartialRefund: getCustomExchange({
      Request: {
        amount: 2000,
      },
    }),
    SyncRefund: getCustomExchange({}),
    SyncRefundScheduled: getCustomExchange({}),
    RefundInstant: getCustomExchange({
      Request: {
        amount: 6000,
        refund_type: "instant",
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    RefundScheduled: getCustomExchange({
      Request: {
        amount: 6000,
        refund_type: "scheduled",
      },
      Response: {
        status: 200,
        body: {
          status: "pending",
        },
      },
    }),
    PartialAuth: getCustomExchange({
      Request: {
        enable_partial_authorization: true,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    MandateSingleUse3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        mandate_data: singleUseMandateData,
      },
    }),
    MandateSingleUse3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        mandate_data: singleUseMandateData,
      },
    }),
    MandateSingleUseNo3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: singleUseMandateData,
      },
    }),
    MandateSingleUseNo3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: singleUseMandateData,
      },
    }),
    MandateMultiUseNo3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: multiUseMandateData,
      },
    }),
    MandateMultiUseNo3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: multiUseMandateData,
      },
    }),
    MandateMultiUse3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        mandate_data: multiUseMandateData,
      },
    }),
    MandateMultiUse3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        mandate_data: multiUseMandateData,
      },
    }),
    ZeroAuthMandate: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: singleUseMandateData,
      },
    }),
    ZeroAuthPaymentIntent: getCustomExchange({
      Request: {
        amount: 0,
        setup_future_usage: "off_session",
        currency: "USD",
        payment_type: "setup_mandate",
      },
    }),
    ZeroAuthConfirmPayment: getCustomExchange({
      Request: {
        payment_type: "setup_mandate",
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        mandate_data: null,
        customer_acceptance: customerAcceptance,
      },
    }),
    SaveCardUseNo3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        setup_future_usage: "on_session",
        customer_acceptance: customerAcceptance,
      },
    }),
    SaveCardUseNo3DSAutoCaptureOffSession: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        setup_future_usage: "off_session",
        customer_acceptance: customerAcceptance,
      },
    }),
    SaveCardUse3DSAutoCaptureOffSession: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        setup_future_usage: "off_session",
        customer_acceptance: customerAcceptance,
      },
    }),
    SaveCardUseNo3DSManualCaptureOffSession: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        setup_future_usage: "off_session",
        customer_acceptance: customerAcceptance,
      },
    }),
    SaveCardConfirmAutoCaptureOffSession: getCustomExchange({
      Request: {
        setup_future_usage: "off_session",
      },
      ResponseCustom: {
        status: 400,
        body: {
          error: {
            message:
              "No eligible connector was found for the current payment method configuration",
            type: "invalid_request",
          },
        },
      },
    }),
    SaveCardConfirmManualCaptureOffSession: getCustomExchange({
      Request: {
        setup_future_usage: "off_session",
      },
    }),
    SaveCardConfirmAutoCaptureOffSessionWithoutBilling: {
      Request: {
        setup_future_usage: "off_session",
        billing: null,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
          billing: null,
        },
      },
    },
    SaveCardUseNo3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        setup_future_usage: "on_session",
        customer_acceptance: customerAcceptance,
      },
    }),
    PaymentMethod: {
      Request: {
        payment_method: "card",
        payment_method_type: "credit",
        payment_method_issuer: "Gpay",
        payment_method_issuer_code: "jp_hdfc",
        card: PaymentMethodCardDetails,
      },
      Response: {
        status: 200,
        body: {},
      },
    },
    PaymentMethodIdMandateNo3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: null,
        customer_acceptance: customerAcceptance,
      },
    }),
    PaymentMethodIdMandateNo3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        mandate_data: null,
        customer_acceptance: customerAcceptance,
      },
    }),
    PaymentMethodIdMandate3DSAutoCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        mandate_data: null,
        authentication_type: "three_ds",
        customer_acceptance: customerAcceptance,
      },
    }),
    PaymentMethodIdMandate3DSManualCapture: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        mandate_data: null,
        authentication_type: "three_ds",
        customer_acceptance: customerAcceptance,
      },
    }),
    InvalidCardNumber: {
      Request: {
        currency: "USD",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "123456",
            card_exp_month: "10",
            card_exp_year: "25",
            card_holder_name: "joseph Doe",
            card_cvc: "123",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            error_type: "invalid_request",
            message: "Json deserialize error: invalid card number length",
            code: "IR_06",
          },
        },
      },
    },
    InvalidExpiryMonth: {
      Request: {
        currency: "USD",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "00",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "Invalid Expiry Month",
            code: "IR_16",
          },
        },
      },
    },
    InvalidExpiryYear: {
      Request: {
        currency: "USD",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "Invalid Expiry Year",
            code: "IR_16",
          },
        },
      },
    },
    InvalidCardCvv: {
      Request: {
        currency: "USD",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123456",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "Invalid card_cvc length",
            code: "IR_16",
          },
        },
      },
    },
    InvalidCurrency: {
      Request: {
        currency: "United",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123456",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            error_type: "invalid_request",
            message:
              "Json deserialize error: unknown variant `United`, expected one of `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BRL`, `BSD`, `BTN`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHF`, `CLF`, `CLP`, `CNY`, `COP`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRU`, `MUR`, `MVR`, `MWK`, `MXN`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLE`, `SLL`, `SOS`, `SRD`, `SSP`, `STD`, `STN`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `UYU`, `UZS`, `VES`, `VND`, `VUV`, `WST`, `XAF`, `XCD`, `XOF`, `XPF`, `YER`, `ZAR`, `ZMW`, `ZWL`",
            code: "IR_06",
          },
        },
      },
    },
    InvalidCaptureMethod: {
      Request: {
        currency: "USD",
        capture_method: "auto",
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123456",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            error_type: "invalid_request",
            message:
              "Json deserialize error: unknown variant `auto`, expected one of `automatic`, `manual`, `manual_multiple`, `scheduled`",
            code: "IR_06",
          },
        },
      },
    },
    InvalidPaymentMethod: {
      Request: {
        currency: "USD",
        payment_method: "this_supposed_to_be_a_card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2023",
            card_holder_name: "joseph Doe",
            card_cvc: "123456",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            error_type: "invalid_request",
            message:
              "Json deserialize error: unknown variant `this_supposed_to_be_a_card`, expected one of `card`, `card_redirect`, `pay_later`, `wallet`, `bank_redirect`, `bank_transfer`, `crypto`, `bank_debit`, `reward`, `real_time_payment`, `upi`, `voucher`, `gift_card`, `open_banking`, `mobile_payment`",
            code: "IR_06",
          },
        },
      },
    },
    InvalidAmountToCapture: {
      Request: {
        currency: "USD",
        amount_to_capture: 10000,
        payment_method: "card",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2030",
            card_holder_name: "joseph Doe",
            card_cvc: "123",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "amount_to_capture contains invalid data. Expected format is amount_to_capture lesser than amount",
            code: "IR_05",
          },
        },
      },
    },
    MissingRequiredParam: {
      Request: {
        currency: "USD",
        payment_method_type: "debit",
        setup_future_usage: "on_session",
        payment_method_data: {
          card: {
            card_number: "4242424242424242",
            card_exp_month: "01",
            card_exp_year: "2030",
            card_holder_name: "joseph Doe",
            card_cvc: "123",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "Missing required param: payment_method",
            code: "IR_04",
          },
        },
      },
    },
    PaymentIntentErrored: {
      Request: {
        currency: "USD",
      },
      Response: {
        status: 422,
        body: {
          error: {
            type: "invalid_request",
            message:
              "A payment token or payment method data or ctp service details is required",
            code: "IR_06",
          },
        },
      },
    },
    CaptureGreaterAmount: {
      Request: {
        amount_to_capture: 6000000,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "amount_to_capture is greater than amount",
            code: "IR_06",
          },
        },
      },
    },
    CaptureCapturedAmount: getCustomExchange({
      Request: {
        Request: {
          amount_to_capture: 6000,
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "This Payment could not be captured because it has a payment.status of succeeded. The expected state is requires_capture, partially_captured_and_capturable, processing",
            code: "IR_14",
          },
        },
      },
    }),
    ConfirmSuccessfulPayment: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "You cannot confirm this payment because it has status succeeded",
            code: "IR_16",
          },
        },
      },
    }),
    RefundGreaterAmount: {
      Request: {
        amount: 6000000,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message: "The refund amount exceeds the amount captured",
            code: "IR_13",
          },
        },
      },
    },
    MITAutoCapture: getCustomExchange({
      Request: {},
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
      ResponseCustom: {
        status: 400,
        body: {
          error: {
            message:
              "No eligible connector was found for the current payment method configuration",
            type: "invalid_request",
          },
        },
      },
    }),
    MITWithoutBillingAddress: getCustomExchange({
      Request: {
        billing: null,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    MITWithLimitedCardData: getCustomExchange({
      Request: {},
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    PartnerMerchantIdentifier: getCustomExchange({
      Request: {
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
        billing: {
          address: {
            line1: "1467",
            line2: "Harrison Street",
            line3: "Harrison Street",
            city: "San Francisco",
            state: "California",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
        },
        partner_merchant_identifier_details: {
          partner_details: {
            name: "TestPartner",
            version: "1.0.0",
            integrator: "TestIntegrator123",
          },
          merchant_details: {
            name: "TestMerchantApp",
            version: "2.0.0",
          },
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    PaymentWithoutBilling: {
      Request: {
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
        authentication_type: "no_three_ds",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    },
    PaymentWithBilling: {
      Request: {
        currency: "USD",
        setup_future_usage: "on_session",
        billing: {
          address: {
            line1: "1467",
            line2: "CA",
            line3: "Harrison Street",
            city: "San Fransico",
            state: "CA",
            zip: "94122",
            country: "US",
            first_name: "joseph",
            last_name: "Doe",
          },
          phone: {
            number: "9111222333",
            country_code: "+91",
          },
        },
        email: "hyperswitch.example@gmail.com",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    },
    PaymentWithFullName: {
      Request: {
        currency: "USD",
        setup_future_usage: "on_session",
        billing: {
          address: {
            first_name: "joseph",
            last_name: "Doe",
          },
          phone: {
            number: "9111222333",
            country_code: "+91",
          },
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    },
    PaymentWithBillingEmail: {
      Request: {
        currency: "USD",
        setup_future_usage: "on_session",
        email: "hyperswitch_sdk_demo_id1@gmail.com",
        billing: {
          address: {
            first_name: "joseph",
            last_name: "Doe",
          },
          phone: {
            number: "9111222333",
            country_code: "+91",
          },
          email: "hyperswitch.example@gmail.com",
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    },
    DuplicatePaymentID: {
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "The payment with the specified payment_id already exists in our records",
            code: "HE_01",
          },
        },
      },
    },
    DuplicateRefundID: {
      Request: {
        amount: 2000,
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            message:
              "Duplicate refund request. Refund already attempted with the refund ID",
            code: "HE_01",
          },
        },
      },
    },
    InvalidPublishableKey: {
      Request: {},
      Response: {
        status: 401,
        body: {
          error: {
            type: "invalid_request",
            message: "API key not provided or invalid API key used",
            code: "IR_01",
          },
        },
      },
    },
    DDCRaceConditionServerSide: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_type: "debit",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
        },
      },
      DDCConfig: {
        completeUrlPath: "/redirect/complete/default",
        collectionReferenceParam: "collectionReference",
        firstSubmissionValue: "",
        secondSubmissionValue: "race_condition_test_ddc_123",
        expectedError: {
          status: 400,
          body: {
            error: {
              code: "IR_07",
              type: "invalid_request",
              message:
                "Invalid value provided: collection_reference not allowed in AuthenticationPending state",
            },
          },
        },
      },
    }),
    DDCRaceConditionClientSide: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_type: "debit",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
        },
      },
      DDCConfig: {
        redirectUrlPath: "/payments/redirect",
        collectionReferenceParam: "collectionReference",
        delayBeforeSubmission: 2000,
        raceConditionScript: `
          <script>
            console.log("INJECTING_RACE_CONDITION_TEST");
            
            // Track submission attempts and ddcProcessed flag behavior
            window.testResults = {
              submissionAttempts: 0,
              actualSubmissions: 0,
              blockedSubmissions: 0
            };
            
            // Override the submitCollectionReference function to test race conditions
            var originalSubmit = window.submitCollectionReference;
            
            window.submitCollectionReference = function(collectionReference) {
              window.testResults.submissionAttempts++;
              console.log("SUBMISSION_ATTEMPT_" + window.testResults.submissionAttempts + ": " + collectionReference);
              
              // Check if ddcProcessed flag would block this
              if (window.ddcProcessed) {
                window.testResults.blockedSubmissions++;
                console.log("SUBMISSION_BLOCKED_BY_DDC_PROCESSED_FLAG");
                return;
              }
              
              window.testResults.actualSubmissions++;
              console.log("SUBMISSION_PROCEEDING: " + collectionReference);
              
              if (originalSubmit) {
                return originalSubmit(collectionReference);
              }
            };
            
            // Submit first value at configured timing
            setTimeout(function() {
              console.log("FIRST_SUBMISSION_TRIGGERED_AT_100MS");
              window.submitCollectionReference("");
            }, 100);
            
            // Submit second value at configured timing (should be blocked)
            setTimeout(function() {
              console.log("SECOND_SUBMISSION_ATTEMPTED_AT_200MS");
              window.submitCollectionReference("test_ddc_123");
            }, 200);
          </script>
        `,
      },
    }),
    PaymentIntentWithInstallments: getCustomExchange({
      Request: {
        currency: "BRL",
        installment_options: [
          {
            payment_method: "card",
            installments: [
              {
                number_of_installments: [3, 6, 12],
                billing_frequency: "month",
                interest_rate: 5.0,
              },
            ],
          },
        ],
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    CardInstallmentConfirm: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_type: "credit",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        installment_data: {
          number_of_installments: 3,
          billing_frequency: "month",
        },
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    PaymentIntentWithInstallmentsAndConfirmTrue: getCustomExchange({
      Request: {
        currency: "BRL",
        confirm: true,
        installment_options: [
          {
            payment_method: "card",
            installments: [
              {
                number_of_installments: [3, 6, 12],
                billing_frequency: "month",
                interest_rate: 5.0,
              },
            ],
          },
        ],
      },
      Response: {
        status: 422,
        body: {
          error: {
            type: "invalid_request",
            message:
              "installment_options and installment_data are not supported when confirm is true.",
            code: "IR_06",
          },
        },
      },
    }),
    external_three_ds: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        authentication_type: "three_ds",
        request_external_three_ds_authentication: true,
        three_ds_data: {
          authentication_cryptogram: {
            cavv: {
              authentication_cryptogram: "3q2+78r+ur7erb7vyv66vv////8=",
            },
          },
          ds_trans_id: "c4e59ceb-a382-4d6a-bc87-385d591fa09d",
          version: "2.1.0",
          eci: "05",
          transaction_status: "Y",
          exemption_indicator: "low_value",
        },
      },
    }),
    CardTestingGuard: {
      FailConfirm: getCustomExchange({
        Request: {
          payment_method: "card",
          payment_method_data: {
            card: successfulNo3DSCardDetails,
          },
          customer_acceptance: null,
          setup_future_usage: "on_session",
        },
        Response: {
          status: 200,
          body: {
            status: "failed",
          },
        },
      }),
      GuestFailConfirm: getCustomExchange({
        Request: {
          payment_method: "card",
          payment_method_data: {
            card: successfulNo3DSCardDetails,
          },
          customer_acceptance: null,
        },
        Response: {
          status: 200,
          expectBlockedPayment: true,
          body: {
            status: "failed",
          },
        },
      }),
      BlockedConfirm: getCustomExchange({
        Request: {
          payment_method: "card",
          payment_method_data: {
            card: successfulNo3DSCardDetails,
          },
          customer_acceptance: null,
          setup_future_usage: "on_session",
        },
        Response: {
          status: 400,
          body: {
            error: {
              type: "invalid_request",
              code: "IR_16",
              message: "Blocked due to suspicious activity",
            },
          },
        },
      }),
      GuestBlockedConfirm: getCustomExchange({
        Request: {
          payment_method: "card",
          payment_method_data: {
            card: successfulNo3DSCardDetails,
          },
          customer_acceptance: null,
        },
        Response: {
          status: 400,
          body: {
            error: {
              type: "invalid_request",
              code: "IR_16",
              message: "Blocked due to suspicious activity",
            },
          },
        },
      }),
    },
    L2L3Data: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        metadata: {
          order_tax_amount: 500,
          shipping_cost: 100,
          order_po_number: "PO-12345",
        },
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    UseBillingAsPaymentMethodBilling: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
      },
    }),
    UseBillingAsPaymentMethodBillingDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
      },
    }),
    ManualPaymentUpdate: getCustomExchange({
      Request: {
        attempt_status: "pending",
        error_code: "TEST_ERROR",
        error_message: "Manual test error message",
      },
      Response: {
        status: 200,
        body: {
          attempt_status: "pending",
        },
      },
    }),
    ManualPaymentUpdateStatusOnly: getCustomExchange({
      Request: {
        attempt_status: "pending",
      },
      Response: {
        status: 200,
        body: {
          attempt_status: "pending",
        },
      },
    }),
    OrderDetails: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        order_details: [
          {
            product_name: "Test Product",
            quantity: 1,
            amount: 6000,
          },
        ],
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    OrderDetailsMultipleItems: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        order_details: [
          {
            product_name: "Test Product 1",
            quantity: 1,
            amount: 3000,
          },
          {
            product_name: "Test Product 2",
            quantity: 2,
            amount: 1500,
          },
        ],
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
    OrderDetailsMissingProductName: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        order_details: [
          {
            quantity: 1,
            amount: 6000,
          },
        ],
      },
      Response: {
        status: 400,
        body: {
          error: {
            error_type: "invalid_request",
            code: "IR_06",
          },
        },
      },
    }),
    ClientSessionInvalidConfirm: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 401,
        body: {
          error: {
            type: "invalid_request",
            message: "API key not provided or invalid API key used",
            code: "IR_01",
          },
        },
      },
    }),
    // WebhookConfig: webhook_username and webhook_password are masked
    // placeholders — not real credentials. They are safe to use in any
    // connector config as placeholder webhook auth data.
    WebhookConfig: {
      Create: getCustomExchange({
        Request: {
          webhook_details: {
            webhook_version: "1.0.2",
            webhook_username: "<WEBHOOK_USERNAME>",
            webhook_password: "<WEBHOOK_PASSWORD>",
            webhook_url: "https://example.com/webhook",
            payment_created_enabled: true,
            payment_succeeded_enabled: true,
            payment_failed_enabled: false,
            payment_statuses_enabled: ["succeeded", "failed"],
            refund_statuses_enabled: ["success", "failure"],
            payout_statuses_enabled: ["success", "failed"],
          },
        },
        Response: {
          status: 200,
          body: {
            webhook_details: {
              payment_failed_enabled: false,
              payment_statuses_enabled: ["succeeded", "failed"],
              refund_statuses_enabled: ["success", "failure"],
              payout_statuses_enabled: ["success", "failed"],
            },
          },
        },
      }),
      Update: getCustomExchange({
        Request: {
          webhook_details: {
            webhook_version: "1.0.2",
            webhook_username: "<WEBHOOK_USERNAME_UPDATED>",
            webhook_password: "<WEBHOOK_PASSWORD_UPDATED>",
            webhook_url: "https://example.com/webhook_updated",
            payment_created_enabled: true,
            payment_succeeded_enabled: true,
            payment_failed_enabled: true,
            payment_statuses_enabled: [
              "succeeded",
              "failed",
              "cancelled",
              "processing",
            ],
            refund_statuses_enabled: ["success", "failure"],
            payout_statuses_enabled: ["success", "failed", "initiated"],
          },
        },
        Response: {
          status: 200,
          body: {
            webhook_details: {
              payment_failed_enabled: true,
              payment_statuses_enabled: [
                "succeeded",
                "failed",
                "cancelled",
                "processing",
              ],
              refund_statuses_enabled: ["success", "failure"],
              payout_statuses_enabled: ["success", "failed", "initiated"],
            },
          },
        },
      }),
    },
  },
  upi_pm: {
    PaymentIntent: getCustomExchange({
      Request: {
        currency: "INR",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    UpiCollect: getCustomExchange({
      Request: {
        payment_method: "upi",
        payment_method_type: "upi_collect",
        payment_method_data: {
          upi: {
            upi_collect: {
              vpa_id: "successtest@iata",
            },
          },
        },
      },
    }),
    UpiIntent: getCustomExchange({
      Request: {
        payment_method: "upi",
        payment_method_type: "upi_intent",
        payment_method_data: {
          upi: {
            upi_intent: {},
          },
        },
      },
    }),
  },
  reward_pm: {
    PaymentIntentUSD: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 6000,
        customer_acceptance: null,
        setup_future_usage: "on_session",
        billing: standardBillingAddress,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    PaymentIntentEUR: getCustomExchange({
      Request: {
        currency: "EUR",
        amount: 6000,
        customer_acceptance: null,
        setup_future_usage: "on_session",
        billing: standardBillingAddress,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    Evoucher: getCustomExchange({
      Request: {
        payment_method: "reward",
        payment_method_type: "evoucher",
        payment_method_data: "reward",
        billing: standardBillingAddress,
      },
    }),
    Classic: getCustomExchange({
      Request: {
        payment_method: "reward",
        payment_method_type: "classic",
        payment_method_data: "reward",
        billing: standardBillingAddress,
      },
    }),
  },
  crypto_pm: {
    PaymentIntent: getCustomExchange({
      Request: {
        currency: "USD",
        customer_acceptance: null,
        setup_future_usage: "on_session",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    CryptoCurrency: getCustomExchange({
      Request: {
        payment_method: "crypto",
        payment_method_type: "crypto_currency",
        payment_method_data: {
          crypto: {
            network: "bitcoin",
            pay_currency: "BTC",
          },
        },
        billing: standardBillingAddress,
      },
    }),
    CryptoCurrencyManualCapture: getCustomExchange({
      Request: {
        payment_method: "crypto",
        payment_method_type: "crypto_currency",
        payment_method_data: {
          crypto: {
            network: "bitcoin",
            pay_currency: "BTC",
          },
        },
        billing: standardBillingAddress,
      },
    }),
  },
  pm_list: {
    PmListResponse: {
      PmListNull: {
        payment_methods: [],
      },
      pmListDynamicFieldWithoutBilling: {
        payment_methods: [
          {
            payment_method: "card",
            payment_method_types: [
              {
                payment_method_type: "credit",
                card_networks: [],
                required_fields: {},
              },
            ],
          },
        ],
      },
      pmListDynamicFieldWithBilling: {
        payment_methods: [
          {
            payment_method: "card",
            payment_method_types: [
              {
                payment_method_type: "credit",
                card_networks: [],
                required_fields: {},
              },
            ],
          },
        ],
      },
      pmListDynamicFieldWithNames: {
        payment_methods: [
          {
            payment_method: "card",
            payment_method_types: [
              {
                payment_method_type: "credit",
                card_networks: [],
                required_fields: {},
              },
            ],
          },
        ],
      },
      pmListDynamicFieldWithEmail: {
        payment_methods: [
          {
            payment_method: "card",
            payment_method_types: [
              {
                payment_method_type: "credit",
                card_networks: [],
                required_fields: {},
              },
            ],
          },
        ],
      },
    },
  },
  return_url_variations: {
    return_url_too_long: getCustomExchange({
      Request: {
        customer_id: "customer_1234567890",
        return_url: "http://example.com/" + "a".repeat(2031),
      },
      Response: {
        status: 400,
        body: {
          error: {
            message:
              "return_url must be at most 2048 characters long. Received 2050 characters",
            code: "IR_06",
            type: "invalid_request",
          },
        },
      },
    }),
    return_url_invalid_format: getCustomExchange({
      Request: {
        return_url: "not_a_valid_url",
      },
      Response: {
        status: 400,
        body: {
          error: {
            message:
              'Json deserialize error: relative URL without a base: "not_a_valid_url" at line 1 column 357',
            code: "IR_06",
            error_type: "invalid_request",
          },
        },
      },
    }),
  },
  eligibility_api: {
    PaymentIntentForBlocklist: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),
    BlocklistedCardDenied: getCustomExchange({
      Request: {
        payment_method_type: "card",
        payment_method_data: {
          card: blocklistedCardDetails,
          billing: standardBillingAddress,
        },
      },
      Response: {
        status: 200,
        body: {
          sdk_next_action: {
            next_action: {
              deny: {
                message:
                  "We're unable to accept this card, please try another card or a different payment method",
              },
            },
          },
        },
      },
    }),
    NonBlocklistedCardAllowed: getCustomExchange({
      Request: {
        payment_method_type: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
          billing: standardBillingAddress,
        },
      },
      Response: {
        status: 200,
        body: {
          // Should not have deny action for non-blocklisted cards
        },
      },
    }),
  },
  auth_service_eligibility: {
    OrgEnabledMerchantEnabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    OrgEnabledMerchantDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    OrgDisabledMerchantEnabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
          authentication_type: "no_three_ds",
        },
      },
    }),
    OrgDisabledMerchantDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
          authentication_type: "no_three_ds",
        },
      },
    }),
    MerchantOnlyEnabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    MerchantOnlyDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulNo3DSCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "succeeded",
          authentication_type: "no_three_ds",
        },
      },
    }),
    NoConfigDefault: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    // Storage flag does not affect authentication outcome — both enabled and
    // disabled flows produce the same 3DS challenge. Distinction is only
    // observable via Redis, which cannot be asserted through the API layer.
    EligibilityStorageEnabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    // Storage flag does not affect authentication outcome — both enabled and
    // disabled flows produce the same 3DS challenge. Distinction is only
    // observable via Redis, which cannot be asserted through the API layer.
    EligibilityStorageDisabled: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
  },
  threeds_routing_region_uas: (() => {
    // Region only selects which UAS deployment the pre/post-auth calls are
    // routed to — it does not change the observable payment outcome. All
    // scenarios below intentionally share one exchange definition, since a
    // valid region, an invalid region (falls back to default), and no
    // config at all (also falls back to default) are all expected to
    // produce the same 3DS challenge.
    const uasRoutingRegionExchange = getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        amount: 6500,
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    });
    return {
      Region1: uasRoutingRegionExchange,
      Region2: uasRoutingRegionExchange,
      InvalidRegion: uasRoutingRegionExchange,
      NoConfigDefault: uasRoutingRegionExchange,
    };
  })(),
  Dispute: {
    ListDisputes: {
      Response: {
        status: 200,
      },
    },
    ListDisputesWithConnectorFilter: {
      Response: {
        status: 200,
      },
    },
    ListDisputesWithTimeRange: {
      Response: {
        status: 200,
      },
    },
    ListDisputesWithInvalidStatusFilter: {
      Response: {
        status: 400,
      },
    },
    ListDisputesWithInvalidStageFilter: {
      Response: {
        status: 400,
      },
    },
    ListDisputesWithLimit: {
      Response: {
        status: 200,
      },
    },
    ListDisputesWithLargeTimeRange: {
      Response: {
        status: 200,
      },
    },
    RetrieveDispute: {
      Response: {
        status: 200,
      },
    },
    RetrieveNonExistentDispute: {
      Response: {
        status: 404,
        body: {
          error: {
            code: "HE_04",
          },
        },
      },
    },
    AcceptDispute: {
      Response: {
        status: 200,
      },
    },
    AcceptNonExistentDispute: {
      Response: {
        status: 404,
        body: {
          error: {
            code: "HE_04",
          },
        },
      },
    },
    SubmitEvidence: {
      Response: {
        status: 200,
      },
    },
    SubmitEvidenceNonExistentDispute: {
      Response: {
        status: 404,
        body: {
          error: {
            code: "HE_04",
          },
        },
      },
    },
    SubmitEvidenceEmptyBody: {
      Response: {
        status: 400,
      },
    },
    RetrieveEvidence: {
      Response: {
        status: 200,
      },
    },
    AttachEvidenceFileMissingType: {
      Response: {
        status: 400,
        body: {
          error: {
            code: "IR_04",
          },
        },
      },
    },
    FetchDisputes: {
      Response: {},
    },
    FetchDisputesWithTimeRange: {
      Response: {},
    },
    FetchDisputesMissingParams: {
      Response: {
        status: 400,
      },
    },
    FetchDisputesInvalidConnector: {
      Response: {
        status: 400,
      },
    },
  },
  mandate_id_too_long: getCustomExchange({
    Request: {
      mandate_id: "mnd_" + "a".repeat(63),
      off_session: true,
    },
    Response: {
      status: 400,
      body: {
        error: {
          message:
            "mandate_id must be at most 64 characters long. Received 67 characters",
          code: "IR_06",
          type: "invalid_request",
        },
      },
    },
  }),
  payment_method_blocking_pm: {
    BlockIssuingCountry: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: {
            card_number: "4000000000000002",
            card_exp_month: "03",
            card_exp_year: "30",
            card_holder_name: "joseph Doeeee",
            card_cvc: "737",
            card_network: "Visa",
          },
        },
      },
      Response: blockedPaymentErrorBodyForIssuingCountry,
    }),
    BlockCardType: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: {
            card_number: "4111111111111111",
            card_exp_month: "03",
            card_exp_year: "30",
            card_holder_name: "joseph Doeeee",
            card_cvc: "737",
            card_network: "Visa",
          },
        },
      },
      Response: blockedPaymentErrorBodyForDebitCard,
    }),
    BlockCardSubtype: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: {
            card_number: "378282246310005",
            card_exp_month: "03",
            card_exp_year: "30",
            card_holder_name: "joseph Doeeee",
            card_cvc: "737",
            card_network: "Visa",
          },
        },
      },
      Response: blockedPaymentErrorBodyForCardSubtype,
    }),
    BlockIfBinInfoUnavailable: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: {
            card_number: "6304000000000000",
            card_exp_month: "03",
            card_exp_year: "30",
            card_holder_name: "joseph Doeeee",
            card_cvc: "737",
            card_network: "Visa",
          },
        },
      },
      Response: blockedPaymentErrorBodyForBinUnavailable,
    }),
  },
  gift_card_pm: {
    GivexGiftCard: getCustomExchange({
      Request: {
        payment_method: "gift_card",
        payment_method_type: "givex",
        payment_method_data: {
          gift_card: {
            givex: {
              number: "6036280000000000000",
              cvc: "122222",
            },
          },
        },
        currency: "EUR",
        customer_acceptance: null,
      },
    }),
    GivexGiftCardInsufficientBalance: getCustomExchange({
      Request: {
        payment_method: "gift_card",
        payment_method_type: "givex",
        payment_method_data: {
          gift_card: {
            givex: {
              number: "6036280000000000000",
              cvc: "122222",
            },
          },
        },
        currency: "EUR",
        customer_acceptance: null,
      },
    }),
    GivexGiftCardCurrencyMismatch: getCustomExchange({
      Request: {
        payment_method: "gift_card",
        payment_method_type: "givex",
        payment_method_data: {
          gift_card: {
            givex: {
              number: "6036280000000000000",
              cvc: "122222",
            },
          },
        },
        currency: "USD",
        customer_acceptance: null,
      },
    }),
    ConnectorTestingData: getCustomExchange({
      Configs: { TRIGGER_SKIP: true },
      Request: {},
      Response: {
        status: 200,
        body: { status: "failed" },
      },
    }),
    ConnectorTestingDataConfirm: getCustomExchange({
      Configs: { TRIGGER_SKIP: true },
      Request: {},
      Response: {
        status: 200,
        body: { status: "failed" },
      },
    }),
    PaySafeCard: getCustomExchange({
      Request: {
        payment_method: "gift_card",
        payment_method_type: "pay_safe_card",
        payment_method_data: {
          gift_card: {
            pay_safe_card: {},
          },
        },
      },
    }),
  },
  voucher_pm: {
    PaymentIntent: (paymentMethodType) =>
      getCustomExchange({
        Request: {
          currency: getCurrency(paymentMethodType),
        },
        Response: {
          status: 200,
          body: {
            status: "requires_payment_method",
          },
        },
      }),
    Boleto: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "boleto",
        payment_method_data: {
          voucher: {
            boleto: {
              social_security_number: "12345678909",
              document_type: "cpf",
            },
          },
        },
        billing: {
          address: {
            line1: "Rua Test 123",
            city: "Sao Paulo",
            state: "SP",
            zip: "01310100",
            country: "BR",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "11987654321",
            country_code: "+55",
          },
          email: "test@example.com",
        },
        currency: "BRL",
      },
    }),
    Oxxo: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "oxxo",
        payment_method_data: {
          voucher: {
            oxxo: null,
          },
        },
        billing: {
          address: {
            line1: "123 Test St",
            city: "Mexico City",
            state: "Mexico",
            zip: "06600",
            country: "MX",
            first_name: "Test",
            last_name: "User",
          },
          email: "test@example.com",
        },
        currency: "MXN",
      },
    }),
    Alfamart: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "alfamart",
        payment_method_data: {
          voucher: {
            alfamart: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "Jl Test 123",
            city: "Jakarta",
            state: "DKI Jakarta",
            zip: "10110",
            country: "ID",
            first_name: "Test",
            last_name: "User",
          },
          email: "test@example.com",
        },
        currency: "IDR",
      },
    }),
    Indomaret: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "indomaret",
        payment_method_data: {
          voucher: {
            indomaret: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "Jl Test 123",
            city: "Jakarta",
            state: "DKI Jakarta",
            zip: "10110",
            country: "ID",
            first_name: "Test",
            last_name: "User",
          },
          email: "test@example.com",
        },
        currency: "IDR",
      },
    }),
    SevenEleven: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "seven_eleven",
        payment_method_data: {
          voucher: {
            seven_eleven: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
    Lawson: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "lawson",
        payment_method_data: {
          voucher: {
            lawson: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
    MiniStop: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "mini_stop",
        payment_method_data: {
          voucher: {
            mini_stop: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
    FamilyMart: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "family_mart",
        payment_method_data: {
          voucher: {
            family_mart: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
    Seicomart: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "seicomart",
        payment_method_data: {
          voucher: {
            seicomart: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
    PayEasy: getCustomExchange({
      Request: {
        payment_method: "voucher",
        payment_method_type: "pay_easy",
        payment_method_data: {
          voucher: {
            pay_easy: {
              first_name: "Test",
              last_name: "User",
              email: "test@example.com",
            },
          },
        },
        billing: {
          address: {
            line1: "1-1 Test",
            city: "Tokyo",
            state: "Tokyo",
            zip: "1000001",
            country: "JP",
            first_name: "Test",
            last_name: "User",
          },
          phone: {
            number: "312345678",
            country_code: "+81",
          },
          email: "test@example.com",
        },
        currency: "JPY",
      },
    }),
  },
  pm_collect_link: {
    pmCollectLinkCreate: {
      Request: {
        return_url: "https://example.com/return",
      },
      Response: {
        status: 200,
      },
    },
    pmCollectLinkRender: {
      Response: {
        status: 200,
      },
    },
    pmCollectLinkRenderNotFound: {
      Response: {
        status: 404,
        body: {
          error: {
            type: "invalid_request",
            code: "IR_37",
            message: "payment method collect link not found",
          },
        },
      },
    },
  },
  payment_link_pm: {
    PaymentLinkBasic: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 6000,
        description: "Test Payment Link",
        email: "test@example.com",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
    }),

    PaymentLinkWithTheme: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 7000,
        description: "Test with custom theme",
        email: "test@example.com",
        payment_link_config: {
          theme: "#FF6B35",
        },
      },
      Response: {
        status: 200,
      },
    }),
    PaymentLinkWithLogo: getCustomExchange({
      Request: {
        currency: "EUR",
        amount: 8000,
        description: "Test with merchant logo",
        email: "test@example.com",
        payment_link_config: {
          logo: "https://example.com/logo.png",
          seller_name: "Test Merchant Inc",
        },
      },
      Response: {
        status: 200,
      },
    }),
    PaymentLinkWithSdkLayout: getCustomExchange({
      Request: {
        currency: "GBP",
        amount: 5500,
        description: "Test with accordion layout",
        email: "test@example.com",
        payment_link_config: {
          sdk_layout: "accordion",
          display_sdk_only: false,
        },
      },
      Response: {
        status: 200,
      },
    }),
    PaymentLinkCardPayment: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 6000,
        description: "Test Payment Link Card Payment",
        email: "test@example.com",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
      CardData: {
        card_number: "4242424242424242",
        card_exp_month: "12",
        card_exp_year: "35",
        card_cvc: "123",
      },
    }),
    PaymentLink3DSCard: getCustomExchange({
      Request: {
        currency: "USD",
        amount: 6000,
        description: "Test Payment Link 3DS Card",
        email: "test@example.com",
        authentication_type: "three_ds",
      },
      CardData: {
        card_number: "4000002500003155",
        card_exp_month: "12",
        card_exp_year: "35",
        card_cvc: "123",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_capture",
        },
      },
    }),
    PaymentLinkTabsLayout: getCustomExchange({
      Request: {
        currency: "EUR",
        amount: 6500,
        description: "Test with tabs layout",
        email: "test@example.com",
        payment_link_config: {
          sdk_layout: "tabs",
          display_sdk_only: false,
        },
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
        },
      },
      CardData: {
        card_number: "4242424242424242",
        card_exp_month: "12",
        card_exp_year: "35",
        card_cvc: "123",
      },
    }),
  },
  relay_pm: {
    RefundRelay: {
      Request: {
        type: "refund",
        data: {
          refund: {
            amount: 1000,
            currency: "USD",
          },
        },
      },
      Response: {
        status: 200,
        body: {
          type: "refund",
        },
      },
    },
    CaptureRelay: {
      Request: {
        type: "capture",
        data: {
          capture: {
            authorized_amount: 2000,
            amount_to_capture: 1500,
            currency: "USD",
          },
        },
      },
      Response: {
        status: 200,
        body: {
          type: "capture",
        },
      },
    },
    RetrieveRelay: {
      Request: {},
      Response: {
        status: 200,
        body: {
          type: "refund",
        },
      },
    },
    RetrieveCaptureRelay: {
      Request: {},
      Response: {
        status: 200,
        body: {
          type: "capture",
        },
      },
    },
    MissingConnectorId: {
      Request: {
        connector_resource_id: "test_connector_resource_id",
        type: "refund",
        data: {
          refund: {
            amount: 1000,
            currency: "USD",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            message: "Json deserialize error: missing field `connector_id`",
            code: "IR_06",
          },
        },
      },
    },
    InvalidRelayType: {
      Request: {
        connector_resource_id: "test_connector_resource_id",
        connector_id: "test_connector_id",
        type: "invalid_type",
        data: {
          refund: {
            amount: 1000,
            currency: "USD",
          },
        },
      },
      Response: {
        status: 400,
        body: {
          error: {
            message: "Json deserialize error: unknown variant `invalid_type`",
            code: "IR_06",
          },
        },
      },
    },
    RelayNotFound: {
      Request: {},
      Response: {
        status: 400,
        body: {
          error: {
            code: "IR_37",
            message: "relay not found",
          },
        },
      },
    },
  },
  card_redirect_pm: {
    PaymentIntent: getCustomExchange({
      Request: {
        currency: "USD",
      },
    }),
    CardRedirect: getCustomExchange({
      Request: {
        payment_method: "card_redirect",
        payment_method_type: "card_redirect",
        payment_method_data: {
          card_redirect: {
            card_redirect: {},
          },
        },
      },
    }),
  },
  step_up_auth: {
    PaymentIntentOnly: getCustomExchange({
      Request: {
        currency: "USD",
        authentication_type: "three_ds",
        request_external_three_ds_authentication: true,
        setup_future_usage: "off_session",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_payment_method",
          authentication_type: "three_ds",
        },
      },
    }),
    ConfirmPayment: getCustomExchange({
      Request: {
        payment_method: "card",
        payment_method_data: {
          card: successfulThreeDSTestCardDetails,
        },
        currency: "USD",
        authentication_type: "three_ds",
        request_external_three_ds_authentication: true,
        setup_future_usage: "off_session",
      },
      Response: {
        status: 200,
        body: {
          status: "requires_customer_action",
          authentication_type: "three_ds",
        },
      },
    }),
    ThreeDSAuthentication: getCustomExchange({
      Request: {
        device_channel: "BRW",
        threeds_method_comp_ind: "Y",
      },
      Response: {
        status: 200,
        body: {},
      },
    }),
    ThreeDSAuthenticationUnconfirmed: getCustomExchange({
      Request: {
        device_channel: "BRW",
        threeds_method_comp_ind: "Y",
      },
      Response: {
        status: 400,
        body: {
          error: {
            type: "invalid_request",
            code: "IR_16",
            message:
              "You cannot authenticate this payment because payment_attempt.external_three_ds_authentication_attempted is false",
          },
        },
      },
    }),
    AuthorizeAfterFrictionlessAuth: getCustomExchange({
      Request: {},
      Response: {
        status: 200,
        body: {
          status: "succeeded",
        },
      },
    }),
  },
};
