/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; /** * Create a Paze transaction with a device token. */ export type PazePaymentMethodCreate = { /** * The external identifier of the buyer to create a payment for. */ buyerExternalIdentifier?: string | null | undefined; /** * The ID of the buyer to retrieve billing details for. */ buyerId?: string | null | undefined; /** * The card holder name associated to the original card for the token. */ cardholderName?: string | null | undefined; /** * The URL to redirect a user back to after the complete 3DS in browser. */ redirectUrl?: string | null | undefined; /** * The last 4 digits of the original card used to generate the token. */ cardSuffix?: string | null | undefined; /** * The original card scheme for which the token was generated. */ cardScheme?: string | null | undefined; /** * The payment scheme of the card. */ cardType?: string | null | undefined; /** * Always `paze` */ method: "paze"; /** * The opaque token as received from the Paze complete response. */ token: string; /** * The signed checkout JWS as received from the Paze checkout response. */ checkoutToken?: string | null | undefined; }; /** @internal */ export type PazePaymentMethodCreate$Outbound = { buyer_external_identifier?: string | null | undefined; buyer_id?: string | null | undefined; cardholder_name?: string | null | undefined; redirect_url?: string | null | undefined; card_suffix?: string | null | undefined; card_scheme?: string | null | undefined; card_type?: string | null | undefined; method: "paze"; token: string; checkout_token?: string | null | undefined; }; /** @internal */ export const PazePaymentMethodCreate$outboundSchema: z.ZodType< PazePaymentMethodCreate$Outbound, z.ZodTypeDef, PazePaymentMethodCreate > = z.object({ buyerExternalIdentifier: z.nullable(z.string()).optional(), buyerId: z.nullable(z.string()).optional(), cardholderName: z.nullable(z.string()).optional(), redirectUrl: z.nullable(z.string()).optional(), cardSuffix: z.nullable(z.string()).optional(), cardScheme: z.nullable(z.string()).optional(), cardType: z.nullable(z.string()).optional(), method: z.literal("paze"), token: z.string(), checkoutToken: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { buyerExternalIdentifier: "buyer_external_identifier", buyerId: "buyer_id", cardholderName: "cardholder_name", redirectUrl: "redirect_url", cardSuffix: "card_suffix", cardScheme: "card_scheme", cardType: "card_type", checkoutToken: "checkout_token", }); }); export function pazePaymentMethodCreateToJSON( pazePaymentMethodCreate: PazePaymentMethodCreate, ): string { return JSON.stringify( PazePaymentMethodCreate$outboundSchema.parse(pazePaymentMethodCreate), ); }