/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; /** * The method to use, this can be any of the methods that support redirect requests. */ export const RedirectPaymentMethodCreateMethod = { Abitab: "abitab", Affirm: "affirm", Afterpay: "afterpay", Alipay: "alipay", Alipayhk: "alipayhk", Arcuspaynetwork: "arcuspaynetwork", Bacs: "bacs", Bancontact: "bancontact", Bcp: "bcp", Becs: "becs", Bitpay: "bitpay", Blik: "blik", Boleto: "boleto", Boost: "boost", Breb: "breb", Ach: "ach", Capitec: "capitec", Cashapp: "cashapp", Cashappafterpay: "cashappafterpay", Clearpay: "clearpay", CustomPush: "custom_push", CustomRedirect: "custom_redirect", CustomTokenize: "custom_tokenize", Dana: "dana", Dcb: "dcb", Dlocal: "dlocal", Duitnow: "duitnow", Ebanx: "ebanx", Eckoh: "eckoh", Efecty: "efecty", Eps: "eps", Everydaypay: "everydaypay", Gcash: "gcash", Gem: "gem", Gemds: "gemds", Giropay: "giropay", Givingblock: "givingblock", Gocardless: "gocardless", Gopay: "gopay", Grabpay: "grabpay", Ideal: "ideal", Interac: "interac", Kakaopay: "kakaopay", Kcp: "kcp", Khipu: "khipu", Klarna: "klarna", Konbini: "konbini", Latitude: "latitude", Latitudeds: "latitudeds", Laybuy: "laybuy", Linepay: "linepay", Linkaja: "linkaja", Maybankqrpay: "maybankqrpay", Mercadopago: "mercadopago", Multibanco: "multibanco", Multipago: "multipago", Netbanking: "netbanking", Nupay: "nupay", Nequi: "nequi", Oney10x: "oney_10x", Oney12x: "oney_12x", Oney3x: "oney_3x", Oney4x: "oney_4x", Oney6x: "oney_6x", Onlinebankingcz: "onlinebankingcz", Onelink: "onelink", Ovo: "ovo", Oxxo: "oxxo", P24: "p24", Pagoefectivo: "pagoefectivo", Paybybank: "paybybank", Payid: "payid", Paymaya: "paymaya", Paysquad: "paysquad", Paypal: "paypal", Paypaldirectorder: "paypaldirectorder", Paypalpaylater: "paypalpaylater", Paypay: "paypay", Payto: "payto", Payvalida: "payvalida", Picpay: "picpay", Pix: "pix", Pse: "pse", Rabbitlinepay: "rabbitlinepay", Rapipago: "rapipago", Razorpay: "razorpay", Redpagos: "redpagos", Scalapay: "scalapay", Sepa: "sepa", Servipag: "servipag", Seveneleven: "seveneleven", Sezzle: "sezzle", Shopeepay: "shopeepay", Singteldash: "singteldash", Smartpay: "smartpay", Sofort: "sofort", Spei: "spei", Stitch: "stitch", Swish: "swish", Stripe: "stripe", Stripedd: "stripedd", Stripetoken: "stripetoken", Tapi: "tapi", Tapifintechs: "tapifintechs", Thaiqr: "thaiqr", Touchngo: "touchngo", Truemoney: "truemoney", Trustly: "trustly", Trustlyeurope: "trustlyeurope", Upi: "upi", Venmo: "venmo", Vipps: "vipps", Waave: "waave", Webpay: "webpay", Wechat: "wechat", Wero: "wero", Yape: "yape", Zippay: "zippay", } as const; /** * The method to use, this can be any of the methods that support redirect requests. */ export type RedirectPaymentMethodCreateMethod = OpenEnum< typeof RedirectPaymentMethodCreateMethod >; /** * Create a transaction for an APM/LPM that requires a redirect. */ export type RedirectPaymentMethodCreate = { /** * The method to use, this can be any of the methods that support redirect requests. */ method: RedirectPaymentMethodCreateMethod; /** * The `id` of a stored buyer to use Use this instead of the `buyer_external_identifier`. */ buyerId?: string | null | undefined; /** * The `external_identifier` of a stored buyer to use. Use this instead of the `buyer_id`. */ buyerExternalIdentifier?: string | null | undefined; /** * The 2-letter ISO code of the country to use this payment method for. This is used to select the payment service to use. */ country: string; /** * The ISO-4217 currency code to use this payment method for. This is used to select the payment service to use. */ currency: string; /** * The redirect URL to redirect a buyer to after they have authorized the payment method. */ redirectUrl: string; /** * The merchant identifier for this payment method. */ externalIdentifier?: string | null | undefined; }; /** @internal */ export const RedirectPaymentMethodCreateMethod$outboundSchema: z.ZodType< string, z.ZodTypeDef, RedirectPaymentMethodCreateMethod > = openEnums.outboundSchema(RedirectPaymentMethodCreateMethod); /** @internal */ export type RedirectPaymentMethodCreate$Outbound = { method: string; buyer_id?: string | null | undefined; buyer_external_identifier?: string | null | undefined; country: string; currency: string; redirect_url: string; external_identifier?: string | null | undefined; }; /** @internal */ export const RedirectPaymentMethodCreate$outboundSchema: z.ZodType< RedirectPaymentMethodCreate$Outbound, z.ZodTypeDef, RedirectPaymentMethodCreate > = z.object({ method: RedirectPaymentMethodCreateMethod$outboundSchema, buyerId: z.nullable(z.string()).optional(), buyerExternalIdentifier: z.nullable(z.string()).optional(), country: z.string(), currency: z.string(), redirectUrl: z.string(), externalIdentifier: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { buyerId: "buyer_id", buyerExternalIdentifier: "buyer_external_identifier", redirectUrl: "redirect_url", externalIdentifier: "external_identifier", }); }); export function redirectPaymentMethodCreateToJSON( redirectPaymentMethodCreate: RedirectPaymentMethodCreate, ): string { return JSON.stringify( RedirectPaymentMethodCreate$outboundSchema.parse( redirectPaymentMethodCreate, ), ); }