Learn how to receive bank transfer payments from your customers
The aim of this document is to assist you in initiating bank transfer payment from your custom application running on the Nomba Android terminal. If you encounter any difficulties with this process, feel free to reach out for support.
Trigger bank transfer payments - available since NombaX Application v1.6.2
This following code snippet serves as a foundation for triggering bank transfer payment events on the Nomba terminal. Adjustments to the amount, transaction reference, and other parameters can be easily made based on specific application requirements.
Copy
const val PAY_BY_TRANSFER_INTENT = "com.nomba.pro.feature.pay_by_transfer.ACTION_VIEW"const val AMOUNT_DATA = "amount"const val TXN_RESULT = "txnResultData"const val RECEIPT_OPTIONS = "receiptOptions"val resultString = mutableStateOf("")//setup a launcher that would help launch the intentvar payByTransferLauncher =registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> val data: Intent? = result.data if (result.resultCode == Activity.RESULT_OK) { resultString.value = data?.getStringExtra(TXN_RESULT) ?: "null" }}//setup an intent to be triggeredval intent = Intent(PAY_BY_TRANSFER_INTENT)//put the amount to be chargedintent.putExtra(AMOUNT_DATA, "300")//handle receipt mediumval receiptOptionsMap = hashMapOf( "print" to true, "sms" to false, "email" to false)val receiptOptionsString = Json.encodeToString(serializer<HashMap<String, Boolean>>(), receiptOptionsMap)intent.putExtra(RECEIPT_OPTIONS, receiptOptionsString)//launch the intentpayByTransferLauncher.launch(intent)
Please note that the following details will make reference to the kotlin code snippet