UNPKG

@setu/upi-deep-links

Version:

NPM package to connect to Setu's UPI Deep Link APIs

49 lines (48 loc) 2.48 kB
import { BatchRefundStatusResponseData, CreatePaymentLinkResponseData, Deduction, GetPaymentStatusResponseData, InitiateRefundAmountParams, InitiateRefundResponseData, RefundResponseSuccessData, Settlement, TriggerMockPaymentResponseData, ValidationRules } from "./helpers/types"; export declare type AmountExactness = "ANY" | "EXACT" | "EXACT_UP" | "EXACT_DOWN" | "RANGE"; export declare type CreatePaymentLinkParams = { readonly amountValue: number; readonly billerBillID: string; readonly amountExactness: AmountExactness; readonly payeeName?: string; readonly expiryDate?: string; readonly settlement?: Settlement; readonly validationRules?: ValidationRules; readonly transactionNote?: string; readonly additionalInfo?: Record<string, string>; readonly campaignID?: string; }; export declare type TriggerMockPaymentParams = { readonly amountValue: number; readonly vpa: string; readonly platformBillID: string; }; export declare type InitiateRefundParams = { readonly refunds: readonly RefundRequest[]; }; declare type RefundRequest = InitiateRefundAmountParams & { readonly identifier: string; readonly identifierType: "BILL_ID"; readonly deductions?: readonly Deduction[]; }; export declare type RefundStatusIdentifierType = "batch" | "bill"; export declare type SetuUPIDeepLinkInstance = { readonly createPaymentLink: (body: CreatePaymentLinkParams) => Promise<CreatePaymentLinkResponseData>; readonly getPaymentStatus: (platformBillID: string) => Promise<GetPaymentStatusResponseData>; readonly expireBill: (platformBillID: string) => Promise<void>; readonly initiateRefund: (body: InitiateRefundParams) => Promise<InitiateRefundResponseData>; readonly getRefundBatchStatus: (batchID: string) => Promise<BatchRefundStatusResponseData>; readonly getRefundStatusByIdentifier: (identifierType: RefundStatusIdentifierType, identifierValue: string) => Promise<BatchRefundStatusResponseData>; readonly getRefundStatus: (refundID: string) => Promise<RefundResponseSuccessData>; readonly triggerMockPayment: (body: TriggerMockPaymentParams) => Promise<TriggerMockPaymentResponseData>; readonly isSetuError: (err: any) => err is SetuError; }; export declare type SetuError = { readonly code: string; readonly detail: string; readonly docURL: string; readonly title: string; readonly errors: readonly unknown[]; readonly traceID: string; }; export {};