Build with AI

Working with Claude, ChatGPT, Copilot, or another assistant? Copy the prompt below into your AI tool of choice to scaffold your Android POSLink integration.

Feed it the full docs
Every page on this portal has a "Copy as Markdown" button in the top right. Paste the pages the prompt references into your AI's context for the best results, or point it at the OpenAPI specs on the Downloads page.
You are helping me integrate my Android ePOS application with Teya card machines using the
Teya Unified ePOS SDK (POSLink: my ePOS and the Teya card machine are separate devices).

My stack: [describe your app language/framework, e.g. Kotlin/Jetpack Compose]

Key facts:
- Add the SDK from Maven Central: implementation("com.teya.epos:unified-sdk:<version>")
  in build.gradle(.kts), with mavenCentral() in settings.gradle(.kts) repositories.
- Requirements: take the minimum supported minSdkVersion, compileSdkVersion, Android Gradle
  Plugin, Gradle and Kotlin versions from the requirements table on
  https://docs.teya.com/epos-sdk/poslink/android/getting-started - do not guess them, and do
  not rely on versions you may remember, as they change with each SDK release.
- I need a Client ID and Client Secret from the Teya Developer Portal (partner.teya.xyz for
  development, partner.teya.com for production). This is one set for my whole application,
  not one per merchant - merchants authenticate separately with their own Teya ID.
- Initialize the SDK with:
  val teyaPosLinkSDK = TeyaPosLinkSDK(
      isProductionEnv = false,
      authConfig = PosLinkSDK.AuthConfig.Managed(clientId = "...", clientSecret = "..."),
      eposInstanceId = null, // optional identifier for this ePOS instance
      logger = LoggerImpl() // optional, implements the SDK's Logger interface
  )
- Call teyaPosLinkSDK.setup(onFailure, onSuccess) to run the SDK's built-in UI for
  authentication, store selection, and card machine selection. After setup succeeds, use
  teyaPosLinkSDK.transactionsApi and teyaPosLinkSDK.printingApi.
- To make a payment, call teyaPosLinkSDK.transactionsApi.makePayment(transactionId, amount,
  currency, tip). amount and tip are in the smallest currency unit (e.g. cents) and currency
  is an ISO 4217 code (e.g. "GBP"). This returns a PaymentStateSubscription for real-time
  status updates.
- Tips, cancellations, refunds, receipts, and Pay at Table are additional SDK calls with
  real-time responses.

Documentation to follow (read these before writing code):
- https://docs.teya.com/epos-sdk/poslink/android/getting-started
- https://docs.teya.com/epos-sdk/poslink/android/make-payment
- https://docs.teya.com/epos-sdk/overview

Task: add the SDK dependency, implement the Connect to Teya flow via setup(), and implement
a basic make-payment call with result handling. Follow the documentation exactly and do not
invent SDK methods - if unsure of an API name, tell me to check the docs page rather than
guessing.