Our checkout UI supports camera-based card number recognition.
Our checkout UI supports two methods of card scanning: NFC and camera. NFC is a primary way to scan the card details. If device doesn't have NFC module, the Card.IO library can be used instead to scan the card using camera.
The card scanning feature is enabled by default. You can disable it in the CheckoutSettings if needed.
By default card scan is shown in ready-to-use UI. Since version 5.2.0, you can enable or disable this option by setting boolean property cardScanButtonAvailable of OPPCheckoutSettings class.
let checkoutSettings = OPPCheckoutSettings()
checkoutSettings.cardScanButtonAvailable = false
checkoutSettings.setCardScanningEnabled(false);
checkoutSettings.isCardScanningEnabled = false
NFC
Card number and expiration date can be read from the contactless card using NFC.
Tap the contactless card icon in the card number field.
Follow the instructions on the screen to scan the card.
NOTE: The NFC card scanner might not be able to read the data from card. In this case shopper always can enter card details on the form manually.
iOS
Card.IO
Card number and expiration date can be scanned with your phone camera, saving you from having to key in your digits manually.
Tap the camera icon in the card number field to scan the card.
For the first time the app will request access to the camera.
Then position your card and it will scan card number and expiration date.
You will still need to manually enter card holder and CVV code.
Integration
Follow the steps below:
If you upgrading from previous version of mSDK make sure to removeOPPWAMobile-CardIO.xcframework from Frameworks folder.
Provide usage descriptions in your app's Info.plist
NSCameraUsageDescription - set the value to be a string describing why your app needs to use the camera (e.g. "To scan credit cards."). This string will be displayed when the app initially requests permission to access the camera.
NSPhotoLibraryUsageDescription - Card.IO never asks for this key actually, however it's needed when uploading to App Store. Set any non-empty string, e.g. duplicate NSCameraUsageDescription description.
To enable this feature add the following dependency to your build.gradle: