@use-africa-pay/core
v1.2.1
Published
A unified React hook for African payment gateways (Paystack, Flutterwave, Monnify, Remita)
Downloads
790
Maintainers
Readme
@use-africa-pay/core
The core logic for use-africa-pay, a unified React hook for African payment gateways.
Created and Maintained by Idy Williams
Installation
npm install @use-africa-pay/coreUsage
import { useAfricaPay, PaystackAdapter } from '@use-africa-pay/core';
const { initializePayment } = useAfricaPay();
const handlePayment = () => {
initializePayment({
provider: 'paystack',
adapter: PaystackAdapter, // Pass the adapter instance
testMode: true, // Optional: Defaults to true
publicKey: 'pk_test_...',
amount: 5000,
currency: 'NGN',
reference: 'ref_' + Date.now(),
user: {
email: '[email protected]',
},
onSuccess: (response) => console.log('Success:', response),
onClose: () => console.log('Closed'),
});
};See the main repository for full documentation.
