@netappsng/expo-react-native-netappspaysdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.54 • Public • Published

@netappsng/react-native-netappspaysdk

Netapps payment sdk

Installation

npx expo install @netappsng/expo-react-native-netappspaysdk react-native-webview

Example Usage

import * as React from 'react';
import {NetAppsPayProvider, useNetAppsPay} from '@netappsng/expo-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>
  );
}

Package Sidebar

Install

npm i @netappsng/expo-react-native-netappspaysdk

Weekly Downloads

0

Version

0.1.54

License

MIT

Unpacked Size

8.04 MB

Total Files

539

Last publish

Collaborators

  • talktothelaw
  • jerrywap