Closed fedarenchyk closed 3 years ago
I am having the same issue. CardNumber scanning is working great, also with some modifications the date as well, but Name is not reading. Also, I have some strange linking error on iOS which I cannot resolve.
@JavatarSRB Mind sharing what modifications you made to be able to scan the expiry date? It would be much appreciated.
@JavatarSRB Mind sharing what modifications you made to be able to scan the expiry date? It would be much appreciated.
Pretty much what I was getting was, sometimes it has been scanning the single digit date, and it was not the case with all the cards.
this.setState( { number: cardNumber || '', name: cardholderName || '', expires: expiryYear && expiryYear ?
${expiryMonth}/${expiryYear}: '', cvc: cvv || '' } );
This is what I've wrote and worked for me.
@JavatarSRB Hey, thanks very much for your response!
I have a few questions, if that's not a problem. Did you have to take any extra steps for the camera to start scanning the expiry date? You mentioned that it was sometimes scanning the single digit date, but in my case, it never scans the date at all, and I've tried multiple times. I wonder which external factors might contribute to this like lighting, for instance.
And I'm passing the scanExpiry property set to true as the scanCard configs, just to make it clear. For reference, this is the config object I'm passing to the scanCard method:
const scanConfigs = { scanExpiry: true, requireCardholderName: true, usePaypalActionbarIcon: false, hideCardIOLogo: true, }
@fempyrean No problems!
I did not have to take any additional steps, it has been scanning the expiry date from the start, just not in the correct for and not always correctly. I have mostly tested it inside of the emulator, and after figuring out it does not work on iOS i have commented here and put it aside. I was passing these:
hideCardIOLogo: true, suppressManualEntry: true, suppressConfirmation: true, requireCardholderName: true
Can you try with the last version of the library? If it doesn't fix the problem, feel free to reopen the issue with a reproduction, I'll investigate!
private scanCard = () => { CardIOModule .scanCard({ languageOrLocale: 'en', scanInstructions: I18n.t('page.registration.card.scanInstructions'), guideColor: Platform.select({ ios: processColor(this.props.theme.dashboardOverviewShadowColor), // @ts-ignore android: this.props.theme.screenBackgroundColor, }), hideCardIOLogo: true, suppressManualEntry: true, suppressConfirmation: true, requireExpiry: true, requireCardholderName: true, scanExpiry: true, scannedImageDuration: 0, }) .then((card: CreditCard) => { console.log(card); this.props.onCardScanned(card); }) .catch(() => { Logger.info('the user canceled scanning'); }); }; }
requireExpiry, requireCardholderName, scanExpiry methods aren't working. But scanning card number working's fine