1.0.6 • Published 10 days ago

omnipay-reactnative-sdk v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

omnipay-reactnative-sdk

Omnipay react native sdk

Installation

yarn add omnipay-reactnative-sdk

Dependencies

yarn add react-native-select-contact react-native-webview react-native-share

Make sure your manifest files includes permission to read contacts

<uses-permission android:name="android.permission.READ_CONTACTS" />

Also add this for Android 11+ support below the application tag in your AndroidManifest.xml file

<application>
......
</application>
<queries>
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="vnd.android.cursor.dir/contact" />
    </intent>
</queries>

If using CocoaPods, in the ios/ run:

pod install

Please make sure AndroidX is enabled in your project by editting android/gradle.properties and adding 2 lines:

android.useAndroidX=true
android.enableJetifier=true

Usage

// usage with useOmnipay hook
import { OmnipayProvider, useOmnipay } from 'omnipay-reactnative-sdk';

// Wrap your parent component with OmnipayProvider like below
<OmnipayProvider
  publicKey="OMNIPUBKEY_HZA3ERGYEE5XUFGTZDQV_MNKRSTA3-TU"
  env="dev"
  color="red"
>
  {/* the rest of your app */}
</OmnipayProvider>;

// import useOmnipay hook in the component you need to show the bills or wallet sdk in
const { initiateBills, initiateWallet } = useOmnipay();

function onBillsClosed() {
  console.log('sdk is closed..you can do some stuff');
}

function onWalletClosed() {
  console.log('wallet is closed..you can do some stuff');
}

initiateBills({ phoneNumber: '08020001111', onClose: onBillsClosed });
initiateWallet({
  phoneNumber: '08020001111',
  customerRef: '9ab6790',
  userRef: '889huop',
  onClose: onWalletClosed,
  usesAirtimeData: true,
  usesBills: true,
  usesPaylater: true,
  usesPromo: true,
  usesPos: true,
  usesTransfer: true,
});

Properties

NameTypeDescription
colorStringcolor of primary buttons and links
envStringdev or prod
phoneNumberStringphone number of the customer
publicKeyStringpublic key of the company on omnipay
onCloseFunctionthis is used to notify you when the sdk closes
usesAirtimeDataBooleanwhether to show airtime and data shortcut in wallet view
usesBillsBooleanwhether to show bills shortcut in wallet view
usesPaylaterBooleanwhether to paylater tab in wallet view
usesPromoBooleanwhether to show promo tab in wallet view
usesPosBooleanwhether to pos shortcur in wallet view
usesTransferBooleanwhether to transfer shortcut in wallet view

Registration Sdk

import { Omnipay } from "omnipay-reactnative-sdk";

//render it anywhere on your page where you want to display the registration sdk
<Omnipay.Registration
  env="dev"
  color="#42a99b"
  publicKey="OMNIPUBKEY_K0VUJN0JAJZIXUGKAG6XNBXR-RH5YNRS"
  phoneNumber="09031234571"
  onRegistrationSuccessful={({ customerRef, walletId }) => {
    /**
     * the customer ref and walletid can be saved 
     * to your database at this point
     * 
     * we will also be sending a webhook notification
     * so, you can either save at this point or via the webhook
     */
    console.log(customerRef, walletId);
  }}
  onClose={() => {
    /**
     * the user is done with registration.
     * you can navigate them else where at this point
     */
   
  }}
/>

Properties

NameTypeDescription
colorStringcolor of primary buttons and links
envStringdev or prod
phoneNumberStringphone number of the customer
publicKeyStringpublic key of the company on omnipay
viewStringthe view to render on the sdk
1.0.6

10 days ago

1.0.5

10 days ago

1.0.4

8 months ago

1.0.2

10 months ago

1.0.1

12 months ago

1.0.3

10 months ago

1.0.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.9.8

1 year ago

0.9.7

1 year ago

0.9.9

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

0.8.9

1 year ago

0.8.8

1 year ago

0.8.5

1 year ago

0.6.7

1 year ago

0.4.9

1 year ago

0.6.6

1 year ago

0.4.8

1 year ago

0.8.7

1 year ago

0.6.9

1 year ago

0.8.6

1 year ago

0.6.8

1 year ago

0.9.0

1 year ago

0.7.2

1 year ago

0.5.4

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.5.6

1 year ago

0.7.3

1 year ago

0.5.5

1 year ago

0.5.0

1 year ago

0.7.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.7.9

1 year ago

0.7.6

1 year ago

0.5.8

1 year ago

0.7.5

1 year ago

0.5.7

1 year ago

0.7.8

1 year ago

0.7.7

1 year ago

0.5.9

1 year ago

0.8.1

1 year ago

0.6.3

1 year ago

0.8.0

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.4.7

1 year ago

0.8.2

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.4.6

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago