On This Page
Simple Order API
Setting Up the Initial Call
Calling
Cardinal.init()
:- begins the communication process with Cardinal
- authenticates your credentials (server JWT)
- completes the data collection process
By the time the customer is ready to check out, all necessary preprocessing is
complete.
Each time a user begins a mobile transaction, Cardinal assigns a unique identifier to
the session called a
consumerSessionId
. This
consumerSessionId
ensures that Cardinal matches the correct
device data collection results to a request. Barclays
calls this
session identifier, payerAuthEnrollService_referenceID
. You must
assign the value of the consumerSessionId
field to the
payerAuthEnrollService_referenceID
field so that Barclays
can also track the calls for each user session. Study the code example shown below for completing the
cardinal.init()
. Cardinal.init() (Android SDK)
cardinal = Cardinal.getInstance(); String serverJwt = "INSERT_YOUR_JWT_HERE"; cardinal.init(serverJwt , new CardinalInitService() { /** * You may have your Submit button disabled on page load. Once you are * set up for CCA, you may then enable it. This will prevent users * from submitting their order before CCA is ready. */ @Override public void onSetupCompleted(String consumerSessionId) { } /** * If there was an error with set up, Cardinal will call this function * with validate response and empty serverJWT * @param validateResponse * @param serverJwt will be an empty */ @Override public void onValidated(ValidateResponse validateResponse, String serverJwt) { } });
See Running Payer Authentication with SDK for the next steps.