@fenil265/fundly-payment-sdk
Version:
Fundly Payment SDK for seamless integration with Fundly Pay systems.
59 lines • 2.18 kB
TypeScript
/**
* Payment API Wrapper with Analytics
* Wraps payment API calls with analytics tracking
*/
import type { MakePaymentPayload, MakePaymentResponse } from './payment.api';
/**
* Extended payload with analytics data
* Note: Fields below are for analytics only and are excluded from the API call
*/
export interface AnalyticsPaymentPayload extends MakePaymentPayload {
salesmanId?: number;
salesmanName?: string;
salesmanPhoneNumber?: string;
invoiceCount?: number;
chemistName?: string;
chemistId?: string;
distributorName?: string;
mobileNumber?: string;
}
/**
* Make payment with analytics tracking
*/
export declare function makePaymentWithAnalytics(payload: AnalyticsPaymentPayload): Promise<MakePaymentResponse>;
/**
* Track payment success from polling/webhook
* Call this when payment status changes to SUCCESS
*/
export declare function trackPaymentSuccessFromStatus(paymentMode: string, amount: number, invoiceCount: number, transactionId?: string, salesmanId?: number, salesmanName?: string, invoiceIds?: string, additionalDetails?: {
paymentType?: string;
paymentDate?: string | null;
transactionDate?: string;
transactionDateFormatted?: string;
distributorId?: string;
distributorName?: string;
chemistId?: string;
chemistName?: string;
chemistCode?: string;
mobileNumber?: string;
partyCode?: string;
upiTxnRefNo?: string | null;
}, salesmanPhone?: string): void;
/**
* Track payment failure from polling/webhook
* Call this when payment status changes to FAILED
*/
export declare function trackPaymentFailureFromStatus(paymentMode: string, amount: number, invoiceCount: number, error?: string, transactionId?: string, salesmanId?: number, salesmanName?: string, invoiceIds?: string, additionalDetails?: {
paymentType?: string;
paymentDate?: string | null;
transactionDate?: string;
distributorId?: string;
distributorName?: string;
chemistId?: string;
chemistName?: string;
chemistCode?: string;
mobileNumber?: string;
partyCode?: string;
upiTxnRefNo?: string | null;
}): void;
//# sourceMappingURL=payment.api.wrapper.d.ts.map