Coder Social home page Coder Social logo

hasilt / react-native-ngenius Goto Github PK

View Code? Open in Web Editor NEW

This project forked from network-international/react-native-ngenius

1.0 1.0 0.0 1.13 MB

License: Other

JavaScript 31.73% Starlark 4.12% Java 31.20% Swift 0.23% Ruby 13.16% C 0.22% Objective-C 19.34%

react-native-ngenius's Introduction

react-native-ni-sdk

Banner

Requirements

  • Reat-native v0.60+
  • iOS version 11+
  • Android minSDK version 19

Getting started

npm i @network-international/react-native-ngenius

Note: If your project is using iOS deployment target 10, you need to increase it to 11.

In order to increase change the versions in the following files

  • Change the iOS deployment version in your-project/ios/Podfile as follows platform :ios, '11.0'
  • Open the .xcworkspacefile inside the following directory your-project/ios/yourproject.xcworkspace and change the deployment target to 11.0.

Basic usage example

import {
  initiateCardPayment,
  initiateSamsungPay,
  initiateApplePay,
} from '@network-international/react-native-ngenius';

// order is the order response received from NGenius create order API
const makeCardPayment = async () => {
    try {
      const resp = await initiateCardPayment(order);
    } catch (err) {
      console.log({ err });
    }
};

// order is the order response received from NGenius create order API
// merchantName is the name of merchant's establishment
// serviceId is the serviceId that is generated in the Samsung Pay developer portal
const makeSamsungPayPayment = async () => {
    try {
      const resp = await initiateSamsungPay(order, merchantName, serviceId);
    } catch (err) {
      console.log({ err });
    }
};

// order is the order response received from NGenius create order API
// mid is the merchant ID that is generated in the Apple developer portal
// countryCode is the country code of the transaction country Eg: AE for UAE
const makeApplePayPayment = async () => {
    try {
      const resp = await initiateApplePay(order, mid, countryCode);
    } catch (err) {
      console.log({ err });
    }
};

react-native-ngenius's People

Contributors

mu1ex avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.