React Native Conekta SDK for iOS and Android
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
RNConekta
android
.gitignore First commit Nov 29, 2015
.npmignore First commit Nov 29, 2015
LICENSE
README.md
index.js Version bump and remove test method Dec 7, 2015
package.json Update package.json Sep 13, 2017

README.md

React Native Conekta npm version

React Native Conekta SDK for iOS and Android

Supported React Native Versions

Component Version RN Versions README
1.0.4 <= 0.16 Open
>= 2.0.0 >= 0.30 Open

Installation

npm install --save react-native-conekta

react-native link

Usage

var conektaApi = new Conekta();

conektaApi.setPublicKey( 'YOUR_PUBLIC_KEY' );

conektaApi.createToken({
  cardNumber: '4242424242424242',
  name: 'Manolo Virolo',
  cvc: '111',
  expMonth: '11',
  expYear: '21',
}, function(data){
  console.log( 'DATA:', data ); // data.id to get the Token ID
}, function(){
  console.log( 'Error!' );
});

iOS Manual Installation (if you did not use react-native link)

Please see: Linking Libraries iOS

Library folder: your-project/node_modules/react-native-conekta/RNConekta

Android Manual Installation (if you did not use react-native link)

In android/settings.gradle

...

include ':react-native-conekta'
project(':react-native-conekta').projectDir = file('../node_modules/react-native-conekta/android')

In android/app/build.gradle

...

dependencies {
    ...

    compile project(':react-native-conekta')
}

Manually register module in MainApplication.java:

import com.dieam.reactnativeconekta.ReactNativeConektaPackage;  // <--- import

public class MainApplication extends Application implements ReactApplication {

  ......
  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
      @Override
      protected boolean getUseDeveloperSupport() {
        return BuildConfig.DEBUG;
      }

      @Override
      protected List<ReactPackage> getPackages() {

      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReactNativeConektaPackage() // <---- Add the Package
      );
    }
  };

  ....
}