API Reference

Public exports from @firma/pay. For checkout integration, start with PayWithFirma.

Components

  • PayWithFirma — checkout widget (props)

Hooks

  • usePaymentWatcher — Chronik WebSocket payment watching for custom UIs

Types

  • PayWithFirmaProps
  • FirmaPayCurrency"USD", "CHF", or "EUR"
  • PaymentPhase, UsePaymentWatcherParams, UsePaymentWatcherResult

Validation helpers

  • getOrderIdUtf8ByteLength(orderId)
  • isValidOrderId(orderId)
  • validateOrderId(orderId)
  • FPAY_ORDER_ID_BYTES_MAX — max UTF-8 bytes for orderId (100)
  • isEcashAddressReceiver(receiver)
  • getInvalidEcashAddressError(receiver)

Advanced utilities

For custom checkout flows or server-side payment verification:

  • encodeFpayEmpp, encodeFpayEmppRaw, decodeFpayEmpp, decodeFpayEmppFromPush, decodeFpayEmppRaw
  • buildFirmaPayQrPayload
  • isMatchingFirmaPayment

Stylesheet

Import @firma/pay/firma-pay.css once in your app. See Installation.