///
import { MobileMoneyCheckoutOptions, CheckoutResult, PaymentProvider, RefundOptions, RefundResult, CreditCardCheckoutOptions, MobileMoneyPayoutOptions, PayoutResult, RedirectCheckoutOptions } from "../payment-provider.interface";
import EventEmitter2 from "eventemitter2";
import { PaymentFailedEvent, PaymentSuccessfulEvent } from "../payment-events";
export declare enum TaarihTransactionStatus {
PENDING = "PENDING",
COMPLETED = "COMPLETED",
FAILED = "FAILED"
}
declare class TaarihPaymentProvider implements PaymentProvider {
private config;
private api;
private eventEmitter?;
constructor(config: TaarihPaymentProviderConfig);
useEventEmitter(eventEmitter: EventEmitter2): void;
private getTaarihPaymentMethod;
login(): Promise;
checkout(options: MobileMoneyCheckoutOptions | CreditCardCheckoutOptions): Promise;
checkoutMobileMoney(options: MobileMoneyCheckoutOptions): Promise;
checkoutCreditCard(options: CreditCardCheckoutOptions): Promise;
checkoutRedirect(options: RedirectCheckoutOptions): Promise;
refund(options: RefundOptions): Promise;
payoutMobileMoney(options: MobileMoneyPayoutOptions): Promise;
handleWebhook(rawBody: Buffer | string | Record): Promise;
callback(internalId: string, timeInterval?: number, maxAttempts?: number): Promise>;
}
export type TaarihPaymentProviderConfig = {
phoneNumber: string;
password: string;
mode: "test" | "live";
visitorId: string;
callingCode: string;
};
export type SignEndUserOtpRequiredResponse = {
otpRequired: boolean;
message: string;
token: string;
};
export type SignEndUserSuccessResponse = {
token: string;
id: number;
legalEntityId: number;
legalEntityName: string;
refreshToken: string;
firstName: string;
lastName: string;
phoneNumber: string;
userBankAccounts: {
id: number;
commercial_name: string;
technical_name: string;
}[];
};
export type TaarihApiErrorResponse = {
statusCode: number;
timestamp: string;
path: string;
message: string;
invalidData: Record | null;
};
export type TaarihCheckoutSuccessResponse = {
externalId: string;
payment_link: string;
internalId: string;
};
export type TaarihCreditCardCheckoutSuccessResponse = {
results?: TaarihCheckoutSuccessResponse[];
};
export type TaarihCheckoutPreAuthSuccessResponse = {
amount: number;
fees: number;
totalAmount: number;
paymentMethod: string;
};
export type TaarihPaymentWebhookBody = {
transactionId: string;
maxAttempts: number;
timeInterval: number;
};
export type TaarihTransactionStatusSuccessResponse = {
status: string;
amount: number;
currency: string;
bankAccountSender: string | null;
bankAccount: {
id: number;
refId: string;
commercial_name: string;
technical_name: string;
type: string;
mainAccountNumber: string;
subAccountNumber: ({
subAccountNumber: string;
financialSubAccount: string;
} | {
subAccountNumber: string;
financialSubAccount: string;
}[])[];
externalId: string | null;
lettrable: any | null;
rules: any | null;
active: boolean;
createdAt: string;
updatedAt: string;
accountOwnerId: number | null;
legalEntityOwnerId: number;
technicalAccountType: string;
balance: number;
attributions: any[];
partnerAccountNumber: string | null;
financialProductId: number;
status: string;
};
};
export default TaarihPaymentProvider;
//# sourceMappingURL=taarih.d.ts.map