GithubHelp home page GithubHelp logo

isabella232 / judokit-reactnative Goto Github PK

View Code? Open in Web Editor NEW

This project forked from judopay/judokit-reactnative

0.0 0.0 0.0 2.01 MB

Judopay's React Native module and sample app

Home Page: https://www.judopay.com/

License: MIT License

JavaScript 0.66% Ruby 2.18% C 0.69% Objective-C 46.00% Java 0.75% Kotlin 24.18% TypeScript 24.99% Swift 0.05% Starlark 0.50%

judokit-reactnative's Introduction

JudoPay React Native module

JudoPay's React Native module and sample app. This module is a wrapper around the JudoKit-iOS library on iOS and the JudoKit-Android library on Android.

Features

  • Card transactions (Payment, PreAuth, Save Card, Register Card, Check Card);
  • Token payments/pre-auths;
  • Apple Pay;
  • Google Pay;
  • iDEAL;
  • Pay By Bank App;
  • 3DS;
  • Server-to-server transactions;
  • Payment Method Selection screen;

Getting started

  • yarn add judokit-react-native

    or if you use npm: npm install judokit-react-native --save

iOS

  • Make sure that the minimum deployment target is set to 11.0 or higher in your ios/Podfile :

    platform :ios, '11.0'

  • Install Cocopods

    cd ios && pod install

Android

  • Make sure that minSdkVersion is set to 19 or higher in your android/build.gradle:

    buildscript {
        ext {
            buildToolsVersion = "29.0.3"
            minSdkVersion = 19
            compileSdkVersion = 29
            targetSdkVersion = 29
        }
        ...
    }
    
  • Make sure that you use Android Gradle plugin version 4.0.1+ in your android/build.gradle:

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
    }
    
  • Add the Judopay maven repository to allprojects / repositories in your android/build.gradle:

    allprojects {
        repositories {
            mavenLocal()
    
            mavenCentral()
            google()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url("$rootDir/../node_modules/react-native/android")
            }
            maven {
                // Android JSC is installed from npm
                url("$rootDir/../node_modules/jsc-android/dist")
            }
        }
    }
    
    

Update an existing project

yarn upgrade judokit-react-native

iOS

  • Update Cocoapods

    cd ios && pod update JudoKit-iOS

Android

  • Rebuild your project

Usage

For a detailed description of all features, visit our documentation or try out the sample app attached to the package.

import Judo, {
  JudoAuthorization,
  JudoTransactionType,
} from 'judokit-react-native'

// 1. Create a Judo session by providing an authorization object (basic or session)
const auth: JudoAuthorization = {token: 'YOUR-TOKEN', secret: 'YOUR_SECRET'}
const judo = new Judo(auth)

// 2. Set the Judo session to sandbox mode for testing
judo.isSandboxed = true

// 3. Create a Judo configuration to setup your payment flow
const amount: JudoAmount = {
    value: '0.01',
    currency: 'GBP',
}

const reference: JudoReference = {
    consumerReference: 'MY-CONSUMER-REFERENCE',
    paymentReference: 'MY-PAYMENT-REFERENCE'
}

const configuration: JudoConfiguration = {
    judoId: 'MY-JUDO-ID',
    amount: amount,
    reference: reference
}

// 4. Invoke a payment transaction and handle the result
judo.invokeTransaction(JudoTransactionType.Payment, configuration)
    .then((response) => {
        // Handle response
    })
    .catch((error) => {
       // Handle error
    });

judokit-reactnative's People

Contributors

zfoltin avatar mpetrenco avatar andreygalkin avatar marcghelas avatar stefan-tudor avatar dependabot[bot] avatar stpopa avatar dave-pollock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.