txsure
v0.1.0
Published
Human-in-the-loop payment infrastructure for TypeScript
Downloads
115
Maintainers
Readme
txSure
Human-in-the-loop payment infrastructure for TypeScript.
A TypeScript library that enables manual payment verification workflows. When automated verification isn't enough, txSure handles the entire manual approval process - from receiving payment details to notifying a human approver and processing their decision.
This is NOT a payment gateway or processor. It's infrastructure for businesses that need human verification of payments before fulfilling orders.
Supported Banks
- CBE (Commercial Bank of Ethiopia)
- Awash Bank
- Dashen Bank
- Abyssinia Bank
- Hibret Bank
- Zemen Bank
- Telebirr
- MPESA ET
Installation
npm install txsureUsage
import { createTXSure, BANK } from "txsure";
const tx = createTXsure({
adapter: prismaAdapter,
bot: telegramBot,
onVerificationRequest: async (tx) => {
console.log("New verification:", tx.id);
},
onDecision: async (decision) => {
console.log("Decision made:", decision.status);
},
});
await tx.requestVerification({
amount: 1000,
currency: "ETB",
bank: BANK.CBE,
senderName: "John Doe",
proofType: "tx_number",
proofValue: "TX123456",
});API
createTXsure(config)
Creates a TXsure instance with the following config:
adapter: Database adapter (implementsTXSureAdapter)bot: Notification bot (implementsTXSureBot)onVerificationRequest?: Callback when new verification is requestedonDecision?: Callback when a decision (approve/cancel) is made
Constants
TRANSACTION_STATUS- Status enum (PENDING, APPROVED, CANCELLED)BANK- Bank enumCURRENCY- Currency enum (ETB)PROOF_TYPE- Proof type enum (tx_number, screenshot)
License
MIT
