UNPKG

@aajsa/moyasar-client

Version:

A lightweight and type-safe TypeScript client for interacting with Moyasar Payment Gateway APIs.

30 lines (28 loc) 730 B
import { z } from "zod/v4-mini"; //#region src/schema/source.ts const sourcesEndpoints = { getIssuer: { path: "/source/issuer", method: "POST", input: z.object({ source: z.discriminatedUnion("type", [z.object({ type: z.literal("creditcard"), number: z.string().check(z.regex(/^\d{16,19}$/)) }), z.object({ type: z.literal("applepay"), token: z.string().check(z.startsWith("token_")) })]) }), output: z.object({ issuer_name: z.string(), issuer_country: z.string(), issuer_card_type: z.enum([ "debit", "credit", "charge_card", "unspecified" ]), issuer_card_category: z.string(), first_digits: z.string(), last_digits: z.nullish(z.string()) }) } }; //#endregion export { sourcesEndpoints };