import { BaseClient } from '../../common/BaseClient'; import { Env } from '../../Env'; import { CustomCheckoutPayRequest } from './models/request/CustomCheckoutPayRequest'; import { RefundRequest } from '../../common/models/request/RefundRequest'; import { CallbackResponse } from '../../common/models/response/CallbackResponse'; import { CustomCheckoutPayResponse } from './models/response/CustomCheckoutPayResponse'; import { OrderStatusResponse } from '../../common/models/response/OrderStatusResponse'; import { RefundResponse } from '../../common/models/response/RefundResponse'; import { RefundStatusResponse } from '../../common/models/response/RefundStatusResponse'; import { CreateSdkOrderRequest } from './models/request/CreateSdkOrderRequest'; import { CreateSdkOrderResponse } from './models/response/CreateSdkOrderResponse'; export declare class CustomCheckoutClient extends BaseClient { private static _client; private headers; private constructor(); /** * Generates a CustomCheckout Client for interacting with the PhonePe APIs * * @param clientId Unique clientId assigned to merchant by PhonePe * @param clientSecret Secret provided by PhonePe * @param clientVersion The client version used for secure transactions * @param env Set to `Env.SANDBOX` for the SANDBOX environment or `Env.PRODUCTION` for the production * environment. * @param shouldPublishEvents When true, events are sent to PhonePe providing smoother experience * @return CustomCheckoutClient object for interacting with the PhonePe APIs */ static getInstance: (clientId: string, clientSecret: string, clientVersion: number, env: Env, shouldPublishEvents?: boolean) => CustomCheckoutClient; /** * Initiate a Pay Order * * @param payRequest Request required to initiate the order. Depending on the instrument type, different builders can be used * @return Promise which contains the data according to the instrument used */ pay: (payRequest: CustomCheckoutPayRequest) => Promise; /** * Gets status of an order * * @param merchantOrderId Order id generated by merchant * @param details true -> order status has all attempt details under paymentDetails list * false -> order status has only latest attempt details under paymentDetails list * @return Promise which contains the details about the order */ getOrderStatus: (merchantOrderId: string, details?: boolean) => Promise; /** * Initiate a refund of an order which is in completed state * * @param refundRequest Request required to initiate the order. It is build using RefundRequest.builder() * @return Promise which contains the details about the refund */ refund: (refundRequest: RefundRequest) => Promise; /** * Gets the status of refund * * @param refundId Generated by merchant at the time of initiating the refund * @return Promise which contains the status about the refund */ getRefundStatus: (refundId: string) => Promise; /** * Gets the status of a transaction attempted * * @param transactionId Transaction attempt id generated by PhonePe * @return Promise which contains the details about that specific transactionId */ getTransactionStatus: (transactionId: string) => Promise; /** * Create order token for SDK integrated order requests * * @param sdkRequest Request object build using CreateSdkOrderRequest.builder() * @return Promise which contains token details to be consumed by the UI */ createSdkOrder: (sdkRequest: CreateSdkOrderRequest) => Promise; /** * Validate if the callback is valid * * @param username username set by the merchant on the dashboard * @param password password set by the merchant on the dashboard * @param authorization String data under `authorization` key of response headers * @param responseBody Callback response body * @return CallbackResponse Deserialized callback body * @throws PhonePeException when callback is not valid */ validateCallback: (username: string, password: string, authorization: string, responseBody: string) => CallbackResponse; prepareHeaders: () => { [x: string]: string; }; }