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

paste-to-verify

v0.1.1

Published

Verify Ethiopian CBE & Telebirr payment receipts from a pasted SMS — no bank API, no manual review.

Readme

paste-to-verify

npm license node

Verify Ethiopian CBE and Telebirr payment receipts from a pasted SMS — no bank API keys, no manual review.

When a customer pays, they get an SMS containing a receipt link. This library takes that raw SMS, extracts the link, fetches the authoritative receipt page from the provider's own domain, parses it into a normalized transaction, and runs deterministic checks against what you expected.

npm install paste-to-verify
# CBE receipts additionally need a headless browser (optional peer dependency):
npm install playwright && npx playwright install chromium

Quickstart

import { parseReceipt, verifyTransaction } from 'paste-to-verify';

const transaction = await parseReceipt(pastedSms);

const result = verifyTransaction(transaction, {
  amount: 990, // the principal credited to the receiver
  receiverAccount: '1000212343981', // mask-aware match against e.g. "1****3981"
  maxAgeMinutes: 30,
});

result.verified; // boolean
result.failures; // [{ field, expected, actual, reason }]

transaction.amount is always the principal transferred to the receiver; fees, VAT, levies, totals and balance live under transaction.raw.

No SMS at hand? Start from the receipt link or the transaction id instead:

import { parseReceiptId, parseReceiptUrl } from 'paste-to-verify';

await parseReceiptUrl('https://transactioninfo.ethiotelecom.et/receipt/SAMPLE1234');
await parseReceiptId('telebirr', 'SAMPLE1234'); // CBE: pass the v2-… token from the link

Why a receipt page and not the SMS?

The SMS is easy to fabricate, so it is never trusted as the source of truth. It only supplies the receipt URL and fills fields the page omits — on any overlap the page value wins. Provider URLs are matched by hostname (exact domain or subdomain), so lookalike links in a crafted SMS are rejected.

Providers

| Provider | Host | Receipt page | Fetch strategy | | ------------ | --------------------------------- | -------------------- | ------------------------------------------------- | | Telebirr | transactioninfo.ethiotelecom.et | Server-rendered HTML | fetch + HTML parse (edge-friendly) | | CBE | *.cbe.com.et | JavaScript SPA | Headless browser render (Playwright), then scrape |

On runtimes without a browser (serverless, edge), inject your own renderer:

const transaction = await parseReceipt(sms, {
  render: async (url) => fetchRenderedHtmlSomehow(url), // e.g. a remote browser service
  timeoutMs: 10_000, // optional network-stage deadline (default 30s)
});

Errors

parseReceipt rejects only with typed errors carrying a stable code: URL_NOT_FOUND, PROVIDER_NOT_RECOGNIZED, RECEIPT_FETCH_FAILED, RECEIPT_PARSE_FAILED, BROWSER_UNAVAILABLE. Use the isPasteToVerifyError type guard. verifyTransaction is pure, synchronous and never throws.

import { isPasteToVerifyError } from 'paste-to-verify';

try {
  await parseReceipt(sms);
} catch (error) {
  if (isPasteToVerifyError(error)) console.error(error.code, error.message);
}

Documentation

Full guides — verification checks, error handling, serverless & edge deployment, adding a provider — live in the repository docs.

License

MIT © Biruk Worku