Send provisioning request

Function

int provision()

Description

Sends the provisioning data to Fiserv. Provisioning is the process of registering the phone as a payment device with Fiserv.

First, data needs to be received by Client through setProvisionData() which stores the data in client app’s preferences. By calling provision(), it is sent to Soft Point-of-Sale app. Provisioning is independent from Client payment functions. It can be performed by different apps than one handling payments. It needs to be completed before requesting payments.

This sends data set in setProvisionData() to Soft Point-of-Sale app, along with sender’s app package and sha256 of encryption key.

The intent is received by the Intent Filter and processed by client.onResponseIntent(intent).
Soft Point-of-Sale app provides injectable mechanism for implementing activation flow.

provision() immediately returns an Error code if the request couldn't be sent or any error happened.

On response from provision, following Client methods are called:

  • onProvisionResponse(String responseJson)
  • onProvisionResponse(ProvisionResponse response)

A possible error is received in onResponseError(errorCode: Int). More information on the asynchronous error codes can be found at Error codes.

Objects

ProvisionResponse

ArgumentDescriptionTypeRequired
successIf the provisioning was successful or not.BooleanRequired
errorCodeSet if an error occurred.IntOptional
externalTerminalIdAdditional terminal ID which should be stored if received.StringOptional
additionalProvisionResponseDataOptional key-value pairs for extended functionality.Map<String, String>Optional

AdditionalProvisionResponseData

ValueDescriptionType
deviceSerialNumberSerialnumber of the device.String

Example

Send Provision

  fun sendProvisionRequest() {
        client.provision().let {
            Log.d(LOG_TAG, "Provision result code: $it")
        }
    }

Receive Provision Response

Extend your client-implementation with following methods:

  class ClientImplementation(
    context: Context
) : Client(context, sha256OfSigningCertificate) {

    override fun onProvisionResponse(responseJson: String) {
        super.onProvisionResponse(responseJson)
        Log.d(LOG_TAG, responseJson)
    }

    override fun onProvisionResponse(response: ProvisionResponse) {
        super.onProvisionResponse(response)
        Log.d(LOG_TAG, response.toString())
    }
}