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

@toluade/squad-pay-react

v1.1.3

Published

<p align="center"> <img title="Squad" height="200" src="https://squadco.com/assets/squadbyhabari.svg" width="50%"/> </p>

Downloads

29

Readme

Squad Pay React

NPM JavaScript Style Guide

Integrate Squad Payment Modal with your react app.

Introduction

Introducing "Squad Pay": Your Gateway to Effortless Payment Integration in React!

Elevate your React application's payment capabilities with Squad Pay – the ultimate solution for crafting a seamless payment journey within your mobile or web app. With Squad Pay, you're empowered to effortlessly integrate the Squad Payment Modal into your application, unlocking a world of hassle-free transactions for your users.

Say goodbye to the complexities of payment integration – Squad Pay streamlines the process, allowing you to start accepting payments in record time. Whether you're a seasoned developer or diving into the world of React for the first time, Squad Pay simplifies the integration process, ensuring a smooth and intuitive experience every step of the way.

Key Features

  • Versatile Payment Options: Enable transactions with ease using a variety of payment methods, including Card, Bank Account, Bank Transfers, and USSD. With Squad Pay, flexibility is at your fingertips, catering to the diverse needs of your users.

See more information on the Squad Docs

Experience the power of SquadPay today and revolutionize the way you handle payments in your React applications. Seamlessly blend cutting-edge technology with user-centric design, and embark on a journey towards unparalleled payment excellence with SquadPay.

Table of Contents

  1. Installation
  2. Usage
  3. License

Installation

npm

npm i @toluade/squad-pay-react --save

yarn

yarn add @toluade/squad-pay-react

Usage

You can add Squad Pay to your projects as a react hook or as a context provider and use the context in components under the provider tree:

useSquadPay

Note: The useSquadPay hook can take in all the parameter (such as currency_code, redirect_url, etc) passed in the squadPay function except amount and email.

import { useSquadPay } from "@toluade/squad-pay-react";

const publicKey = env_variable;

const App = () => {
  const squadPay = useSquadPay({
    publicKey,
  });

  const pay = () => {
    squadPay({
      amount: 500,
      email: "[email protected]",
      currency_code: "NGN",
      redirect_link: "https://squadco.com",
    });
  };

  return <button onClick={pay}>Make Payment</button>;
};

export default App;

SquadProvider

Note: The SquadProvider can take in all the parameter (such as currency_code, redirect_url, etc) passed in the squadPay function except amount and email.

import { SquadProvider } from "@toluade/squad-pay-react";
import PaymentPage from "./PaymentPage";

const publicKey = env_variable;

const App = () => {
  return (
    <SquadProvider publicKey={publicKey}>
      <PaymentPage />
    </SquadProvider>
  );
};

export default App;
import { useSquadContext } from "@toluade/squad-pay-react";

const PaymentPage = () => {
  const { squadPay } = useSquadContext();

  const pay = () => {
    squadPay({
      amount: 500,
      email: "[email protected]",
      currency_code: "NGN",
      redirect_link: "https://squadco.com",
    });
  };

  return (
    <div>
      <p>Kindly click on the button below to make your payment</p>
      <button onClick={pay}>Make Payment</button>
    </div>
  );
};

export default PaymentPage;

Parameters

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

| Parameter | Required | Description | | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | publicKey | True | Your API public key | | amount | True | Amount to charge the customer. | | currency_code | False | currency to charge in. Defaults to NGN | | redirect_url | False | URL to redirect to when a transaction is completed. This is useful for redirecting your customer back to a custom page you want to show them. | | onLoad (function) | False | This is a callback for when the payment widget loads. | | onClose (function) | False | This is a callback for when the payment widget closes. | | onSuccess (function) | False | This is a callback for when payment is successful. |

License

MIT © Toluade