0.1.80 • Published 18 days ago

@netappsng/react-native-netappspaysdk v0.1.80

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

@netappsng/react-native-netappspaysdk

Netapps payment sdk

Installation

npm install @netappsng/react-native-netappspaysdk

or

yarn add @netappsng/react-native-netappspaysdk

Note: For IOS Add Don't forget to added this to Info.plist ->

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>tel</string>
  <string>telprompt</string>
</array>

For Android Add the following in AndroidManifest.xml ->

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Find File and update android/build.gradle in buildscript {

}

add the following

    allprojects {
        repositories {
            maven {
                url "https://jitpack.io"
                credentials { username "jp_iu426m6k793tts6nisfjg8at42" }

            }
        }
    }
    <!-- Add NFC Permission -->
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />

Note: if you are using expo use this npm sdk instead expo-react-native-netappspaysdk

Example Usage

import * as React from 'react';
import { NetAppsPayProvider, useNetAppsPay } from '@netappsng/react-native-netappspaysdk';

const payload = {
  currency: 'NGN',
  amount: 100,
  phone: "081******",
  tx_ref: "1234",
  paymentChannels: 'card,ussd,transfer,payatitude',
  email: 'nwokolawrence6@gmail.com',
  fullname: 'Nwoko Ndubueze',
  narration: 'Testing',
};

export default function App() {
  const { initPayment, cancelPayment, closePaymentModal } = useNetAppsPay({
    onFailed: (response) => {
      console.log(response, 'Failed');
    },
    onSuccessful: (response) => {
      console.log(response, 'Successful');
    },
    onCopyUssdCode: (ussdCode) => {
      console.log(ussdCode, 'copy ussd code');
    }
  });
  const handleMakePayment = () => {
    initPayment(payload);
  };

  return (
    <NetAppsPayProvider publicKey="Netappspaykey">
      <Button onPress={handleMakePayment}>
        <Label>Make Payment</Label>
      </Button>
    </NetAppsPayProvider>
  );
}
0.1.80

18 days ago

0.1.74

2 months ago

0.1.76

2 months ago

0.1.77

2 months ago

0.1.70

2 months ago

0.1.72

2 months ago

0.1.68

2 months ago

0.1.66

3 months ago

0.1.65

3 months ago

0.1.52

9 months ago

0.1.53

9 months ago

0.1.54

9 months ago

0.1.55

9 months ago

0.1.56

9 months ago

0.1.57

9 months ago

0.1.58

9 months ago

0.1.50

10 months ago

0.1.51

10 months ago

0.1.63

8 months ago

0.1.64

8 months ago

0.1.60

9 months ago

0.1.61

9 months ago

0.1.62

8 months ago

0.1.49

12 months ago

0.1.48

12 months ago

0.1.30

1 year ago

0.1.31

1 year ago

0.1.32

1 year ago

0.1.33

1 year ago

0.1.34

1 year ago

0.1.35

1 year ago

0.1.36

1 year ago

0.1.37

1 year ago

0.1.27

1 year ago

0.1.28

1 year ago

0.1.29

1 year ago

0.1.41

1 year ago

0.1.42

1 year ago

0.1.43

1 year ago

0.1.44

1 year ago

0.1.46

1 year ago

0.1.47

1 year ago

0.1.25

1 year ago

0.1.26

1 year ago

0.1.40

1 year ago

0.1.38

1 year ago

0.1.39

1 year ago

0.1.21

1 year ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.23

1 year ago

0.1.12

1 year ago

0.1.24

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago