I have just integrated the card.io SDK with my app, I just wanted to save scanned credit card image to show them later in my app, just like other wallet apps do. Is there any way?
-
Did you find a way to save the scanned image? If so please share the answershamila– shamila2017年03月03日 07:31:19 +00:00Commented Mar 3, 2017 at 7:31
2 Answers 2
Josh from card.io here. card.io is open source, so you could dig around and figure out how to get the image out.
However, it is hidden by default for good reasons. One is user privacy. Another is PCI compliance--the CVV2 is located on the front of AmEx cards and storing the CVV2 (anywhere, secure or not) is not allowed.
7 Comments
Its not supported in the card.io code but if you really need it you can add following code in onActivityResult of CardIOActivity.java
/* added image response */
Intent origIntent = getIntent();
Log.d(TAG, "[IMGCAP] Return image on scan request");
if (origIntent.getBooleanExtra(EXTRA_RETURN_CARD_IMAGE, false)
&& mOverlay != null && mOverlay.getBitmap() != null) {
ByteArrayOutputStream scaledCardBytes = new ByteArrayOutputStream();
Log.d(TAG, "[IMGCAP] Attempting return of image");
mOverlay.getBitmap().compress(Bitmap.CompressFormat.JPEG, 80, scaledCardBytes);
data.putExtra(EXTRA_CAPTURED_CARD_IMAGE, scaledCardBytes.toByteArray());
}
Log.d(TAG, "[IMGCAP] Set result with return image");
/************************************/
setResultAndFinish(resultCode, data);
Just before you see call to send back result of activity. You can receive in in the calling activity. But as mentioned in above answers its not recommended to capture card image. For non financial card you can call only detect and suppress scan, you will get image for that if you enable EXTRA_RETURN_CARD_IMAGE.