CardIO

Improve this doc

$ ionic plugin add card.io.cordova.mobilesdk

Repo: https://github.com/card-io/card.io-Cordova-Plugin

Supported platforms

Usage

import { CardIO } from 'ionic-native';


CardIO.canScan()
  .then(
    (res: boolean) => {
      if(res){
        let options = {
          requireExpiry: true,
          requireCCV: false,
          requirePostalCode: false
        };
        CardIO.scan(options);
      }
    }
  );

Static Members

canScan()

Check whether card scanning is currently available. (May vary by device, OS version, network connectivity, etc.)

Returns: Promise<boolean>

scan(options)

Scan a credit card with card.io.

Param Type Details
options CardIOOptions

Options for configuring the plugin

Returns: Promise<any>

version()

Retrieve the version of the card.io library. Useful when contacting support.

Returns: Promise<string>

CardIOOptions

Param Type Details
requireExpiry
(optional)
boolean

Set to true to require expiry date

requireCVV
(optional)
boolean

The user will be prompted for the card CVV

requirePostalCode
(optional)
boolean

The user will be prompted for the card billing postal code.

supressManual
(optional)
boolean

Removes the keyboard button from the scan screen.

restrictPostalCodeToNumericOnly
(optional)
boolean

The postal code will only collect numeric input. Set this if you know the expected country's postal code has only numeric postal codes.

keepApplicationTheme
(optional)
boolean

The theme for the card.io Activity's will be set to the theme of the application.

requireCardholderName
(optional)
boolean

The user will be prompted for the cardholder name

scanInstructions
(optional)
string

Used to display instructions to the user while they are scanning their card.

noCamera
(optional)
boolean

If set, the card will not be scanned with the camera.

scanExpiry
(optional)
boolean

If scanExpiry is true, an attempt to extract the expiry from the card image will be made.

languageOrLocale
(optional)
string

The preferred language for all strings appearing in the user interface. If not set, or if set to null, defaults to the device's current language setting.

guideColor
(optional)
string

Changes the color of the guide overlay on the camera. The color is provided in hexadecimal format (e.g. #FFFFFF)

supressConfirmation
(optional)
boolean

The user will not be prompted to confirm their card number after processing.

hideCardIOLogo
(optional)
boolean

The card.io logo will not be shown overlaid on the camera.

useCardIOLogo
(optional)
boolean

The card.io logo will be shown instead of the PayPal logo.

supressScan
(optional)
boolean

Once a card image has been captured but before it has been processed, this value will determine whether to continue processing as usual.

CardIOResponse

Param Type Details
cardType string

Card type

redactedCardNumber string

Masked card number, showing only last 4 digits

cardNumber string

Full card number

expiryMonth number

Expiry month

expiryYear number

Expiry year

cvv string

CVV

postalCode string

Postal code

cardholderName string

Cardholder name

API

Native

General