ajo-pay

1.0.0 • Public • Published

.# ajo-pay

ajo-pay is a react-native library to simplify the integration of paystack payment gateway into AJO project

Installation

You can install this library using npm

npm install ajo-pay

Usage

Basic setup

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

Readme

Keywords

Package Sidebar

Install

npm i ajo-pay

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

3.4 kB

Total Files

4

Last publish

Collaborators

  • rigantech