UNPKG

@qrph/qrph

Version:

Library for parsing and encoding QRPH strings.

186 lines 6.1 kB
import { z } from "zod"; export declare const RECIPIENT_TYPES: readonly ["com.p2pqrpay", "ph.ppmi.p2m"]; export type RecipientType = (typeof RECIPIENT_TYPES)[number]; export declare const zRecipientType: z.ZodEnum<["com.p2pqrpay", "ph.ppmi.p2m"]>; /** * Information about the recipient specific to QRPH. * * - For P2P (personal) codes, this is field 27 and field 00 is `com.p2pqrpay`. * - For P2M (business) codes, this is field 28 and field 00 is `ph.ppmi.p2m`. */ export declare const zQRPHRecipientInfo: z.ZodObject<{ type: z.ZodEnum<["com.p2pqrpay", "ph.ppmi.p2m"]>; /** * Recipient bank code. (Field 01) */ bankCode: z.ZodString; /** * The account number of the recipient. (Field 03) */ accountNumber: z.ZodString; }, "strip", z.ZodTypeAny, { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }, { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }>; export type QRPHRecipientInfo = z.infer<typeof zQRPHRecipientInfo>; export declare const POINT_OF_INITIATION_METHODS: readonly ["static", "dynamic"]; export type PointOfInitiationMethod = (typeof POINT_OF_INITIATION_METHODS)[number]; export declare const zPointOfInitiationMethod: z.ZodEnum<["static", "dynamic"]>; export declare const POINT_OF_INITIATION_METHOD_MAP: Record<string, PointOfInitiationMethod>; export declare const zRootQRInfo: z.ZodObject<{ /** * The method used to determine the point of initiation. */ pointOfInitiationMethod: z.ZodEnum<["static", "dynamic"]>; /** * The merchant category code. 4 digits. */ merchantCategoryCode: z.ZodString; /** * The transaction currency. 3 digits. */ transactionCurrency: z.ZodString; /** * The transaction amount. Includes the decimal point. Left as a string to avoid floating point issues. * * If absent, the application should prompt the consuemr to enter the transaction amount. */ transactionAmount: z.ZodOptional<z.ZodString>; /** * The country code of the merchant. 2 characters. */ countryCode: z.ZodString; /** * The name of the recipient. */ merchantName: z.ZodString; /** * The city of the recipient. * * - In Maya and BPI, this is the city. * - In BDO and Shopee, this is the province. * - In GCash, this is a barangay. */ merchantCity: z.ZodString; /** * The postal code of the recipient. */ postalCode: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { pointOfInitiationMethod: "static" | "dynamic"; merchantCategoryCode: string; transactionCurrency: string; countryCode: string; merchantName: string; merchantCity: string; transactionAmount?: string | undefined; postalCode?: string | undefined; }, { pointOfInitiationMethod: "static" | "dynamic"; merchantCategoryCode: string; transactionCurrency: string; countryCode: string; merchantName: string; merchantCity: string; transactionAmount?: string | undefined; postalCode?: string | undefined; }>; export type RootQRInfo = z.infer<typeof zRootQRInfo>; export declare const zQRPHData: z.ZodObject<z.objectUtil.extendShape<{ /** * The method used to determine the point of initiation. */ pointOfInitiationMethod: z.ZodEnum<["static", "dynamic"]>; /** * The merchant category code. 4 digits. */ merchantCategoryCode: z.ZodString; /** * The transaction currency. 3 digits. */ transactionCurrency: z.ZodString; /** * The transaction amount. Includes the decimal point. Left as a string to avoid floating point issues. * * If absent, the application should prompt the consuemr to enter the transaction amount. */ transactionAmount: z.ZodOptional<z.ZodString>; /** * The country code of the merchant. 2 characters. */ countryCode: z.ZodString; /** * The name of the recipient. */ merchantName: z.ZodString; /** * The city of the recipient. * * - In Maya and BPI, this is the city. * - In BDO and Shopee, this is the province. * - In GCash, this is a barangay. */ merchantCity: z.ZodString; /** * The postal code of the recipient. */ postalCode: z.ZodOptional<z.ZodString>; }, { recipient: z.ZodObject<{ type: z.ZodEnum<["com.p2pqrpay", "ph.ppmi.p2m"]>; /** * Recipient bank code. (Field 01) */ bankCode: z.ZodString; /** * The account number of the recipient. (Field 03) */ accountNumber: z.ZodString; }, "strip", z.ZodTypeAny, { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }, { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }>; _raw: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>; }>, "strip", z.ZodTypeAny, { pointOfInitiationMethod: "static" | "dynamic"; merchantCategoryCode: string; transactionCurrency: string; countryCode: string; merchantName: string; merchantCity: string; recipient: { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }; _raw: Record<string, string | Record<string, string>>; transactionAmount?: string | undefined; postalCode?: string | undefined; }, { pointOfInitiationMethod: "static" | "dynamic"; merchantCategoryCode: string; transactionCurrency: string; countryCode: string; merchantName: string; merchantCity: string; recipient: { type: "com.p2pqrpay" | "ph.ppmi.p2m"; bankCode: string; accountNumber: string; }; _raw: Record<string, string | Record<string, string>>; transactionAmount?: string | undefined; postalCode?: string | undefined; }>; export type QRPHData = z.infer<typeof zQRPHData>; //# sourceMappingURL=schema.d.ts.map