Interface: PesaPlugin
Defined in: packages/pesa/src/plugins/types.ts:36
Plugin lifecycle hooks.
Plugins are plain objects passed in the plugins array of PesaConfig.
They are composed in order at createPesa() time. No class inheritance.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
afterResponse? | (ctx) => Promise<ResponseContext> | Called after each response from a payment provider. Plugins can inspect the response and set ctx.retry = true to trigger a retry (handled by the retry plugin). | packages/pesa/src/plugins/types.ts:51 |
beforeRequest? | (ctx) => Promise<RequestContext> | Called before each outgoing request to a payment provider. Plugins can modify the request context (e.g., add idempotency keys). | packages/pesa/src/plugins/types.ts:44 |
init? | (pesa) => void | Called once at startup. Receives the pesa instance for extension. | packages/pesa/src/plugins/types.ts:62 |
name | string | Unique plugin name (used for logging and debugging). | packages/pesa/src/plugins/types.ts:38 |
onPaymentEvent? | (event) => Promise<void> | Called after a verified PaymentEvent is stored in the event store. Use for side effects: sending emails, updating your database, etc. | packages/pesa/src/plugins/types.ts:57 |