SDKs
React Native
Payaza React Native Library.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Payaza React Native Library.
npm install react-native-payaza
yarn add react-native-payaza
npm install react-native-webview
npm install --save @react-native-clipboard/clipboard
react-native link react-native-webview
import Payaza, {
type IPayaza,
type PayazaErrorResponse,
type PayazaSuccessResponse,
PayazaConnectionMode,
} from 'react-native-payaza'
// ...
const payaza = React.useRef<IPayaza>(null);
// ...
const payNow = () => {
payaza.current?.createTransaction({
amount: Number(110),
connectionMode: PayazaConnectionMode.LIVE_CONNECTION_MODE,
email: "example@example.com",
firstName: "<first name>",
lastName: "<last name>",
phoneNumber: "<+12345678900>",
currencyCode: 'NGN',
transactionReference: "transaction_reference",
});
}
const handleError = (response: PayazaErrorResponse) => {
Alert.alert(response.data.message, 'Error Occurred');
};
const handleSuccess = (response: PayazaSuccessResponse) => {
Alert.alert(
response.data.message,
`Transaction reference {$response.data.payaza_reference}`
);
};
// ...
return (
<View>
<TouchableOpacity onPress={payNow}>
<Text style={styles.buttonText}>Pay Now</Text>
</TouchableOpacity>
<Payaza
onSuccess={handleSuccess}
onError={handleError}
onClose={console.log}
merchantKey="<public key>"
ref={payaza}
/>
</View>
)
| Parameter | Description | Format |
|---|---|---|
| The email address of the customer. | string | |
| firstName | The first name of the customer. | string |
| lastName | The last name of the customer. | string |
| phone_number | The phone number of the customer. It must be international standard i.e. +2348012345678 | string |
| transactionReference | This is the transaction reference that you generated for the transaction. This unique and no 2 transactions can have the same reference.. | string |
| merchantKey | This is your public API Key. | string |
| connectionMode | Mode of session (LIVE_CONNECTION_MODE or TEST_CONNECTION_MODE). | string |
| amount | The amount the customer is expected to pay. | amount |
| currencyCode | It refers to the code of the currency.(NGN, USD etc.). | string |