We recommend using Capture Flow with Fragments instead of activities.
In order to launch Gini Capture SDK, follow these steps:
...
Note |
---|
Provide values for all necessary fields, including those that were not extracted. Provide the final data approved by the user (and not the initially extracted only). Do cleanup Send transfer summary only after TAN verification.
|
...
The diagram shows the interaction between your app and the SDK:
Drawio |
---|
mVer | 2 |
---|
simple | 0 |
---|
zoom | 1 |
---|
simple | 0 |
---|
inComment | 0 | custContentId | 12124413 |
---|
pageId | 2982265 |
---|
lboxcustContentId | 112124413 |
---|
diagramDisplayName | Untitled Diagram-1683895745279.drawio |
---|
lbox | 1 |
---|
contentVer | 25 |
---|
revision | 25 |
---|
baseUrl | https://gini.atlassian.net/wiki |
---|
diagramName | Untitled Diagram-1683895745279.drawio |
---|
pCenter | 0 |
---|
width | 860 |
---|
links | |
---|
tbstyle | |
---|
height | 379.5 |
---|
|
...
Learn how to launch Gini Capture SDK and handle the results from the example:
Code Block |
---|
|
void startGiniCaptureSDK() {
// Make sure camera permission has been already granted at this point.
// Instantiate the networking implementations.
GiniCaptureNetworkService networkService = ...
// Configure GiniCapture and create a new singleton instance.
GiniCapture.newInstance()
.setGiniCaptureNetworkService(networkService)
...
.build();
// Launch the CameraActivity and wait for the result.
Intent intent = new Intent(this, CameraActivity.class);
startActivityForResult(intent, GINI_CAPTURE_REQUEST);
}
@Override
protected void onActivityResult(final int requestCode, final int resultCode,
final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GINI_CAPTURE_REQUEST) {
switch (resultCode) {
case Activity.RESULT_CANCELED:
GiniCapture.cleanup(this);
break;
case Activity.RESULT_OK:
// Retrieve the extractions
Bundle extractionsBundle = data.getBundleExtra(
CameraActivity.EXTRA_OUT_EXTRACTIONS);
// Retrieve the extractions from the extractionsBundle
Map<String, GiniCaptureSpecificExtraction> extractions = new HashMap<>();
for (String extractionLabel : extractionsBundle.keySet()) {
GiniCaptureSpecificExtraction extraction = extractionsBundle.getParcelable(extractionLabel);
extractions.put(extractionLabel, extraction);
}
showExtractions(extractions);
break;
case CameraActivity.RESULT_ERROR:
// Something went wrong, retrieve and handle the error
final GiniCaptureError error = data.getParcelableExtra(
CameraActivity.EXTRA_OUT_ERROR);
if (error != null) {
handleError(error);
}
GiniCapture.cleanup(this);
break;
case CameraActivity.RESULT_ENTER_MANUALLY:
handleEnterManually();
GiniCapture.cleanup(this);
break;
}
}
}
void stopGiniCaptureSDK(stopGiniCaptureSDKWithTransferSummary(String paymentRecipient,
String paymentReference,
String paymentPurpose,
String iban,
String bic,
Amount amount
) {
// After the user has seen and potentially corrected the extractions, send the final
// transfer summary values to Gini which will be used to improve the future extraction accuracy:
GiniCapture.sendTransferSummary(
paymentRecipient,
paymentReference,
paymentPurpose,
iban,
bic,
amount
)
// cleanup the capture SDK after sending the transfer summary
GiniCapture.cleanup(this)
} |