Operations
The SDK supports five operations through the SoftPOS app. Each operation uses a builder pattern: configure the request with setter methods, then call .send() to execute it. You must set setBtc on every flow (see API Reference). setPrintReceipt and setDisplayInvoice are optional and default to false. For card sale and refund, pass amount as a string matching your signature request (see Card Sale).
| Operation | Builder | Description |
|---|---|---|
| Card Sale | requestSale() |
Accept a card payment |
| Card Refund | requestRefund() |
Refund a previous transaction |
| Card Void | requestVoid() |
Void/cancel a recent transaction |
| Inquiry | requestInquiry() |
Query transaction status |
| Clear Cache | requestClearCache() |
Clear app cache and keys |
All operations require a server-generated signature and follow the same lifecycle:
- Generate a session ID with
FawrySDK.generateSessionId() - Request a signature from your backend
- Build the request using the appropriate builder
- Call
.send()– the SDK redirects to the SoftPOS app - The SoftPOS app processes the request and redirects back
- The SDK resolves the Promise with the result