/** * @module Resources/WebHooks */ import { AuthParams, SendData } from "../api/RestAPI.js"; import { WithStoreMerchantName } from "./common/types.js"; import { CRUDAOSItemsResponse, CRUDPaginationParams, CRUDResource } from "./CRUDResource.js"; export declare enum WebHookTrigger { TOKEN_CREATED = "token_created", CHARGE_FINISHED = "charge_finished", CHARGE_UPDATED = "charge_updated", SUBSCRIPTION_CREATED = "subscription_created", SUBSCRIPTION_PAYMENT = "subscription_payment", SUBSCRIPTION_FAILURE = "subscription_failure", SUBSCRIPTION_CANCELED = "subscription_canceled", SUBSCRIPTION_COMPLETED = "subscription_completed", SUBSCRIPTION_SUSPENDED = "subscription_suspended", REFUND_FINISHED = "refund_finished", CANCEL_FINISHED = "cancel_finished", RECURRING_TOKEN_DELETED = "recurring_token_deleted", CUSTOMS_DECLARATION_FINISHED = "customs_declaration_finished", TOKEN_REPLACED = "token_replaced",// Also use the token renew TOKEN_UPDATED = "token_updated", TOKEN_CVV_AUTH_UPDATED = "token_cvv_auth_updated", TOKEN_CVV_AUTH_CHECK_UPDATED = "token_cvv_auth_check_updated", TOKEN_THREE_DS_UPDATED = "token_three_ds_updated", TRANSFER_CREATED = "transfer_created", TRANSFER_UPDATED = "transfer_updated", TRANSFER_FINALIZED = "transfer_finalized", BANK_TRANSFER_STATUS_UPDATED = "bank_transfer_status_updated" } export type WebHooksListParams = CRUDPaginationParams & { /** * Filters by the data main ID - charge_id, transaction_token_id, refund_id etc. */ referenceId?: string; emailAddress?: string; createdOn?: { from: string; to: string; }; }; export interface WebHookCreateParams { triggers: Trigger[]; url: string; authToken?: string; } export interface WebHookUpdateParams { triggers?: Trigger[]; url?: string; authToken?: string; } export interface WebHookItem { id: string; merchantId: string; storeId: string; triggers: Trigger[]; url: string; authToken?: string; createdOn: string; } export type WebHookListItem = WithStoreMerchantName>; export type ResponseWebHook = WebHookItem; export type ResponseWebHooks = CRUDAOSItemsResponse>; export declare class WebHooks extends CRUDResource { static requiredParams: string[]; static routeBase: string; private _list?; list(data?: SendData, auth?: AuthParams, storeId?: string): Promise>; private _create?; create(data: SendData>, auth?: AuthParams, storeId?: string): Promise>; private _get?; get(id: string | null, data?: SendData | null, auth?: AuthParams, storeId?: string | null): Promise>; private _update?; update(id: string | null, data?: SendData | null, auth?: AuthParams, storeId?: string | null): Promise>; private _delete?; delete(id: string | null, data?: SendData | null, auth?: AuthParams, storeId?: string | null): Promise; }