Starting a transaction in your iOS app

To start a transaction using Xplor Pay iOS framework:

1

Add an object that initializes the transaction.

ClearentVP3300Config *config = [[ClearentVP3300Config alloc]init];
        [config setPublicKey:publicKey];
        [config setClearentBaseUrl:baseURL];
        config.contactAutoConfiguration = false;
        config.contactlessAutoConfiguration = false;
        config.contactless = true;
        clearentVP3300 = [[Clearent_VP3300 alloc]  initWithConnectionHandling:self clearentVP3300Configuration:config];
        clearentManualEntry = [[ClearentManualEntry alloc]  init];
        [clearentManualEntry setClearentBaseUrl:baseURL];
        [clearentManualEntry setPublicKey:publicKey];
2

Add an object that represents the payment request.

ClearentPayment *clearentPayment = [[ClearentPayment alloc] init];
    [clearentPayment setAmount:theAmount];
    clearentPayment.amtOther = 0;
    clearentPayment.type = 0;
    clearentPayment.timeout = 10;
    clearentPayment.tags = nil;
    clearentPayment.fallback = true;
    clearentPayment.forceOnline = false;
3

Add an object that represents a Bluetooth connection.

ClearentConnection *clearentConnection = [[ClearentConnection alloc] initBluetoothWithFriendlyName:self.deviceFriendlyName];

The iOS framework connects to the card reader over Bluetooth and sends messages to the feedback delegate to start a transaction.

ClearentResponse *response = [clearentVP3300 startTransaction:clearentPayment clearentConnection:clearentConnection];
         if (response.responseType != RESPONSE_SUCCESS) 
         {
             //Notify user the transaction could not be started.
         }

The iOS framework secures the card data and calls the successTransactionToken delegate.

4

Use the POST method with the /rest/v2/mobile/transactions/sale endpoint to create a transaction on your app using a mobile JSON Web Token (JWT).

Visit Mobile Gateway Documentation for more information.

Last updated

Was this helpful?