OptionalallowedOptionalauthorizeCalled before every action except the health check. Return false (or throw) to reject the request with 403. Required when privileged actions are enabled.
Provider callbacks (callback, payment/complete-3ds) are signed by the
provider and are called by the bank/customer browser, so the hook usually
lets them through: if (CALLBACK_HANDLER_ACTIONS.includes(ctx.action)) return true.
OptionalbasePath prefix the handler is mounted on. Default: '/api/pay'
OptionalcallbackFor browser callbacks (3D Secure return), return a URL to redirect the customer to (303). When undefined, the result is returned as JSON.
OptionalexposeInclude error messages of unexpected exceptions in 500 responses. Default: false
OptionalexposeInclude the provider's rawResponse in responses. It can hold merchant data
(commission rates, fraud status) and stored-card keys, so it is left out by
default. Your hooks (onCallback, events) always receive it. Default: false
OptionalidempotencyDeduplication of provider callbacks and Idempotency-Key requests.
On by default with an in-memory store; pass a shared store (Redis, DB)
when running several instances, or false to turn it off.
OptionalonCalled with the verified result of a provider callback. Update your order here. Errors thrown here make the handler return 500 (PayTR will then retry the notification).
OptionaltransformReturns the body passed to the provider. Use it to set amounts, basket and buyer on the server instead of trusting the client, e.g. look up the order by id and build the payment request from your database.
Actions exposed over HTTP. Default: DEFAULT_HANDLER_ACTIONS. Use 'all' to expose everything (requires
authorize).