/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PazeSessionComplete = { /** * Unique identifier generated by Paze to track and link the wallet transaction. Used as the wallet transaction identifier. */ payloadId: string; /** * Opaque token returned by Paze for the completion call. */ completeResponse: string | null; /** * Signed and encrypted payload containing the data necessary to process the payment. Returned when `payloadTypeIndicator` is PAYMENT. */ securePayload: string | null; /** * Echo of the `clientContext` sent on the request. Returned by Paze for client-side tracing. */ clientContext: string; /** * Paze-issued session identifier returned for tracing. */ ewSID: string; /** * Server timestamp of the Paze response in ISO 8601 format. Returned for tracing. */ timestampIso8601: string; }; /** @internal */ export const PazeSessionComplete$inboundSchema: z.ZodType< PazeSessionComplete, z.ZodTypeDef, unknown > = z.object({ payloadId: z.string(), completeResponse: z.nullable(z.string()), securePayload: z.nullable(z.string()), clientContext: z.string(), ewSID: z.string(), timestampISO8601: z.string(), }).transform((v) => { return remap$(v, { "timestampISO8601": "timestampIso8601", }); }); export function pazeSessionCompleteFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PazeSessionComplete$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PazeSessionComplete' from JSON`, ); }