Simple Order API

Setting Up the Initial Call

Calling
cardinal session setup
begins the communication process, authenticates your credentials (server JWT), and 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, a unique value is assigned to the
consumerSessionId
API field to identify the session. This
consumerSessionId
value ensures that the correct device data collection results is matched to each user request.
Barclays
uses its
payerAuthEnrollService_referenceID
field to contain Cardinal's
consumerSessionId
value. 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 these code examples to understand how to complete the
cardinal session setup
. The function call must be placed in your Checkout ViewController.
Cardinal session setup (iOS SDK - Objective-C)
NSString *accountNumberString = @"1234567890123456"; NSString *jwtString = @"INSERT_YOUR_JWT_HERE"; [session setupWithJWT:jwtString didComplete:^(NSString * _Nonnull consumerSessionId){ // // You may have your Submit button disabled on page load. Once you are // setup for CCA, you may then enable it. This will prevent users // from submitting their order before CCA is ready. // } didValidate:^(CardinalResponse * _Nonnull validateResponse) { // Handle failed setup // If there was an error with setup, cardinal will call this // function with validate response and empty serverJWT }];
Cardinal session setup (iOS SDK - Swift)
let accountNumberString = "1234567890123456" let jwtString = "INSERT_YOUR_JWT_HERE" session.setup(jwtString: jwtString, completed: { (consumerSessionId: String) in // // You may have your Submit button disabled on page load. Once you // are setup for CCA, you may then enable it. This will prevent // users from submitting their order before CCA is ready. // }) { (validateResponse: CardinalResponse) in // Handle failed setup // If there was an error with setup, cardinal will call this // function with validate response and empty serverJWT }