Custom Card Read {#pax-aio-payment-txn-custom-card-read-intro}
==============================================================

The Custom Card Read feature enables you to obtain data from custom cards such as gift cards, loyalty program cards, and employee cards. This feature cannot be used to perform payment functions.
Custom Card Read is supported for non-PCI cards only. To use this feature, the card type must be on your allowlist. To add a card type to your allowlist, contact your implementation manager.  
To retrieve the card data, swipe the card's magnetic stripe through the payment device. The custom card read-only function reads and returns the raw card identifier to your app or point-of-sale (POS) system. You can then use the raw data within your app or POS system.  
These are examples of how you might use the Custom Card Read feature:

* **Custom gift card:** Use the card number to check a balance or process a payment in your private gift card network.
* **Employee card:** Use the card number to look up an employee's profile or account.
  {#pax-aio-payment-txn-custom-card-read-intro_ul_snq_dyx_xgc}

Process a Custom Card Read {#pax-aio-pymnt-txn-custom-card-read-task}
=====================================================================

Follow these steps to process a custom card read.

1. Retrieve the `ReadCardIntent` value from the `mposUi` object and use the `startActivity` method to initiate the card read flow.

   ```
   val ReadCardIntent = mposUi.createReadCardIntent()
   startActivityForResult(ReadCardIntent, MposUi.REQUEST_CODE_READ_CARD)
   ```
2. After the card read activity is complete, the `onActivityResult` method is triggered. This action returns information about the status of the card read activity and the card details.

   ```
   override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) 
   {
       super.onActivityResult(requestCode, resultCode, data)
       if (requestCode == MposUi.REQUEST_CODE_READ_CARD) {
           when (resultCode) {
               // Result code from a successful card read
               MposUi.RESULT_CODE_READ_CARD_SUCCESS -&gt; {
                  val cardDetailsObject = (mposUi.lastExecution as ExecutionProcess.ReadCardExecutionProcess.Completed).cardDetails
                  Toast.makeText(findViewById(android.R.id.content), "Card read successful", Toast.LENGTH_LONG).show()
               }
               // Result code from a failed card read
               MposUi.RESULT_CODE_READ_CARD_FAILED -&gt; {
                  Toast.makeText(findViewById(android.R.id.content), "Card read failed", Toast.LENGTH_LONG).show()
               }
           }
       }
   }
   ```

