import CardVerify from 'react-native-cardverify';
CardVerify.scan(bin, last4)
.then(({action, scanId, payload, canceledReason}) => {
if (action === 'scanned') {
// Display information, use the verificationPayload to check card validity
} else if (action === 'canceled') {
if (canceledReason === 'user_missing_card') {
// user tapped the "I don't have this card" button
if (canceledReason === 'user_canceled') {
if (canceledReason === 'camera_error') {
// an error occurred with the camera during scan
if (canceledReason === 'fatal_error') {
// an error occurred while processing scan results
if (canceledReason === 'unknown') {
// the scan was canceled for an unknown reason
} else if (action === 'skipped') {
} else if (action === 'unknown') {
// Unknown reason for scan canceled