Mobile Web-mode Product Integration
#The Mobile Web SDK
We provide a mobile Web SDK, which could be used in both iOS browser and android browser.
- Minimum OS version supported: Android 5+, iOS 11+.
- Permissions required: network and camera.
- Browser supported: iOS: Safari, Android: recommended: chrome60+, firefox58+. For other browser in android, the behavior will be variable due to the different device.
All h5-mode products involve 4 anticipants:
- The merchant's server
- The merchant's h5 page
- ZOLOZ SaaS service
- ZOLOZ mobile Web SDK
The customer must fully understand the whole interaction sequence before any integration attempt.
- Start business. A user starts the process (e.g. eKYC process) in mobile h5.
- Initialize transaction. The mobile H5 sends initialization request to the merchant server.
- Initialize transaction. The merchant server calls ZOLOZ SaaS service to initialize the transaction of the product (such as RealId).
- Return initialize result and client config. ZOLOZ SaaS service completes transaction initialization and returns result as well as corresponding client configuration prepared for ZOLOZ Web SDK to the merchant server.
- Return initialize result and client config. The merchant server returns the initialization result and client configuration to mobile h5.
- Invoke with client config. The mobile h5 open ZOLOZ Web SDK url with client configuration.
- Capture user data and upload. ZOLOZ Web SDK starts to interact with the end-user, capture required data and then upload. There might be multiple rounds of interaction between ZOLOZ Web SDK and ZOLOZ server.
- Process complete. The process is completed and ZOLOZ server returns the process status to ZOLOZ Web SDK.
- Inform completion with status. ZOLOZ Web SDK informs the completion of the process to the mobile h5.
- Inform completion. The mobile h5 informs the merchant server about the process completion.
- Check transaction details. The merchant server asks ZOLOZ SaaS service for transaction details.
- Return transaction details. ZOLOZ server returns details to the merchant server.
- Confirmed. The information from the mobile h5 is confirmed by the merchant server.
- Inform completion. The mobile h5 tells user that the process is completed.
The merchant's server need to provide proper endpoint for the merchant application to create a transaction, as well as fetch the final result of transaction. The request from the merchant application could be simply forwarded to ZOLOZ SaaS APIs.
Similar with integrating APIs of server-mode products, ZOLOL API SDK helps a lot by easing the gateway protocol implementation. In this document we only demonstrate how to integrate with ZOLOZ API SDK.
#1. Introduce API SDK
Introduce the library into your project by adding following dependency in the POM file of your project
#2. Instantiate and Configure API SDK Client
#3. Expose Endpoint for Client Application
Refer to RealId API specification for more information.
#1. Invoke ZOLOZ Web SDK
When mobile h5 get the clientcfg from server side, mobile h5 could invoke ZOLOZ Web SDK as followed:
- baseurl is the ZOLOZ Web SDK url:
- ZOLOZ server will return clientcfg to merchant server;
- Callback url, face guide url and other parameters could be configed in merchant init, please refer to RealId API specification for more information.
#2. ZOLOZ Callback
When ZOLOZ Web SDK finished, callbackurl will be invoked with a response as followed:
- callbackurl will be completeCallbackUrl if ZOLOZ Web SDK is completed, it will be interruptCallbackUrl if ZOLOZ Web SDK is interrupted. completeCallbackUrl and interruptCallbackUrl are parsed from clientcfg and they could be configed in merchant init, please refer to RealId API specification for more information.
#3. Customize face guide url
A default face guide url is provided, if want to change the ui or add more language, the face guide url could be customized.
ZOLOZ Web SDK will open the face guide url in fullscreen iframe:
- iframeSrc will be the face guide url, which is parsed from clientcfg and it could be configed in merchant init, please refer to RealId API specification for more information.
Please post a message when click next to process the workflow:
Check open-sourced examples in our Github repository: