# evergent-native-sdk-aha

> Evergent Npm package for JusPay payment gateway webview setup

Latest version **1.0.9** (published 2024-06-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install evergent-native-sdk-aha
pnpm add evergent-native-sdk-aha
yarn add evergent-native-sdk-aha
bun add evergent-native-sdk-aha
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2024-06-04 |
| First published | 2021-10-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 239.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Evergent Technologies Pvt Ltd |
| Maintainers | evadmin |

## Links

- npm: https://www.npmjs.com/package/evergent-native-sdk-aha
- npm.io page: https://npm.io/package/evergent-native-sdk-aha

## Recent versions

- 1.0.9 (latest) — 2024-06-04
- 1.0.8 — 2024-01-09
- 1.0.7 — 2022-10-19
- 1.0.6 — 2022-09-20
- 1.0.5 — 2022-09-02
- 1.0.4 — 2022-09-02
- 1.0.3 — 2021-11-09
- 1.0.2 — 2021-10-21
- 1.0.1 — 2021-10-21

## README

Evergent Npm package for JusPay payment gateway webview setup

Please follow the steps 

Step 1 : 

    $ npm i evergent-native-sdk-aha

Step 2 : 
    If evergent-native-sdk-aha version > 1.0.3, uninstall/remove @react-native-community/async-storage package(As this package has deprecated) and install below packages. 
    
    $ npm i hyper-sdk-react@^3.0.25 
    $ npm i react-native-webview
    $ npm i @react-native-async-storage/async-storage

Step 3 : In Android folder
		
    Add following maven url in the allProjects > repositories section of root(top) build.gradle:

    maven { url "https://maven.juspay.in/jp-build-packages/hyper-sdk/" }
		
step 4 : In Android folder

    Add the clientId ext property in root(top) build.gradle:

    buildscript {
        ....
        ext {
            ....
            clientId = "<clientId shared by Juspay team>"
            hyperSDKVersion = "2.1.25"
            ....
        }
        ....
    }

    This is the same clientId present earlier in the MerchantConfig.txt file.

step 5 : 

    1. Delete MerchantConfig.txt file.

    2. Remove useDynamicAssets property defined in root(top) build.gradle.

step 6 : Install evergent-native-sdk-aha and import below modules.

    import {LoadSdk, EvntHyperSdkWebview} from 'evergent-native-sdk-aha';

step 7 : Call LoadSdk atleaset 5sec before loading the EventHyperSdkWebview, 

    Note: Suggested to call LoadSdk in initial state of the plans screen.

    import {LoadSdk} from 'evergent-native-sdk-aha';

    let params = {
        channelPartnerID:<channelPartnerId>,
        accessToken:<accessToken>,
        country:<country>,
        url:<url>
    }

    LoadSdk(params);

step 8 : Need to send the below request perameters as props to EvntHyperSdkWebview 

Example 

    import {EvntHyperSdkWebview} from 'evergent-native-sdk-aha';
		
    let request = {
        url: {Evergent URL},
        country: {Country code},
        platform: {platform},
        deviceType: {deviceType},
        serviceID: {serviceID},
        channelPartnerID: {channelPartnerID},
        locale: {locale},
        stateCode: {stateCode},
        accessToken:{accessToken}
    };

    <EvntHyperSdkWebview onPaymentAction={onPaymentAction} cleaverTapEventAction={cleaverTapEventAction} {...request}/>
	
step 9 : Create below functions to handle payment action and cleaver tap event from the package

Example
		
    const onPaymentAction = event => {
        ... Here we will receive the payment operation result like success or failure 
    };

    const cleaverTapEventAction = event => {
        ... Here we will receive the cleaver tap event data 
    };

---
_Source: https://npm.io/package/evergent-native-sdk-aha · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
