open-index/open-npm huggingface dataset:
npm package: @juspay/ec-headless-cordova-plugin
Description: A Cordova plugin for the Juspay Express Checkout Headless Sdk
Author: Kiran Puppala
Latest version: 1.1.6
Deprecated: Package no longer supported. Contact Juspay support for more info.

# PhoneGap app integration 
JusPay has a native android and iOS client which can be used by PhoneGap applications. To get started, you first need to download the code for the plugin.

## Installation 
This requires phonegap/cordova CLI 5.0+

Add the plugin to your phonegap/cordova apps using these commands.

```sh
$ phonegap plugin add @juspay/ec-headless-cordova-plugin
```
(or)
```sh
$ cordova plugin add @juspay/ec-headless-cordova-plugin
```


## Dependencies 

#### For Android 

To add or change ec-hl-cordova-plugin specific dependencies, refer this file. 
```sh
platforms/android/ec-hl-cordova-plugin/<appname>-_plugin-dependencies.gradle
```

#### For iOS 

Minimum supported iOS version: 9.0

If you are getting the pod error like `Failed to install 'ec-hl-cordova-plugin': Error: pod: Command failed with exit code 1` while installing "ec-hl-cordova-plugin" for ios, please update `platform :ios` to '9.0' in the Podfile and run the command `pod install`.


## Usage 

```sh
  var nbPayload = {
                  opName: "nbTxn",
                  paymentMethodType: "NB",
                  paymentMethod: "enter bank code", // Eg: NB_SBI
                  redirectAfterPayment: "true",
                  format: "json"
                }
  //Here payload format is specified for netbanking transaction. For other operations, refer 
  [EC SDK Doc - Android](https://developer.juspay.in/docs/android)
  [EC SDK Doc - iOS](https://developer.juspay.in/docs/ios-payments-sdk-integration)

  var requestPayload = {
            baseParams: {
              merchant_id: "pass merchant id",
              client_id: "pass client id",
              transaction_id: "pass transaction id", //optional
              order_id: "pass order id",
              amount: "amount", //eg: "1.00"
              customer_id : "pass customer id",
              customer_email : "pass email",
              customer_phone_number : "pass phone number",
              environment: "pass environment" //eg: "sandbox" or "prod"
            },
            serviceParams: {
              service: "in.juspay.ec",
              session_token: "pass client auth token",
              end_urls: [], //eg: ["https://www.reload.in/recharge/", ".*www.reload.in/payment/f.*"]
              payload: JSON.stringify(nbPayload)
            },
            customParams: {}, //customParams are optional key value pairs. { udf_circle: "Andhra Pradesh" }
            onSuccess: function (successResponse) {
              console.log("Success Response", successResponse);
            },
            onError: function (errorResponse) {
              console.log("Error Response", errorResponse);
            }
     }
  var expressCheckout = new ExpressCheckout();
  expressCheckout.startPayment(requestPayload);
```
npm package: @juspay/ec-react-native-library
Description: A react-native native module library for the Juspay Express Checkout Sdk
Author: Kiran Puppala
Latest version: 1.0.16
Deprecated: Package no longer supported. Contact Juspay support for more info.

# @juspay/ec-react-native-library integration

This is react-native library for Juspay's Express Checkout SDK. For installing it to your project. Follow the below steps.

## Installation

```sh
npm install @juspay/ec-react-native-library --save

// Required only if react-native version is below 0.60.0
react-native link @juspay/ec-react-native-library
```

## Android

Add below maven url to your app/build.gradle

```groovy
    maven {
        url "https://maven.juspay.in/jp-build-packages/hyper-sdk/"
    }
```

**(Optional)** Add the following ext properties in root `build.gradle` if you want to override either of the base SDK versions present in plugin:

```groovy
buildscript {
  ....
   ext {
       ....
       hyperSDKVersion = "2.0.2-rc.65"
       hyperWrapperVersion = "2.0.0-19"
       ....
   }
   ....
}
```

