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

@airondev/paystack-cli

v1.0.2

Published

Set up, test, and manage your paystackcli integration directly from the terminal.

Downloads

3

Readme

dev-cli

Paystack Logo

The Paystack CLI helps you build, test, and manage your Paystack integration right from the terminal.

With the Paystack CLI, you can:

Securely test webhooks without relying on third-party tunneling software Trigger webhook events to easily test your integration Create, retrieve, update, and delete API objects Clone real life sample applications with fully integrated payment channels.

And of course the Paystack CLI is open source with a public repository on GitHub. Contributions, features, sample apps from developers are encouraged.

Installation

Paystack requires Node.js v12+ to run.

Install the dependencies and devDependencies and start the instance.

$ npm install -g @airondev/paystack-cli
$ paystackcli
$ login

Get started

API

Paystack CLI allows you to make API calls to the Paystack API right from the terminal, for example to initialize a transaction, run

$ transaction initialize --amount 1000 --email [email protected]

The terminal's output would look like this

authorization_url - - - -- - -- - - - - - -  - - - -  - https://checkout.paystack.com/9wvzhxlk66uylzp
access_code - - - -- - -- - - - - - -  - - - -  - 9wvzhxlk66uylzp
reference - - - -- - -- - - - - - -  - - - -  - se8b1ty80b

Another example

$ transaction verify --reference T394541625653843 --domain live

output

id - - - -- - -- - - - - - -  - - - -  - 521587687
domain - - - -- - -- - - - - - -  - - - -  - live
status - - - -- - -- - - - - - -  - - - -  - success
reference - - - -- - -- - - - - - -  - - - -  - T394541625653843
amount - - - -- - -- - - - - - -  - - - -  - 100000
gateway_response - - - -- - -- - - - - - -  - - - -  - Approved
paid_at - - - -- - -- - - - - - -  - - - -  - 2020-02-27T17:28:14.000Z
created_at - - - -- - -- - - - - - -  - - - -  - 2020-02-27T17:27:31.000Z
channel - - - -- - -- - - - - - -  - - - -  - card
currency - - - -- - -- - - - - - -  - - - -  - NGN
ip_address - - - -- - -- - - - - - -  - - - -  - 102.67.15.8
fees - - - -- - -- - - - - - -  - - - -  - 1500
plan - - - -- - -- - - - - - -  - - - -  - PLN_q34mm97ac7pnqj1
paidAt - - - -- - -- - - - - - -  - - - -  - 2020-02-27T17:28:14.000Z
createdAt - - - -- - -- - - - - - -  - - - -  - 2020-02-27T17:27:31.000Z
requested_amount - - - -- - -- - - - - - -  - - - -  - 100000
transaction_date - - - -- - -- - - - - - -  - - - -  - 2020-02-27T17:27:31.000Z

Webhook

You can tunnel Paystack webhook events directly to your localhost without any third party software directly from your terminal

 $ webhook listen localhost:8995/pay/pstk-webhook?country=ng

output

> Tunelling webhook events to localhost:8995/pay/pstk-webhook?country=ng
> Webhook events would now be received at localhost:8995/pay/pstk-webhook?country=ng

NOTE - This command is only avalaible in test mode, and by using this command, the CLI would automatically make changes to the Test Webhook URL set on your Paystack dashboard.

You can also run an health check on your live/test webhook endpoint from your terminal

$ webhook ping --domain live

output

-  - - - - - - -  - - -  - - - -   - - - --  -- - - - - - - 
Sending sample charge.success event payload to https://paycash.pstk.xyz/pay/pstk-webhook?country=ng
401 - - Unauthorized
Unauthorized

Sample Apps

We have built different sample apps and embedded them in the CLI, you can setup a sample project in your terminal by running

$ sample sample-react "~/Desktop/Work"

By default, all commands are run in test mode, to switch to live, append the flag "--domain live" at the end of your command

License

MIT