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 🙏

© 2026 – Pkg Stats / Ryan Hefner

modem-pay-cli

v0.0.9

Published

A CLI tool for managing Modem Pay webhooks and triggering events.

Readme

Modem Pay CLI

The Modem Pay CLI is a tool designed to simplify integration testing by offering features like authentication, webhook management, and event simulation in a test environment.

Installation

Ensure that both Node.js and npm are installed on your machine.

Install the Modem Pay CLI globally:

npm install -g modem-pay-cli

Commands

1. Login

Authenticate with your Modem Pay account to access CLI features.

modempay login

You'll be prompted to enter your Modem Pay email and password. Upon successful authentication, your credentials will be saved for subsequent commands.

2. Listen

Create a secure public tunnel to forward webhooks to your local endpoint, facilitating testing during development.

modempay listen --forward-url=http://localhost:3000/webhook

Replace http://localhost:3000/webhook with your local endpoint. This command will provide a public URL that forwards incoming webhooks to your specified local endpoint.

Note: The CLI uses Localtunnel to generate the public URL. In some cases, a public URL might not be provisioned successfully due to network issues. This feature should only be used in test environments.

3. Trigger

Simulate events to test your webhook handling.

modempay trigger <event-type>

Supported event types include:

  • Customer Events: customer.created, customer.updated, customer.deleted
  • Payment Intent Events: payment_intent.created, payment_intent.cancelled
  • Charge Events: charge.succeeded, charge.cancelled

For example, to simulate a successful charge:

modempay trigger charge.succeeded

This will send a charge.succeeded event payload to your configured webhook endpoint for testing.

Important: Always respond to webhook events with an HTTP 200 OK status to confirm receipt. This ensures Modem Pay recognizes that your server has successfully processed the event.

4. Transaction

You can use the transaction commands to create (initialize) and verify payments via the CLI.

Initialize a Payment

To start a new payment (payment intent), run:

modempay transaction init --amount=<number> [--email=<customer-email>]
  • --amount: Amount to request (required; must be a positive number).
  • --email: (Optional) Customer's email for associating the payment intent.

Example:

modempay transaction init --amount=120 [email protected]

On success, you'll see details like:

✅ Payment Intent Created Successfully!

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Payment Details
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Amount:         GMD 120
  Status:         REQUIRES PAYMENT METHOD
  Expires:        6/10/2025, 9:18:45 PM
  Intent ID:      b84ac35d-7a65....
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔗 Payment Link:
  https://test.checkout.modempay.com/make-payment/b84ac35d-7a65....

💡 Tip: Copy the link above to complete the payment

The Payment Link is where your customer should be sent to pay.

Verify a Payment

To check the status of a payment intent, use:

modempay transaction verify --id=<payment_intent_id>
  • --id: ID of the payment intent you wish to check.

Example:

modempay transaction verify --id=b84ac35d-7a65....

This returns output like:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Payment Details
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Amount:         GMD 120.50
  Status:         SUCCESSFUL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔗 Payment Link:
  https://test.checkout.modempay.com/make-payment/b84ac35d-7a65....

💡 Tip: Copy the link above to complete the payment

Note:

  • After a successful payment, the status will update (e.g., to SUCCESSFUL).
  • If you forget your payment intent ID, you can find it in the CLI output from init or your Modem Pay Dashboard.

Documentation

For detailed information on setting up and handling webhooks, please refer to the Modem Pay Webhooks Documentation.