Note: These versions are just for explanatory purposes and may change in future. Contact Juspay support team for the latest SDK versions.

## iOS

Run the following command inside the ios folder of your react native project:

```sh
pod install
```

## Usage

```sh
import EcReactNativeLibrary from '@juspay/ec-react-native-library';

var nbPayload = {
                  opName: "nbTxn",
                  paymentMethodType: "NB",
                  paymentMethod: "enter bank code", // 
                  redirectAfterPayment: "true",
                  format: "json"
                }
//Here payload format is specified for netbanking transaction. For different types of payload types 
//for other operations, refer https://developer.juspay.in/docs/expresscheckout-sdk


var requestPayload = {
                baseParams: {
                  merchant_id: "pass merchant id",
                  client_id: "pass client id",
                  transaction_id: "pass transaction id", //optional
                  order_id: "pass order id",
                  amount: "amount", //eg: "1.00"
                  customer_id : "pass customer id",
                  customer_email : "pass email",
                  customer_phone_number : "pass phone number",
                  environment: "pass environment" eg: "sandbox" or "prod"
                },
                serviceParams: {
                  service: "in.juspay.ec",
                  session_token: "pass client auth token",
                  endUrls: [], //eg: ["https://www.reload.in/recharge/", ".*www.reload.in/payment/f.*"]
                  payload: JSON.stringify(nbPayload) 
                },
                customParams: {} //customParams are optional key value pairs. 
              }
              EcReactNativeLibrary.startPayment( 
                  JSON.stringify(requestPayload), 
                  (successResponse) => {
                    console.log(successResponse);
                  },
                  (errorResponse) => {
                    console.log(errorResponse);
                  } 
              );

```
npm package: @juspay/simple-card-validator
Description: Card validation helpers for card number, expiry and CVV.
Author: boazjohn@gmail.com
Latest version: 1.2.3

# Card Validator

Generic helpers for card number, expiry and CVV validations

[![npm version](https://badge.fury.io/js/%40juspay%2Fsimple-card-validator.svg)](https://badge.fury.io/js/%40juspay%2Fsimple-card-validator)

## Usage:
Import the library and initialize card object.

Install from npm:

`npm i @juspay/simple-card-validator --save`

`var cardValidator = require('simple-card-validator');`

Or, you can simply use the file from `dist/validator.js` if you are not using node/npm.

`var card = new cardValidator('4242-4242-4242-4242');`

### Getting card details
`card.getCardDetails();`
This would output, card brand and different validation outputs like below:
```
{ card_type: 'visa',
  valid: true,
  luhn_valid: true,
  length_valid: true,
  cvv_length: [ 3 ],
  gaps: [ 4, 8, 12 ],
  supported_lengths: [ 16 ],
  max_length: 16 }
```

#### Output format

| Field             | Description                           | Type              |
| ----------------- | ------------------------------------- | ----------------- |
| card_type         | The card issuer for the provided card | String            |
| valid             | Are the card details valid            | Boolean           |
| luhn_valid        | Is the card number valid              | Boolean           |
| length_valid      | If the card number length is valid    | Boolean           |
| cvv_length        | If the CVV/CAVV length is valid       | Array [ Integer ] |
| gaps              | Gaps for UI as printed in cards       | Array [ Integer ] |
| supported_lengths | Supported lengths for the card type   | Array [ Integer ] |
| max_length        | Maximum length for the card type      | Integer           |


### Validations
To simply validate a card, call:
`card.validateCard();`
The result will be a validity boolean.

For validating expiry date,
`card.validateExpiry('12/2018');`

Additionally, the base date can be set for expiry validations. The base month and date can be provided by using,
`card.setBaseDate(month, year);`

eg: `card.setBaseDate('02', '2016');`

For validating CVV, use:
`card.validateCvv(111);`
CVV will be validated based on the brand of the card.


## Contribution

Read through the development
[guidelines](https://sites.google.com/a/juspay.in/card-validator-devel-guide/).

## License

MIT license. Copyright © 2018 - [juspay.in](https://www.juspay.in).