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

tc-payment

v1.0.5

Published

A payment gateway library for TC Payment

Readme

TC Payment SDK

A payment gateway library for TC Payment, providing a clean TypeScript interface to interact with various payment and billing APIs.

Installation

npm install tc-payment
# or
yarn add tc-payment
# or
pnpm add tc-payment

Initialization

First, initialize the TCPaymentSDK with your configuration:

import { TCPaymentSDK } from 'tc-payment';

const sdk = new TCPaymentSDK({
  baseUrl: 'https://api.your-payment-domain.com', // Replace with actual base URL
  apiKey: 'your-api-key', // Optional: API Key for authentication. Sets the `x-admin-service-api-token` header.
  timeout: 10000, // Optional: Request timeout in milliseconds (default: 10000)
});

Usage & Modules

Once the SDK is initialized, you can access the various modules. Below is a detailed mapping of the available APIs and how to use them.

1. Checkout (sdk.checkout)

Handles payment checkout sessions and subscription lifecycle events.

  • Create a Checkout Session

    const session = await sdk.checkout.createSession({
      // e.g. priceId, successUrl, cancelUrl, customerId, etc.
    });
  • Update a Subscription

    const updatedSubscription = await sdk.checkout.updateSubscription({
      // your UpdateSubscriptionDto fields
    });

2. Connect (sdk.connect)

Manage connected accounts, onboarding links, and retrieve balances.

  • Create a Connect Account

    const account = await sdk.connect.createAccount({
      // your CreateConnectAccountInput fields
    });
  • Create an Onboarding Link

    const link = await sdk.connect.createOnboardingLink({
      // your CreateOnboardingLinkInput fields
    });
  • Get Account Balance

    const balance = await sdk.connect.getBalance({
      // e.g. { accountId: 'acct_123' }
    });
  • Retrieve an Account

    const accountDetails = await sdk.connect.retrieveAccount({
      // e.g. { accountId: 'acct_123' }
    });
  • Delete an Account

    const result = await sdk.connect.deleteAccount({
      // e.g. { accountId: 'acct_123' }
    });

3. Billing (sdk.billing)

Manage billing experiences like self-serve customer portals.

  • Create a Portal Session
    const portalSession = await sdk.billing.createPortalSession({
      // your CreateBillingPortalSessionInput fields
    });

4. Customer (sdk.customer)

Manage platform customers.

  • Create a Customer
    const customer = await sdk.customer.create({
      // your CreateCustomerInput fields
    });

5. Pricing (sdk.pricing)

Retrieve pricing and plan information from the backend.

  • Retrieve a Price
    const price = await sdk.pricing.retrievePrice({
      // your RetrievePriceInput fields
    });

Development

# Install dependencies
npm install

# Build the SDK
npm run build

# Run in watch mode for development
npm run dev

License

ISC