npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@checkout.com/cordova-plugin-checkout

v1.0.1

Published

Checkout.com Frames cordova plugin - Start accepting online card payments in just a few minutes.

Downloads

43

Readme

Cordova Checkout Plugin

A Cordova plugin for Checkout.com Frames SDK - Start accepting online card payments in just a few minutes. Supports Android & iOS.

Installation

cordova plugin add @checkout.com/cordova-plugin-checkout

Example Usage

First you need to initialize the plugin using your public key. This could be either a testing key (sandbox) or a production key

Sandbox:

cordova.plugins.Checkout.initSandboxClient("pk_test_MyTESTPublicKey", 
    function() {
        // Success, no need to do anything
    }, function (error) {
        // Error, message returned
    });

Production:

cordova.plugins.Checkout.initLiveClient("pk_MyLivePublicKey", 
    function() {
        // Success, no need to do anything
    }, function (error) {
        // Error, message returned
    });

Now you can start tokenizing credit/debit cards.

var ckoCardTokenRequest = {
    number: "4543474002249996",
    expiry_month: "6",
    expiry_year: "2025",
    name: "Bruce Wayne",
    cvv: "956",
    billing_address: {
        address_line1: "Checkout.com",
        address_line2: "90 Tottenham Court Road",
        city: "London",
        state: "London",
        zip: "W1T 4TJ",
        country: "GB"
    },
    phone: {
        country_code: "+1",
        number: "4155552671"
    }
};

function onSuccess(tokenResponse) {
    console.log('Tokenization successful', tokenResponse);
}

function onError(errorMessage) {
    console.log('Error generating token', errorMessage);
}

cordova.plugins.Checkout.generateToken(ckoCardTokenRequest, onSuccess, onError);

Example of TokenResponse:

{
    type: "card",
    token: "tok_ubfj2q76miwundwlk72vxt2i7q",
    expires_on: "2019-08-24T14:15:22Z",
    expiry_month: "6",
    expiry_year: "2025",
    scheme: "VISA",
    last4: "9996",
    bin: "454347",
    card_type: "Credit",
    card_category: "Consumer",
    issuer: "GOTHAM STATE BANK",
    issuer_country: "US",
    product_id: "F",
    product_type: "CLASSIC",
    billing_address: {
        address_line1: "Checkout.com",
        address_line2: "90 Tottenham Court Road",
        city: "London",
        state: "London",
        zip: "W1T 4TJ",
        country: "GB"
    },
    phone: {
        country_code: "+1",
        number: "4155552671"
    },
    name: "Bruce Wayne"
}

Once you get the token, you can later use it to request a payment, without you having to process or store any sensitive information.

Documentation

Checkout

Checkout.initSandboxClient(publickey, [success], [error])

Initialize Frames plugin in Sandbox mode

| Param | Type | Description | | --- | --- | --- | | publicKey | string | Sandbox account public key | | [success] | function | Success callback | | [error] | function | Error callback |

Checkout.initLiveClient(publickey, [success], [error])

Initialize Frames plugin in Live mode

| Param | Type | Description | | --- | --- | --- | | publicKey | string | Live account public key | | [success] | function | Success callback | | [error] | function | Error callback |

Checkout.generateToken(ckoCardTokenRequest, success, error)

Generate a payment token

| Param | Type | Description | | --- | --- | --- | | ckoCardTokenRequest | CkoCardTokenRequest | payment token request object| | success | function | Success callback returns CkoCardTokenResponse | | error | function | Error callback |

Models

CkoCardTokenRequest : Object

Parameters to create a payment token from a card

Properties

| Name | Type | Description | Required | --- | --- | --- | --- | | number | string | The card number | Required | | expiry_month | string | The expiry month of the card | Required | | expiry_year | string | The expiry year of the card | Required | | cvv | string | The card verification value/code. 3 digits, except for Amex (4 digits) | Optional | | name | string | The cardholder's name | Optional | | billing_address | Address | The cardholder's billing address | Optional | | phone | Phone | The cardholder's phone number | Optional |

CkoCardTokenResponse : Object

Object returned after successful tokenization

Properties

| Name | Type | Description | | --- | --- | --- | | type | string | The token type, in this case "card" | | token | string | The token value | | expires_on | string | The expiration datetime of the token | | expiry_month | string | The expiry month of the card | | expiry_year | string | The expiry year of the card | | name | string | The cardholder's name | | scheme | string | The card scheme | | last4 | string | The last 4 digit of the card number | | bin | string | The bin range of the card | | card_type | string | The card type | | card_category | string | The card category | | issuer | string | The card issuer name | | issuer_country | string | The card issuer country ISO | | product_id | string | The card product id | | product_type | string | The card product type | | billing_address | Address | The cardholder's billing address | | phone | Phone | The cardholder's phone number |

Address : Object

Properties

| Name | Type | Description | | --- | --- | --- | | address_line1 | string | The first line of the address | | address_line2 | string | The second line of the address | | city | string | The address city | | state | string | The address state | | zip | string | The address zip/postal code | | country | string | The two-letter ISO country code of the address |

Phone : Object

Properties

| Name | Type | Description | | --- | --- | --- | | country_code | string | The international country calling code. Required for some risk checks | | number | string | The phone number |

Unit Testing

You can test this plugin with cordova-plugin-test-framework

Install the tests plugin:

cordova plugin add @checkout.com/cordova-plugin-checkout/tests