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

webitspay-react

v1.1.9

Published

Official React package for Webitspay

Downloads

1

Readme

Webitspay Official react sdk

Webitspay SDK allows you accept payments easily in your react application

Installation

npm install webitspay-react

NOTE

reference has to be updated after any successful partial payment to enable re-initialization.

Configuration Options

publicKey

string: Required Your public key can be found on your dashboard settings.

customerName

string: Required The name of the customer trying to make payments

customerEmail

string: Required The email of the customer trying to make payments

currency

string: Required The name of the fiat currency the merchant accepts

amount

number | string: Required The amount you want to charge the user in currency

metadata

object : Optional This contains any additional information you want to pass with this transaction

reference

string : Optional a unique string used to identifier the user

acceptPartialPayment

string : Optional This is used to enforce complete payments

businessLogo

string: Required The logo of your business as url in string

onSuccess

(response) => { Void }: Required This is called when a transaction is successfully. It returns a response.

onError

(response) => { Void }: Required This is called when a transaction fails. It returns a response.

onClose

() => { Void }: Required This is called when a user clicks on the close button.

The Transaction JSON returned for successful events

{
  "event": "successful",
  "data": {
    "id": "12896b32-0d7d-4744-bc15-5960af40d519",
    "reference": "aa6KlHy88D",
    "acceptPartialPayment":true,
    "senderAddress": "0x0B4d358D349809037003F96A3593ff9015E89efA",
    "recipientAddress": "0x785F44E779cfEeDeBf7aA7CFde19DaA3312fd19e",
    "actualAmount": 10,
    "amountPaid": 10,
    "fiatAmount": 10,
    "coin": "BUSD",
    "currency": "USD",
    "hash": "0x6782d7b046d53e90dc0337c895252f210386c2a471c5025c953a0b1d9gb47937",
    "blockNumber": 14160564,
    "type": "received",
    "status": "confirmed",
    "network": "mainnet",
    "blockchain": "Binance Smart Chain",
    "customer": {
      "id": "b847dbbd-e5a4-4afc-ba26-b292707dc391",
      "customerName": "John Oseni",
      "customerEmail": "[email protected]",
      "customerPhone": null,
      "network": "mainnet"
    }
  }
}

Support

If you're having trouble with Webitspay React Native SDK or your integration, please reach out to WebitsPay at [email protected] or come chat with us on Slack. We're more than happy to help you out.

License

MIT

Usage

import { usewebitpay } from 'webitspay-react'

const metadata = {
  'product name': 'Cornflakes and Milk',
  'Product Owner': 'Prisca Onye'
}

const App = () => {
  config = {
    publicKey: 'PUBLIC_KEY',
    customerName: 'CUSTOMERS FULL NAME',
    customerEmail: 'CUSTOMER EMAIL',
    currency: 'CURRENCY', // USD, NGN, AED, GBP, EUR
    amount: '10', // amount as a number or string
    reference: 'XUASO90120', // unique identifier
    acceptPartialPayment: true,
    metadata, // metadata (optional) is an object of information you wish to pass
    onSuccess: (response) => {
      // handle response here
    },
    onClose: () => {
      //handle response here
    },
    onError: (response) => {
      // handle responsne here
    }
  }

  const initializePayment = useWebitspay(config)

  return (
    <div>
      <h1>Webitspay React test App</h1>
      <button onClick={initializePayment}>Pay with Webitspay</button>
    </div>
  )
}