Skip to content

Idea-Maker/react-native-cybersource-device-fingerprint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Cybersource Device Fingerprint

Getting started

$ yarn add https://github.com/Idea-Maker/react-native-cybersource-device-fingerprint

Manual installation

iOS

NOTE: if you use RN 0.60+ you can autolinking, ignore step 1.

  1. Add pod 'RNCybersourceDeviceFingerprint', :path => '../node_modules/react-native-cybersource-device-fingerprint/ios' to your Podfile
  2. Run pod install from ios folder
  3. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.estuardoeg.CybersourceDeviceFingerprint.RNCybersourceDeviceFingerprintPackage; to the imports at the top of the file
  • Add private static Application _application;
  • Add in onCreate() _application = this;
  • Add new RNCybersourceDeviceFingerprintPackage(_application) to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-cybersource-device-fingerprint'
    project(':react-native-cybersource-device-fingerprint').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-cybersource-device-fingerprint/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(':react-native-cybersource-device-fingerprint')
    

Usage

import RNCybersourceDeviceFingerprint from 'react-native-cybersource-device-fingerprint'

// INITIALIZE THE SDK
RNCybersourceDeviceFingerprint.configure(ORG_ID).then( () => {
	console.log('THE CYBERSOURCE INIT IS OK')
})
.catch(err => {
	console.log('THE CYBERSOURCE INIT ERROR IS ', err)
})
// getSession accepts custom attributes for session, check the Cybersource SDK documentation
RNCybersourceDeviceFingerprint.getSessionID([]).then( (obj) => {
	console.log(`The session ID is ${obj.sessionId}`)
})
.catch(err => {
	console.log('THE CYBERSOURCE ERROR IS ', err)
})

About

This library returns the device fingerprint, required for Cybersource mobile implementations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Objective-C 71.0%
  • Java 12.4%
  • JavaScript 8.5%
  • Shell 5.8%
  • Ruby 2.3%