Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Success callback never called #84

Closed
globules-io opened this issue Feb 20, 2018 · 5 comments
Closed

Success callback never called #84

globules-io opened this issue Feb 20, 2018 · 5 comments

Comments

@globules-io
Copy link

globules-io commented Feb 20, 2018

General information

  • SDK/Library version: 2.1.0
  • Platforms: Android
  • Device OS Version and Device: Android 6

Issue description

                   CardIO.scan({
		  "requireExpiry":true,
		  "requireCVV":false,
		  "requirePostalCode":false,
		  "hideCardIOLogo":true,
		  "keepApplicationTheme":true,
		  "allowFreelyRotatingCardGuide":false,
		  "suppressConfirmation":true
		},
		cardScanComplete,
		cardScanCancel);

upon successfull scan, cardScanCancel is called instead of cardScanComplete.
cardScanComplete is never called. Why would my scan always be canceled when it seems to do a successful scan??

@globules-io globules-io changed the title Wrong callback Success callback never called Mar 3, 2018
@ghost
Copy link

ghost commented Mar 23, 2018

This seems to be happening when you have suppressConfirmation set to true.

@ghost
Copy link

ghost commented Apr 9, 2018

if (resultCode == CardIOActivity.RESULT_CARD_INFO) {
CreditCard scanResult = null;
if (intent.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
scanResult = intent
.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);
this.callbackContext.success(this.toJSONObject(scanResult));
} else {
this.callbackContext
.error("card was scanned but no result");
}
} else if (resultCode == Activity.RESULT_CANCELED) {
this.callbackContext.error("card scan cancelled");
} else {
this.callbackContext.error(resultCode);
}

In this case, when you have suppressConfirmation set to true, control goes to the else block and your error callback is called.

@globules-io
Copy link
Author

So I've checked and it appears to work with suppressConfirmation set to false but we really need no confirmation :(

@ghost
Copy link

ghost commented Apr 13, 2018

Implement the plugin locally.

And add this instead

if (resultCode == CardIOActivity.RESULT_CARD_INFO || resultCode == CardIOActivity.RESULT_CONFIRMATION_SUPPRESSED)

Should work with suppressConfirmation set to true.

@ghost
Copy link

ghost commented Apr 13, 2018

Look at this PR

#80

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant