@kyivstarteam/react-native-ecom-portmone
TypeScript icon, indicating that this package has built-in type declarations

1.3.7 • Public • Published

React Native Ecom Portmone

Portmone eCommerce SDK

Usage

General description

Portmone SDK supports version Android 4.4 KitKat, API level 19 and latest versions.

Integration

### build.gradle (project level)
allprojects {
   repositories {
       google()
       jcenter()

       mavenCentral()
       maven {
           url "https://github.com/Portmone/Android-e-Commerce-SDK/raw/master/"
       }

   }
}

Install

$ yarn add @kyivstarteam/react-native-ecom-portmone

Link

  • React Native 0.60+

CLI autolink feature links the module while building the app.

  • React Native <= 0.59
$ react-native link @kyivstarteam/react-native-ecom-portmone

Import

import PortmoneSDK from '@kyivstarteam/react-native-ecom-portmone';

Portmone SDK

import PortmoneSdk, { PaymentType } from '@kyivstarteam/react-native-ecom-portmone';

type Locale = 'uk' | 'ru' | 'en';

const locale: Locale = 'uk';

interface SavingCard {
    token: string
}

const payeeId: string = 'Your payee id';
const phoneNumber: string = '681234567';
const amount: number = 10
const type: PaymentType = 'account';

const portmoneSdk = new PortmoneSdk(locale);

initPayWithoutSavingCard = () => {
    portmoneSdk.initCardPayment(payeeId, phoneNumber, amount, type);
}

initSavingCard = async () => {
    const result: SavingCard = await portmoneSdk.initCardSaving(payeeId);
}

addOnFormDismissEvent = async (callback) => {
    const eventCallback = () => {
        callback();
        portomoneSdk.removeAllListeners();
    };

    await portomoneSdk.addListener('onFormViewDismissed', eventCallback);
}

Readme

Keywords

Package Sidebar

Install

npm i @kyivstarteam/react-native-ecom-portmone

Weekly Downloads

9

Version

1.3.7

License

MIT

Unpacked Size

210 kB

Total Files

34

Last publish

Collaborators

  • e-genov-ks
  • e-genov
  • yevheniionipko