Interface: RefundResult

Defined in: packages/pesa/src/types/refund.ts:19

Result returned after initiating a refund.

Not all providers support refunds. Check capability via pesa.refund !== undefined before calling.

Example

if (pesa.refund) {
  const result = await pesa.refund('order_123', 5000);
  if (result.status === 'SUCCESS') {
    console.log(`Refund ${result.refundId} processed`);
  }
}

Properties

PropertyTypeDescriptionDefined in
amountnumberAmount refunded in whole TZS.packages/pesa/src/types/refund.ts:25
message?stringOptional human-readable message from the provider.packages/pesa/src/types/refund.ts:34
orderIdstringThe original order ID being refunded.packages/pesa/src/types/refund.ts:23
raw?unknownRaw provider response.packages/pesa/src/types/refund.ts:36
refundIdstringProvider-assigned refund ID.packages/pesa/src/types/refund.ts:21
status"SUCCESS" | "FAILED" | "QUEUED"Refund status. - SUCCESS — refund processed - QUEUED — refund initiated, poll for updates - FAILED — refund failedpackages/pesa/src/types/refund.ts:32

On this page