iOS Framework
The Mobile EMV SDK enables iOS apps to accept EMV chip card payments via Bluetooth or audio jack using the IDTech VP3300 card reader.
Prerequisites
To enable the Mobile EMV SDK into your iOS app, ensure you have following:
✅ API access key issued to you by Xplor Pay.
Connect iOS app
To connect your iOS app to the card reader:
Install SDK dependencies, such as
IDTech.xcframework,IDTech.bundle(v4.0.142 or later) andCocoaLumberjack.xcframework.Add the iOS Framework to your project using Carthage.
github "Clearent/iOS-framework"
carthage updateImport the iOS framework header in your code.
#import <ClearentIdtechIOSFramework/ClearentIdtechIOSFramework.h>Initialize the SDK and connect to the card reader.
ClearentConnection *connection = [[ClearentConnection alloc] initBluetoothSearch];
[clearentVP3300 startConnection:connection];The iOS Framework connects automatically to the card reader using Apple’s Bluetooth implementation through the IDTech library.
Process payment
To process the payment in your iOS app:
Configure the SDK to initiate an EMV card transaction that sends the encrypted token to Xplor Pay.
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];Set up a payment request.
ClearentPayment *payment = [[ClearentPayment alloc] init];
[payment setAmount:theAmount];
payment.amtOther = 0;
payment.type = 0; // Sale
payment.timeout = 10;
payment.tags = nil;
payment.fallback = true;
payment.forceOnline = false;Initiate a card transaction.
ClearentResponse *response = [clearentVP3300 startTransaction:payment
clearentConnection:connection];
if (response.responseType != RESPONSE_SUCCESS) {
// Notify user transaction could not be started
}The Mobile EMV SDK reads the card and encrypts the card data.
Add the callback handlers to receive the successful message from the Mobile EMV SDK.
- (void)successTransactionToken:(ClearentTransactionToken *)token {
// Send the encrypted JWT to the Mobile Payments API
// POST /rest/v2/mobile/transactions/sale
}The Mobile EMV SDK returns an encrypted JSON Web Token (JWT) that contains the transaction data.
Use the POST method to send the transaction request to the Mobile Payment Transactions endpoint to process the payment.
Last updated
Was this helpful?

