diff --git a/android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryModule.java b/android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryModule.java similarity index 93% rename from android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryModule.java rename to android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryModule.java index 8d8df87..4dc3be4 100644 --- a/android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryModule.java +++ b/android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryModule.java @@ -18,17 +18,17 @@ import com.google.gson.Gson; -public class RNCardConnectReactLibraryModule extends ReactContextBaseJavaModule { +public class RNBoltReactLibraryModule extends ReactContextBaseJavaModule { - private static final String TAG = "CardConnect"; + private static final String TAG = "BoltSDK"; - public RNCardConnectReactLibraryModule(ReactApplicationContext reactContext) { + public RNBoltReactLibraryModule(ReactApplicationContext reactContext) { super(reactContext); } @Override public String getName() { - return "CardConnect"; + return "BoltSDK"; } @ReactMethod diff --git a/android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryPackage.java b/android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryPackage.java similarity index 82% rename from android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryPackage.java rename to android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryPackage.java index 45252bb..7b9c465 100644 --- a/android/src/main/java/com/reactcardconnect/sdk/RNCardConnectReactLibraryPackage.java +++ b/android/src/main/java/com/reactbolt/sdk/RNBoltReactLibraryPackage.java @@ -10,10 +10,11 @@ import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import com.facebook.react.bridge.JavaScriptModule; -public class RNCardConnectReactLibraryPackage implements ReactPackage { + +public class RNBoltReactLibraryPackage implements ReactPackage { @Override public List createNativeModules(ReactApplicationContext reactContext) { - return Arrays.asList(new RNCardConnectReactLibraryModule(reactContext)); + return Arrays.asList(new RNBoltReactLibraryModule(reactContext)); } // Deprecated from RN 0.47 diff --git a/android/src/main/java/com/reactcardconnect/sdk/ValidateException.java b/android/src/main/java/com/reactbolt/sdk/ValidateException.java similarity index 100% rename from android/src/main/java/com/reactcardconnect/sdk/ValidateException.java rename to android/src/main/java/com/reactbolt/sdk/ValidateException.java diff --git a/bolt_sdk.js b/bolt_sdk.js new file mode 100644 index 0000000..963f02b --- /dev/null +++ b/bolt_sdk.js @@ -0,0 +1,5 @@ +import { NativeModules } from 'react-native'; + +const { BoltSDK } = NativeModules; + +export default BoltSDK; diff --git a/card_connect.js b/card_connect.js deleted file mode 100644 index 4259bfb..0000000 --- a/card_connect.js +++ /dev/null @@ -1,5 +0,0 @@ -import { NativeModules } from 'react-native'; - -const { CardConnect } = NativeModules; - -export default CardConnect; diff --git a/example/App.js b/example/App.js index 67780e1..334a479 100644 --- a/example/App.js +++ b/example/App.js @@ -1,15 +1,18 @@ -import React, {Component} from 'react'; -import {StyleSheet, Text, View} from 'react-native'; -import CardConnect from 'react-native-card-connect'; +import React, { Component } from 'react'; +import { StyleSheet, Text, View } from 'react-native'; +import BoltSDK from 'react-native-card-connect'; export default class App extends Component { + state = { status: 'starting', message: '--' }; + componentDidMount() { this.tokenizeCard() } + async tokenizeCard() { try { @@ -19,9 +22,9 @@ export default class App extends Component { const expiryDate = '12/22'; const cVc = "123"; - CardConnect.setupConsumerApiEndpoint(`https://${siteId}.cardconnect.com`); + BoltSDK.setupConsumerApiEndpoint(`https://${siteId}.cardconnect.com`); - const token = await CardConnect.getCardToken( + const token = await BoltSDK.getCardToken( cardNumber, expiryDate, cVc diff --git a/package.json b/package.json index 2611863..ad577e7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "React Native Card Connect", "description": "Boilerplate library. Tokenize Credit/Debit Card info using Cardconnect Native SDKs", "version": "1.0.0", - "main": "card_connect.js", + "main": "bolt_sdk.js", "repository": { "type": "git", "url": "git+https://github.com/brij-dev/react-native-card-connect.git",