Card.io is an open-source product that uses the smartphone’s camera to scan a credit card’s number and expiry date. It's been used by companies like PayPal and Uber. We have also integrated Card.io into our Payment SDK to make it even more convenient for users to input credit card details into the existing form.
If your Android compile Sdk Version is lower than Android 6.0 (API 23), you still need to add some permissions in your app’s AndroidManifest.xml to enable the camera access for card scanning:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
You can customise card.io in both registration UI and payment UI in GuiSetting Property; whether you want to enable the Card.io feature (it is enabled by default), and the colour of the guild overlay on the camera (it is purple by default).
CardRegistrationFormGuiSetting registrationFormGuiSetting = new CardRegistrationFormGuiSetting();
registrationFormGuiSetting.CardIOEnable=true; registrationFormGuiSetting.CardIOColorText="#FF0000";
registrationForm.setFormGuiSetting(registrationFormGuiSetting);
SubmitPaymentCardFormGuiSetting submitPaymentCardFormGuiSetting=new SubmitPaymentCardFormGuiSetting();
submitPaymentCardFormGuiSetting.CardIOEnable=true; submitPaymentCardFormGuiSetting.CardIOColorText ="#FF0000";
transactionCardForm.setFormGuiSetting(submitPaymentCardFormGuiSetting);