# react-native-cybersource-fingerprint-sdk

Basic implementation of Cybersource fingerprint SDK for android and iOS

SDK configuration requires a valid `ORG_ID` and `SERVER_URL` that are provided by cybersource. Also `MERCHANT_ID` is required to match sessionID with decision manager.

## Installation

NOTE: Tested with RN 0.63+

```sh
yarn add react-native-cybersource-fingerprint-sdk
```

## Usage

```js
import CybersourceFingerprintSdk from "react-native-cybersource-fingerprint-sdk";

// Once in app lifetime
CybersourceFingerprintSdk.initialize('ORG_ID', 'SERVER_URL'); // return true if successful

// ...

// Generate and send sessionID each time a transaction should be processed
const sessionId = generateUniqueValue();
const result = await CybersourceFingerprintSdk.setSessionID(`MERCHANT_ID${sessionId}`); // return Promise<object> as { status: int, sessionId: string }
```

## Development

Native module code is within the folders:
* /android
* /ios

To test the libs functionality and usage on react-native, open the projects inside `example`
```sh
xed example/ios
```

Remember to install node modules and pods.

## License

MIT
