Developer Docs

Developer Docs

  • Overview
  • SDK
  • SoftPOS API
  • APOLLO API
  • Release Note
  • Languages iconEnglish
    • 繁體中文

›SoftPOS API

SoftPOS API

  • API preview
  • Transaction request
  • Enquiry Request
  • Data models

Enquiry Request

For enquiry request, your app just need to pass the below data in the intent extra

  • API_KEY & API_TOKEN - for the credential of the payment
  • ECR_TRANSACTION_REQUEST - the transaction details, including the amount, preferred payment instrument
  • (Optional) ENFORCE_FETCH_CONFIG - to force the SoftPOS app to fetch the latest config from the backend, might incur a few seconds depending on the network condition

EnquiryRequest data

To enquiry a transaction, create the EnquiryRequest and put it in the intent extra.

data class EnquiryRequest(
    /**
     * The unique ID from the POS
     */
    val messageId: String
) : Serializable

Enquiry a transaction

enquiryRequest

val enquiryRequest = EnquiryRequest(
    //passed from the POS system during the original transaction
    messageId = "ea4e27d353055bb5762aec5e4a5f212b424022fb"
)

Then, send the intent:

Intent("com.spectratech.soepay.action.enquiry")
    .apply {
        putExtra("API_KEY", dummyCredential.apiKey)
        putExtra("API_TOKEN", dummyCredential.apiToken)
        putExtra("ECR_ENQUIRY_REQUEST", enquiryRequest)

        if (binding.switchEnforceFetch.isChecked)
            putExtra("ENFORCE_FETCH_CONFIG", true)
    }
    .also {
        try {
            paymentLauncher.launch(it)
        } catch (ex: Exception) {
            Toast.makeText(this@MainActivity, "Cannot start act", Toast.LENGTH_SHORT).show()
        }
    }

Response data

The enquiry would be the same response as transaction response:

{
  "cancelable": true,
  "cardData": {
    "aid": "A0000000041010",
    "appName": "Debit Mastercard",
    "approvalCode": "123456",
    "mid": "000000000000001",
    "tc": "85230B910BDA0B37",
    "tid": "000001",
    "tsi": "0000",
    "tvr": "0000000000"
  },
  "createById": "0396857704d731a58059e3771867085f2a4dd502",
  "createByName": "dev",
  "createTime": "2021-08-20T04:44:52+0000",
  "entryMode": "CONTACTLESS",
  "lastUpdateTime": "2021-08-20T04:44:53+0000",
  "messageId": "ea4e27d353055bb5762aec5e4a5f212b424022fb",
  "payment": {
    "adjustable": false,
    "baseAmount": 20,
    "createTime": "2021-08-20T04:44:51+0000",
    "lastUpdateTime": "2021-08-20T04:44:53+0000",
    "organize": {
      "address": "ADDR",
      "name": "Public POS Integration Test"
    },
    "payer": "••••7128",
    "paymentId": "1009bb238fee88080333d0f42615f170f66efb26",
    "paymentMethod": "MASTER",
    "paymentTrace": 42175,
    "...": "..."
  },
  "processorReference": "f663c90613912db73303877f22d9c12c",
  "requireSignature": false,
  "totalAmount": 20,
  "trace": 43473,
  "tranId": "ff6f03d59fb6ab00e94e43c7408df161fbf687e0",
  "tranStatus": "APPROVED",
  "tranType": "SALE",
  "...": "..."
}

Last updated on 8/20/2021 by Jeff Kwok
← Transaction requestData models →
  • Enquiry a transaction
    • enquiryRequest
    • Response data
Developer Docs
About
APOLLO ecosystemProducts and servicesHardware spec
Development
Development with APOLLOSDK overviewAPI overview
Support
Spectra TechnologiesContact us
Copyright © 2022 Spectra Technologies.
Site by Docusaurus