npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

itexpay-react

v1.0.2

Published

React library for ItexPay Checkout

Downloads

22

Readme

ItexPay React Library

NPM version Build npm-typescript License

This SDK helps you accept payments seamlessly using ItexPay Inline Checkout.

Demo

Itex Inline Checkout Screenshot

Installation:

yarn add itexpay-react

or

npm install --save itexpay-react

Usage :

There is currently only one way to use this library in your React project and that is using the useItexPay hook. This returns an object with two attributes: handlePayment (the function passed to the button on click) and loaded (which shows whether or not the script has been loaded completely).

Import useItexPay to your component:

import * as React from 'react';
import { useItexPay, ItexPayProps } from 'itexpay-react'

const options: ItexPayProps = {
    api_key: '<your_api_key>',
    first_name: 'John',
    last_name: 'Doe',
    phone_number: '07011122233',
    email: '[email protected]',
    amount: 100,
    reference: '<your_transaction_reference>,
    currency: 'NGN'
}

const PaymentScreen = () => {

    const { handlePay, loaded } = useItexPay(options, {
        onCompleted: () => console.log('payment completed'), 
        onClose: () => console.log('onClose'), 
        onError: () => {}
    })

    if (!loaded) {
        return <p>Initializing payment...</p>
    }

    return (
        <button onClick = {handlePay}>Make payment</button>
    )
    
};

export default PaymentScreen

Parameters

Read more about our parameters and how they can be used here.

| Parameter | Required? | Description | | ------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | api_key | True | Your public API key | | reference | True | Your transaction reference. This MUST be unique for every transaction | | amount | True | The transaction amount (this is that amount the customer is going to be charged). | | currency | True | currency to charge in. Defaults to NGN | | redirecturl | False | URL to redirect the customer to upon completion of a transaction | | first_name | True | Customer's first name | | last_name | True | Customer's last name | | | email | True | Customer's email address | | phone_number | True | Customer's phone number | | onComplete (function) | True | This is the function that runs after payment is completed

Support

If you need further support while using this library, don't hesitate to reach out to us. You can either create an issue on our Github repository or get in touch with our team through email at [email protected]. We are here to help!

License

This project is licensed under the MIT License - see the LICENSE.md file for details