I am trying to implement Card.io
in my app, I followed the instructions on Card.io website and when I get into my app and I launch it, it locks in on my card, but after that nothing else happens. Below is my code
AndroidManifest
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<--!..........................-->
<activity android:name="io.card.payment.CardIOActivity" android:configChanges="keyboardHidden|orientation" android:hardwareAccelerated="true"/>
<activity android:name="io.card.payment.DataEntryActivity" android:screenOrientation="portrait"/>
ActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == MY_SCAN_REQUEST_CODE) {
String cardNumbs, cardExp, cardCVV;
String resultStr;
if (data != null && data.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
//TODO
CreditCard scanResult = data.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);
cardNumbs = scanResult.getRedactedCardNumber();
acctDebitCardNo.setText(cardNumbs);
if (scanResult.isExpiryValid()) {
cardExp = scanResult.expiryMonth + "/" + "20" + scanResult.expiryYear;
acctDebitCardExp.setText(cardExp);
} else {
acctDebitCardExp.setError("Card Has Expired");
}
if (scanResult.cvv != null) {
cardCVV = scanResult.cvv;
acctDebitCardCvv.setText(cardCVV);
}
}
}
}
Permission To Launch Camera
Intent scanIntent = new Intent(getActivity(), CardIOActivity.class);
// customize these values to suit our/there needs...LOL :).
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, true);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false
// hides the manual entry button
// if set, developers should provide their own manual entry mechanism in the app
scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, false); // default: false
// matches the theme of your application
scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, true);
// MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
I don't know what I'm doing wrong