ngx-pesapal
Version:
Angular schematics lib for abstracting Pesapal APIs
43 lines (42 loc) • 2.33 kB
TypeScript
import { Observable } from 'rxjs';
import { ISubmitOrderResponse, ISubmitOrderRequest, IKeys, ITransactionStatusResponse, IRecurringPaymentsRequest, IRecurringPaymentsResponse, IRefundRequest, IRefundResponse } from '../types';
import * as i0 from "@angular/core";
export declare class ApiService {
private credentials;
private http;
private destroy;
private token;
private store;
constructor(credentials: IKeys);
submitOrderRequest(data: Partial<ISubmitOrderRequest> | ISubmitOrderRequest): Observable<ISubmitOrderResponse>;
/**
* Retrieves transaction status from the Pesapal API based on the provided tracking ID.
* This method sends a GET request to the Pesapal API endpoint responsible for retrieving transaction status.
*
* @param trackingId - The unique identifier for tracking the transaction.
* @returns An Observable that resolves to the transaction status response (ITransactionStatusResponse).
* @publicApi
*/
getTransactionStatus(trackingId: string): Observable<ITransactionStatusResponse>;
/**
* Submits an recurring order request to Pesapal for processing and handling payment transactions.
* The method sends a POST request to the Pesapal API endpoint responsible for recurring order submissions.
* Upon successful submission, the response data is stored in an Observable for further processing.
*
* @param data - A partial or complete object conforming to the IRecurringPaymentsRequest interface
* @returns An Observable that resolves to the response of the order submission as IRecurringPaymentsResponse
* @publicApi
*/
submitRecurringPayment(data: Partial<IRecurringPaymentsRequest> | IRecurringPaymentsRequest): Observable<IRecurringPaymentsResponse>;
/**
* Submits a payment refund.
* Upon successful submission, the response data is stored in an Observable for further processing.
*
* @param data - A partial or complete object conforming to the IRefundRequest interface
* @returns An Observable that resolves to the response of the order submission as IRefundResponse
* @publicApi
*/
requestRefund(data: IRefundRequest): Observable<IRefundResponse>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiService>;
}