Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paystack-simple

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paystack-simple

A Framework/Library agnostic paystack wrapper

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

paystack-simple

Paystack-simple bundle size MIT NPM Build Status

<1kb Framework/Library agnostic paystack wrapper

INSTALLATION

npm install paystack-simple

USAGE

Basic Usage

import Paystack from "paystack-simple";

const paymentInstance = Paystack();

paymentInstance.init() // Optional - Fetch paystack script

paymentInstance.addOptions({
  amount: 5000,
  key: 'pk-xxxxx-xxxxxx',
  email: 'cutomeremail@mail.com',
})

paymentInstance.addOptions({
  currency: 'NGN',
  callback: (res) => {
    // act on response
  }
})

paymentInstance.pay() // Pay

Embed

import Paystack from "paystack-simple";

const paymentInstance = Paystack();

paymentInstance.init() // Optional - Fetch paystack script

paymentInstance.addOptions({
  amount: 5000,
  key: 'pk-xxxxx-xxxxxx',
  email: 'cutomeremail@mail.com',
})

paymentInstance.addOptions({
  container: 'container-ID',
  callback: (res) => {
    // act on response
  }
})

paymentInstance.pay() // Pay

Set GlobalConfig

import Paystack, { setGlobalConfig } from "paystack-simple";

setGlobalConfig({ key: 'pk-test-xxxx-xxxx' }) // Key has been set globally

paymentInstance.addOptions({ // No need to add it here
  amount: 5000,
  email: 'cutomeremail@mail.com',
  callback: (res) => {
    // act on response
  }
})

paymentInstance.pay() // Pay

What's Cool?

  • Less than 1kb
  • Framework/Library agnostic
  • Simple API
  • Intellisense support

Keywords

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc