indusbit-math
Version:
React Native package for Snapmint payment integration with EMI widget components and enhanced callback-based API
96 lines (88 loc) • 2.46 kB
TypeScript
declare module "indusbit-math" {
export interface PaymentData {
finalData: {
merchant_key: string;
merchant_token: string;
merchant_id: number;
merchant_confirmation_url: string;
merchant_failure_url: string;
mobile: string;
store_id: number;
order_id: string;
order_value: number;
udf1?: any;
udf2?: any;
full_name: string;
email: string;
billing_address_line1?: string;
billing_zip?: string;
shipping_address_line1?: string;
shipping_zip?: string;
deviceType?: string;
products?: Array<{
sku: string;
name: string;
quantity: number;
unit_price: number;
udf1?: any;
udf2?: any;
}>;
};
base_url: string;
suc_url: string;
fail_url: string;
}
export interface PaymentResult {
status: string;
statusCode: number;
message: string;
responseMsg: string;
paymentId?: string;
}
export interface PaymentError {
status: string;
statusCode: number;
message: string;
responseMsg: string;
}
export interface RNSnapmintButtonProps {
amount: string;
merchantPath?: string; // Merchant config path (e.g., "1616/snap_ketch.json") - NEW
jsonUrl?: string; // Full URL for merchant config (deprecated, use merchantPath) - LEGACY
fontFamily?: {
fontFamily: string;
fontMultiplier: number;
};
buttonWidth?: number;
disablePopup?: boolean;
}
export const RNSnapmintButton: React.FC<RNSnapmintButtonProps>;
export namespace Components {
interface CardProps {
title?: string;
cardStyle?: object;
titleStyle?: object;
contentStyle?: object;
children?: React.ReactNode;
}
export const Card: React.FC<CardProps>;
interface MultiplyButtonProps {
buttonStyle?: object;
textStyle?: object;
resultStyle?: object;
containerStyle?: object;
title?: string;
defaultValueA?: string;
defaultValueB?: string;
onResult?: (result: number | string) => void;
}
export const MultiplyButton: React.FC<MultiplyButtonProps>;
}
export interface PaymentOptions {
onSuccess?: (result: PaymentResult) => void;
onError?: (error: PaymentError) => void;
}
export default class RNSnapmintCheckout {
static openSnapmintMerchant(checkoutUrl: string, options?: PaymentOptions): Promise<PaymentResult>;
}
}