5.0.0 • Published 5 months ago

react-native-smallcase-gateway v5.0.0

Weekly downloads
69
License
MIT
Repository
github
Last release
5 months ago

react-native-smallcase-gateway

📖 Complete Guide

Getting started

$ yarn add react-native-smallcase-gateway

or

$ npm install react-native-smallcase-gateway

ios setup

add these lines at the top of your Podfile

# private podspec for smallcase
source 'git@github.com:smallcase/cocoapodspecs.git'

# default source for all other pods
source 'https://cdn.cocoapods.org'

# update the ios version if it was previously below 11.0
platform :ios, '11.0'

then run cd ios; pod update

android setup

Add these lines to your project level build.gradle

allprojects {
    repositories {
        // .. you other repositories
        maven {
          url "http://artifactory.smallcase.com/artifactory/gradle-dev-local"
          credentials {
            username "react_native_user"
            password "reactNativeUser123"
          }
      }
    }
}

add these lines in AndroidManifest.xml in the main <application /> tag

<activity android:name="com.smallcase.gateway.screens.transaction.activity.TransactionProcessActivity">
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data
      android:host="{YOUR_HOST_NAME}"
      android:scheme="scgateway" />
  </intent-filter>
</activity>

<activity android:name="com.smallcase.gateway.screens.common.RedirectActivity">
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />

    <data
      android:host="{YOUR_HOST_NAME}"
      android:scheme="scgatewayredirect"
    />
  </intent-filter>
</activity>

Example Usage

// import gateway into your file
import SmallcaseGateway from "react-native-smallcase-gateway";

// configure environment
await SmallcaseGateway.setConfigEnvironment({
  isLeprechaun: true,
  isAmoEnabled: true,
  gatewayName: "smallcase-website",
  environmentName: SmallcaseGateway.ENV.PROD,
  brokerList: ["kite", "aliceblue", "trustline"],
});

// initialize session
await SmallcaseGateway.init(sdkToken);

// execute a transaction
const res = await SmallcaseGateway.triggerTransaction(transactionId);

// start lead generation flow
SmallcaseGateway.triggerLeadGen({ email: "test@gmail.com" });

Debug / Contribution

Make sure you have react native dev environment set up

ios

  • remove node_modules in the root directory
  • run yarn install in example/
  • run pod update in example/ios
  • open SmallcaseGateway.xcworkspace in xcode
  • run yarn start (important to get symlinks to work)
  • run in debug mode
  • in xcode, navigate to Pods > Development Pods > react-native-smallcase-gateway
  • you can now edit these file directly and test the results on the running app

android without example app

  • run yarn install in the root directory
  • change directory to android/
  • add a file called gradle.properties
  • add artifactory_user and artifactory_password
  • open this folder in android studio
  • let gradle sync complete
  • you can now write code with just the android folder in context

android with example app

  • run yarn install in example/
  • add a file called gradle.properties in example/android
  • add these lines
android.useAndroidX=true
android.enableJetifier=true

FLIPPER_VERSION=version_string

artifactory_user=sampleUser
artifactory_password=samplePassword
  • run yarn start (important to get symlinks to work)
  • run yarn android to build example project for android
5.0.0

5 months ago

4.3.2

7 months ago

4.3.3

6 months ago

4.3.1

8 months ago

4.2.1

9 months ago

4.3.0

8 months ago

4.0.1

11 months ago

4.0.0

11 months ago

4.0.3

10 months ago

4.2.0

10 months ago

4.0.2

10 months ago

3.1.3

12 months ago

4.1.0

10 months ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.2

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

2.0.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.5.4

3 years ago

1.6.0

3 years ago

1.2.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.3.3

3 years ago

1.2.4

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.3.2

3 years ago

1.2.3

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.3.0-alpha.2

4 years ago

0.3.0-alpha.0

4 years ago

0.3.0-alpha.1

4 years ago

0.2.0

4 years ago

0.1.1-alpha.0

4 years ago

0.1.0

5 years ago

0.0.28

5 years ago

0.0.29

5 years ago

0.0.27

5 years ago

0.0.25

5 years ago

0.0.26

5 years ago

0.0.24

5 years ago