Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPress={() => {
if (this.props.onScanCardOpen) {
this.props.onScanCardOpen()
}
if (Platform.OS === 'android') {
CardIOModule.scanCard({
// guideColor: this.props.scanCardGuideColor, // This isn't working at the moment.
hideCardIOLogo: true,
suppressManualEntry: true,
suppressConfirmation: true,
})
.then(card => this.didScanCard(card))
.catch(() => {
let refToFocus
if (!calculatedState.cardNumber) {
refToFocus = this.refs.cardNumberInput
} else if (!calculatedState.expiry) {
refToFocus = this.refs.expiryInput
} else {
refToFocus = this.refs.cvcInput
}
// Make sure keyboard stays open on android.
componentWillMount() {
if (CardIOUtilities.preload) {
CardIOUtilities.preload()
}
}