ForageTerminalSDK

class ForageTerminalSDK : ForageSDKInterface

The entry point for in-store POS Terminal transactions.

A ForageTerminalSDK instance interacts with the Forage API.

You need to call ForageTerminalSDK.init to initialize the SDK. Then you can perform operations like:

// Example: Initialize the Forage Terminal SDK
val forageTerminalSdk = ForageTerminalSDK.init(
context = androidContext,
posTerminalId = "<id-that-uniquely-identifies-the-pos-terminal>",
posForageConfig = PosForageConfig(
merchantId = "mid/123ab45c67",
sessionToken = "sandbox_ey123..."
)
)

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun capturePayment(params: CapturePaymentParams): ForageApiResponse<String>

Immediately captures a payment via a ForagePINEditText Element.

Link copied to clipboard
open suspend override fun checkBalance(params: CheckBalanceParams): ForageApiResponse<String>

Checks the balance of a previously created PaymentMethod via a ForagePINEditText Element.

Link copied to clipboard

Submits a card PIN via a ForagePINEditText Element and defers payment capture to the server.

Link copied to clipboard

Collects a card PIN for an EBT payment and defers the refund of the payment to the server.

Link copied to clipboard

Refunds a Payment via a ForagePinEditText Element. This method is only available for POS Terminal transactions. You must use ForageTerminalSDK.

Link copied to clipboard

Tokenizes a card via a magnetic swipe from a physical POS Terminal.

suspend fun tokenizeCard(foragePanEditText: ForagePANEditText, reusable: Boolean = true): ForageApiResponse<String>

Tokenizes a card via a ForagePANEdit Text Element.

Link copied to clipboard
open suspend override fun tokenizeEBTCard(params: TokenizeEBTCardParams): ForageApiResponse<String>

Use one of the tokenizeCard options instead.