
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
cardknox-api-wrapper
Advanced tools
A Node.js wrapper for the Cardknox Gateway API, simplifying the implementation and integration of secure payment processing.
A comprehensive Node.js wrapper for the Cardknox Payment Gateway, allowing you to securely process credit card and ACH transactions.
The Cardknox API Wrapper for Node.js simplifies integration with the Cardknox Payment Gateway, allowing you to process credit card and ACH transactions securely. This package includes pre-built request classes for various transaction types like sales, refunds, and voids, making payment processing fast and reliable.
Install via npm:
npm install cardknox-api-wrapper
To get started, you'll need your Cardknox API key. This key will be added to all your requests.
Here’s how to generate an API key:
Now, initialize CardknoxService
:
import { CardknoxService } from 'cardknox-api-wrapper';
const cardknox = new CardknoxService('your-api-key', 'your-software-name', 'your-software-version');
import { CCSaleRequest } from 'cardknox-api-wrapper';
async function processCreditCardSale() {
try {
const saleRequest = new CCSaleRequest();
saleRequest.xCardNum = '4111111111111111'; // Card number
saleRequest.xExp = '1225'; // Expiration date (MMYY)
saleRequest.xAmount = '50.00'; // Transaction amount
const response = await cardknox.Process(saleRequest);
if (response.xResult === 'A') {
console.log('Payment Approved:', response.xAuthCode);
} else {
console.log('Payment Failed:', response.xError || response.xErrorCode);
}
} catch (error) {
console.error('Transaction Error:', error);
}
}
processCreditCardSale();
For ACH payments, make sure to include the xName
field along with routing and account numbers.
import { CheckSaleRequest } from 'cardknox-api-wrapper';
async function processACHPayment() {
try {
const achRequest = new CheckSaleRequest();
achRequest.xRouting = '123456789'; // Routing number
achRequest.xAccount = '987654321'; // Account number
achRequest.xAmount = '100.00'; // Amount in USD
achRequest.xName = 'John Doe'; // Name of the account holder
const response = await cardknox.Process(achRequest);
if (response.xResult === 'A') {
console.log('ACH Payment Approved:', response.xAuthCode);
} else {
console.log('Payment Failed:', response.xError);
}
} catch (error) {
console.error('Transaction Error:', error);
}
}
processACHPayment();
The wrapper provides multiple request classes to cover various types of transactions. Below are the key requests available:
Each request class corresponds to a specific transaction type, ensuring that the right fields are included based on the transaction requirements.
The Cardknox API returns a CardknoxResponse
object that includes important fields like xResult
to indicate the status of the transaction:
Here's how to handle the transaction response:
if (response.xResult === 'A') {
console.log('Transaction Approved');
} else {
console.log('Transaction Failed:', response.xError);
}
For full details on the fields, commands, and additional transaction types, check out the official Cardknox documentation:
Contributions are welcome! If you would like to contribute, feel free to open a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.
FAQs
A Node.js wrapper for the Cardknox Gateway API, simplifying the implementation and integration of secure payment processing.
The npm package cardknox-api-wrapper receives a total of 0 weekly downloads. As such, cardknox-api-wrapper popularity was classified as not popular.
We found that cardknox-api-wrapper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.