@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>
);
}