.# ajo-pay
ajo-pay
is a react-native library to simplify the integration of paystack payment gateway into AJO project
You can install this library using npm
npm install ajo-pay
In your react native project:
import React, { useState } from 'react';
import { PaystackModal } from 'ajo-pay';
const MakePayment = () => {
const [visible, setVisible] = useState(false);
return (
<>
<Button title="Pay Now" onPress={() => setVisible(true)} />
<PaystackModal
isVisible={visible}
email="user@example.com"
amount={5000}
publicKey="pk_test_xxxxx"
reference="reference_id"
onSuccess={(ref) => {
// you can call the API endpoint to verify payment using the reference
console.log('Payment successful:', ref);
setVisible(false);
}}
onClose={() => setVisible(false)}
/>
</>
);
};