OutSystems / cardio-cordova-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OutSystems card.io cordova plugin

⚠️ This plugin is SUPPORTED by OutSystems. Customers entitled to Support Services may obtain assistance through Support.

The purpose of this plugin is to leverage Hybrid Applications with card.io features. With this plugin, users can scan credit cards in a hybrid mobile app.

As with all the cordova plugins, the plugin isn't available until the execution of deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    // ...
}

Supported Platforms

  • iOS
  • Android

Installation

  • Run the following command:
    cordova plugin add https://github.com/OutSystems/CardIO-Cordova-Plugin

CardIOPlugin

scanCard()

Syntax:

function scanCard(successCallback, errorCallback, requireExpiry, requireCvv, requirePostalCode)

Parameters:

  • successCallback A callback function invoked with an argument:
    • scanResult:
      {
        "cardType":"",
        "expiryMonth":9,
        "expiryYear":2016,
        "postalCode":"1234-123",
        "cvv":"123",
        "redactedCardNumber":"••••••••••••1234",
        "rawCardNumber":"1234123412341234"
      }
  • errorCallback A callback function invoked with an argument:
    • error:
      {
        "error_code":0,
        "error_message": "";
      }
  • requireExpiry bool Require expiration date to be entered?
  • requireCvv bool Require CVV code to be entered?
  • requirePostalCode bool Require Postal Code (zip code) to be entered?

Example

plugin.cardio.scanCard(
  function(scanResult){
    console.log(scanResult)
  },
  function(error){
    console.log(error)
  }, true, true, true);

Contributors

Document author

Copyright OutSystems, 2015


LICENSE

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About


Languages

Language:Objective-C 81.9%Language:Java 16.2%Language:C 1.0%Language:JavaScript 0.9%