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

@tsdiapi/cardcom

v0.4.0

Published

A TSDIAPI plugin to extend API functionality with cardcom.

Readme

CardCom Plugin for TSDIAPI

A TSDIAPI plugin to integrate with CardCom payment gateway, allowing secure transactions, refunds, and tokenized payments.

📌 About

This TSDIAPI plugin provides a seamless way to interact with CardCom's API (v11), supporting transactions, refunds, card tokenization, and more.

🔗 TSDIAPI CLI: @tsdiapi/cli
🔗 CardCom API v11 Docs: CardCom API Documentation

This plugin is based on CardCom API v11, ensuring compatibility with the latest payment processing features and security standards.


📦 Installation

Install the plugin using the TSDIAPI CLI:

tsdiapi plugins add cardcom

Install the plugin using npm:

npm install --save @tsdiapi/cardcom

Then, register the plugin in your TSDIAPI project:

import { createApp } from "@tsdiapi/server";
import createPlugin from "@tsdiapi/cardcom";

createApp({
    plugins: [createPlugin()]
});

🚀 Features

  • 🔹 Payment Authorization – Securely authorize payments using tokens or card details.
  • 💰 Charge Payments – Capture pre-authorized payments.
  • 🔄 Refund Transactions – Partial and full refunds for transactions.
  • 🏦 Account Info – Retrieve information about a CardCom account.
  • 🔍 Transaction Queries – Fetch transaction details by ID or list by date range.
  • 💳 Tokenized Payments – Charge saved cards using secure tokens.
  • 🏗 Low Profile Transactions – Create and retrieve results of hosted payment pages.
  • Seamless Integration – Works with TSDIAPI for modular plugin-based architectures.

🔧 Configuration

This plugin requires API credentials and endpoint settings, which can be configured via environment variables.

createPlugin({
    apiUrl: "https://secure.cardcom.solutions/api/v11",
    terminalId: "123456",
    apiName: "your_api_name",
    apiPassword: "your_api_password",
    successRedirectUrl: "https://yourdomain.com/success",
    failedRedirectUrl: "https://yourdomain.com/fail",
    webHookUrl: "https://yourdomain.com/webhook"
});

| Option | Type | Required | Default | Description | |------------------------|---------|----------|---------|-------------| | apiUrl | string | ✅ | "" | Base URL for the CardCom API | | terminalId | string | ✅ | "" | Terminal ID for authentication | | apiName | string | ✅ | "" | API username for authentication | | apiPassword | string | ✅ | "" | API password for authentication | | successRedirectUrl | string | ✅ | "" | Redirect URL after successful payment | | failedRedirectUrl | string | ✅ | "" | Redirect URL after failed payment | | webHookUrl | string | ✅ | "" | Webhook URL for payment notifications |

Alternatively, these values can be set in TSDIAPI app configuration:

this.config.apiUrl = this.config.apiUrl || appConfig["CARDCOM_API_URL"];
this.config.terminalId = this.config.terminalId || appConfig["CARDCOM_TERMINAL_ID"];
this.config.apiName = this.config.apiName || appConfig["CARDCOM_API_NAME"];
this.config.apiPassword = this.config.apiPassword || appConfig["CARDCOM_API_PASSWORD"];
this.config.successRedirectUrl = this.config.successRedirectUrl || appConfig["CARDCOM_SUCCESS_REDIRECT_URL"];
this.config.failedRedirectUrl = this.config.failedRedirectUrl || appConfig["CARDCOM_FAILED_REDIRECT_URL"];
this.config.webHookUrl = this.config.webHookUrl || appConfig["CARDCOM_WEBHOOK_URL"];

📌 How to Use

After installing and configuring the plugin, you can interact with CardCom API using useCardcomProvider().

1️⃣ Authorize a Payment

const cardcom = useCardcomProvider();
const response = await cardcom.authorizePayment(100, "your_card_token", "1225");
console.log(response);

2️⃣ Charge a Payment

const response = await cardcom.chargePayment(100, "your_card_token", "1225", "approval_number", {
    name: "John Doe",
    email: "[email protected]",
    mobile: "+972500000000",
    productDescription: "Premium Subscription"
});
console.log(response);

3️⃣ Refund a Transaction

const response = await cardcom.refundTransaction(123456, { PartialSum: 50 });
console.log(response);

4️⃣ List Transactions

const response = await cardcom.listTransactions("01012024", "31012024", 1, 10);
console.log(response);

5️⃣ Get Transaction Details

const response = await cardcom.getTransactionById(987654);
console.log(response);

6️⃣ Get Account Info

const response = await cardcom.getAccountInfoById(56789);
console.log(response);

7️⃣ Request a New Card Token

const response = await cardcom.requestNewCard('testId');
console.log(response);

8️⃣ Get Low Profile Transaction Result

const response = await cardcom.getLowProfileResult("low-profile-id");
console.log(response);

👨‍💻 Contributing

Contributions are welcome! If you have improvements or bug fixes, feel free to open a pull request.

📧 Contact: [email protected]

🚀 Happy coding with TSDIAPI & CardCom! 🎉