官方证件自动采集
身份证的自动采集同样适用于泰国驾驶执照、银行存折(book bank)和带签名的身份证副本,并把每种证件提交给对应的 OCR API,每页 1.25 IC。
调用
- Flutter
- Web
- iOS
- Android
- React Native
import 'package:iapp_ekyc_sdk/iapp_ekyc_sdk.dart';
final client = IappEkycClient(apiKey: 'YOUR_API_KEY');
// 泰国驾驶执照
final license = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiDriverLicense,
locale: EkycLocale.th,
);
// 银行存折
final bookBank = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.bookBank,
);
import { IappEkyc } from '@iapp-technology/ekyc-sdk';
const ekyc = new IappEkyc({ apiKey: 'YOUR_API_KEY' });
const license = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiDriverLicense',
locale: 'th',
});
const idCopy = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiIdWithSignature',
});
// iOS (Swift; Objective-C 也支持)
let config = IappEkycConfig(apiKey: "YOUR_API_KEY", flow: .documentCapture)
config.documentType = .thaiDriverLicense
IappEkycSdk.present(from: self, config: config) { result in /* result.document?.rawJSON */ }
// Android (Kotlin; Java 也支持)
ekyc.launch(IappEkycRequest.DocumentCapture(config, EkycDocumentType.THAI_DRIVER_LICENSE))
// React Native
<IappEkycFlow flow="documentCapture" documentType="thaiDriverLicense" apiKey="YOUR_API_KEY"
onResult={handleResult} onError={handleError} onCancel={close} />
安装:Flutter 与 Web 见入门指南,原生封装与相机权限见 iOS, Android & React Native。
选项
documentType 决定证件类型及其提交的 API:
| 证件 | Flutter | Web | API |
|---|---|---|---|
| 驾驶执照 | DocumentType.thaiDriverLicense | 'thaiDriverLicense' | 泰国驾驶执照 OCR |
| 银行存折 | DocumentType.bookBank | 'bookBank' | 银行存折 OCR |