UNPKG

afrimomo-sdk

Version:

A unified SDK for African payment providers

181 lines 5.58 kB
import type { MoMoCurrency, Correspondent } from "../../../types"; export declare namespace PawaPayTypes { interface PaymentData { depositId: string; returnUrl: string; statementDescription: string; amount: string; msisdn: string; language: "EN" | "FR"; country: string; reason: string; metadata?: Array<{ fieldName: string; fieldValue: string; isPII?: boolean; }>; } interface InitiatePaymentResponse { redirectUrl: string; error: boolean; message?: string; } interface PaymentTransaction { depositId: string; status: PaymentStatus; requestedAmount: string; depositedAmount: string; currency: MoMoCurrency; country: string; payer: Payer; correspondent: Correspondent; statementDescription: string; customerTimestamp: string; created: string; respondedByPayer: string; correspondentIds: { [key: string]: string; }; suspiciousActivityReport?: SuspiciousActivityReport[]; } interface Payer { type: string; address: { value: string; }; } interface SuspiciousActivityReport { activityType: string; comment: string; } type PaymentStatus = "PENDING" | "COMPLETED" | "FAILED" | "CANCELLED"; interface PayoutTransaction { payoutId: string; amount: string; currency: string; correspondent: string; recipient: { type: "MSISDN"; address: { value: string; }; }; customerTimestamp: string; statementDescription: string; country?: string; metadata?: Array<{ fieldName: string; fieldValue: string; isPII?: boolean; }>; } interface PayoutStatusTransaction { payoutId: string; status: PayoutStatus; created: string; } interface BulkPayoutResponse { transactions: Array<{ payoutId: string; status: PayoutStatus; created: string; rejectionReason?: { rejectionCode: string; rejectionMessage: string; }; }>; } enum PayoutStatus { ACCEPTED = "ACCEPTED", ENQUEUED = "ENQUEUED", REJECTED = "REJECTED", DUPLICATE_IGNORED = "DUPLICATE_IGNORED" } type ResendCallbackResponseStatus = "ACCEPTED" | "REJECTED" | "FAILED"; interface ResendCallbackResponse { payoutId: string; status: ResendCallbackResponseStatus; rejectionReason?: string; } interface RefundResponse { refundId: string; status: "ACCEPTED" | "REJECTED" | "DUPLICATE_IGNORED"; created?: Date; rejectionReason?: { rejectionCode: RefundRejectionCode; rejectionMessage: string; }; } type RefundRejectionCode = "DEPOSIT_NOT_FOUND" | "DEPOSIT_NOT_COMPLETED" | "ALREADY_REFUNDED" | "IN_PROGRESS" | "INVALID_AMOUNT" | "AMOUNT_TOO_SMALL" | "AMOUNT_TOO_LARGE" | "PARAMETER_INVALID" | "INVALID_INPUT" | "REFUNDS_NOT_ALLOWED" | "CORRESPONDENT_TEMPORARILY_UNAVAILABLE"; interface RefundTransaction { refundId: string; status: "ACCEPTED" | "SUBMITTED" | "ENQUEUED" | "COMPLETED" | "FAILED"; amount: string; currency: MoMoCurrency; country: string; correspondent: Correspondent; recipient: Payer; customerTimestamp: string; statementDescription?: string; created: string; receivedByRecipient?: string; correspondentIds?: { [key: string]: string; }; failureReason?: { failureCode: RefundFailureCode; failureMessage: string; }; } type RefundFailureCode = "BALANCE_INSUFFICIENT" | "RECIPIENT_NOT_FOUND" | "RECIPIENT_NOT_ALLOWED_TO_RECEIVE" | "OTHER_ERROR"; interface WalletBalance { country: string; balance: string; currency: string; mno: string; } interface WalletBalancesResponse { balances: WalletBalance[]; } type OperationStatus = "OPERATIONAL" | "DELAYED" | "CLOSED"; type OperationType = "DEPOSIT" | "PAYOUT" | "REFUND"; interface CorrespondentOperation { operationType: OperationType; status: OperationStatus; } interface NetworkCorrespondent { correspondent: string; operationTypes: CorrespondentOperation[]; } interface CountryCorrespondents { country: string; correspondents: NetworkCorrespondent[]; } type AvailabilityResponse = CountryCorrespondents[]; interface OperationConfig { operationType: OperationType; minTransactionLimit: string; maxTransactionLimit: string; } interface CorrespondentConfig { correspondent: string; currency: string; ownerName: string; operationTypes: OperationConfig[]; } interface CountryConfig { country: string; correspondents: CorrespondentConfig[]; } interface ActiveConfigResponse { merchantId: string; merchantName: string; countries: CountryConfig[]; } interface PaymentApiResponse { redirectUrl: string; [key: string]: unknown; } } export default PawaPayTypes; //# sourceMappingURL=index.d.ts.map