Defining supported payment methods

Implement the getAllowedCardNetworks method as shown below in order to specify the card types accepted for payments.

Excerpt from the code sample:

private const val SUPPORTED_NETWORKS = "AMEX, VISA, MASTERCARD, DISCOVER, JCB"  
this.supportedNetworks = supportedNetworks.split(Regex(",[ ]*")).toTypedArray()  

private fun getAllowedCardNetworks(): JSONArray {
    val allowedCardNetworks = JSONArray()
    for (network in supportedNetworks) {
        allowedCardNetworks.put(network)
    }
    return allowedCardNetworks
}

Implement the getAllowedCardAuthMethods method and assign the PAN_ONLY value to it.

Excerpt from the code sample:

private val SUPPORTED_METHODS = Arrays.asList("PAN_ONLY")!! 

private fun getAllowedCardAuthMethods(): JSONArray {
    val allowedCardAuthMethods = JSONArray()
    for (method in SUPPORTED_METHODS) {
        allowedCardAuthMethods.put(method)
    }
    return allowedCardAuthMethods
}

For more information, see the documentation of the CardParameters object.