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

@classytic/revenue-manual

v0.2.2

Published

Manual payment provider for @classytic/revenue - Reference implementation

Readme

@classytic/revenue-manual

Manual Payment Provider for @classytic/revenue

Perfect for any payment method without API integration: cash, bank transfer, mobile money (bKash, M-Pesa, UPI), wire transfer, etc.

Installation

npm install @classytic/revenue @classytic/revenue-manual

Usage

import { Revenue } from '@classytic/revenue';
import { ManualProvider } from '@classytic/revenue-manual';

const revenue = Revenue
  .create({ defaultCurrency: 'USD' })
  .withModels({ Transaction, Subscription })
  .withProvider('manual', new ManualProvider())
  .build();

// Create payment with custom instructions
const { transaction, paymentIntent } = await revenue.monetization.create({
  data: { customerId: user._id },
  planKey: 'monthly',
  amount: 2999,
  gateway: 'manual',
  metadata: {
    paymentInstructions: `
      Send payment to:
      bKash: 01712345678
      Reference: ${user.name}
    `,
  },
});

console.log(paymentIntent.instructions);
// Your custom instructions

// Admin verifies payment
await revenue.payments.verify(transaction._id, {
  verifiedBy: adminId,
});

Payment Info (Auto-formatted)

const { paymentIntent } = await revenue.monetization.create({
  data: { customerId: user._id },
  amount: 9999,
  gateway: 'manual',
  metadata: {
    paymentInfo: {
      method: 'bKash',
      number: '01712345678',
      type: 'Personal',
      note: 'Use your name as reference',
    },
  },
});

console.log(paymentIntent.instructions);
// Payment Amount: 99.99 USD
//
// method: bKash
// number: 01712345678
// type: Personal
// note: Use your name as reference

Examples

bKash (Bangladesh)

metadata: {
  paymentInfo: {
    method: 'bKash',
    number: '01712345678',
    type: 'Personal',
  },
}

UPI (India)

metadata: {
  paymentInfo: {
    method: 'UPI',
    upiId: 'merchant@paytm',
  },
}

M-Pesa (Kenya)

metadata: {
  paymentInfo: {
    method: 'M-Pesa',
    businessNumber: '123456',
    accountNumber: 'ABC123',
  },
}

Bank Transfer

metadata: {
  paymentInstructions: `
    Bank: XYZ Bank
    Account: 123-456-789
    SWIFT: XYZBUS33
    Reference: ORDER-${orderId}
  `,
}

Capabilities

const manual = new ManualProvider();
manual.getCapabilities();
// {
//   supportsWebhooks: false,
//   supportsRefunds: true,
//   supportsPartialRefunds: true,
//   requiresManualVerification: true,
// }

Verification Flow

// 1. Customer creates payment
const { transaction } = await revenue.monetization.create({
  data: { customerId },
  amount: 1500,
  gateway: 'manual',
});
// transaction.status === 'pending'

// 2. Customer pays outside the system (cash, bank, etc.)

// 3. Admin verifies payment received
await revenue.payments.verify(transaction._id, {
  verifiedBy: adminUserId,
});
// transaction.status === 'verified'

Refunds

// Full refund
await revenue.payments.refund(transaction._id);

// Partial refund
await revenue.payments.refund(transaction._id, 500, {
  reason: 'Partial return',
});

TypeScript

Full TypeScript support:

import { ManualProvider } from '@classytic/revenue-manual';
import type { ManualProviderConfig, ManualRefundOptions } from '@classytic/revenue-manual';

const provider = new ManualProvider({
  // Custom config if needed
});

Building Custom Providers

Use ManualProvider as a reference for building your own:

import {
  PaymentProvider,
  PaymentIntent,
  PaymentResult,
  RefundResult,
  WebhookEvent,
} from '@classytic/revenue';
import type { CreateIntentParams, ProviderCapabilities } from '@classytic/revenue';

export class MyProvider extends PaymentProvider {
  public override readonly name = 'my-provider';

  constructor(config: MyConfig) {
    super(config);
  }

  async createIntent(params: CreateIntentParams): Promise<PaymentIntent> {
    // Your implementation
  }

  async verifyPayment(intentId: string): Promise<PaymentResult> {
    // Your implementation
  }

  async getStatus(intentId: string): Promise<PaymentResult> {
    // Your implementation
  }

  async refund(paymentId: string, amount?: number | null): Promise<RefundResult> {
    // Your implementation
  }

  async handleWebhook(payload: unknown, headers?: Record<string, string>): Promise<WebhookEvent> {
    // Your implementation
  }

  override getCapabilities(): ProviderCapabilities {
    return {
      supportsWebhooks: false,
      supportsRefunds: true,
      supportsPartialRefunds: true,
      requiresManualVerification: true,
    };
  }
}

Links

License

MIT © Classytic