Logo Lanfrica

akira-io/node-sisp

Domaine:

digital infrastructure

Type de record:

software
Créateur:
aki
Hôte:
SISP/Vinti4 (Cabo Verde) payment gateway client for Node.js > [!WARNING] > Beta software. The API may change before `1.0.0`. Install with the `beta` tag: `npm install @akira-io/sisp@beta`. Pin an exact version in production and review the changelog before upgrading. Framework-agnostic Node.js client for the SISP/Vinti4 payment gateway (Cabo Verde), ported from akira-io/laravel-sisp. Signed payment requests, callback validation, refunds, retries, reconciliation, a local sandbox gateway, and thin adapters for Express, Fastify, and NestJS, with byte-for-byte fingerprint parity against the PHP implementation. The bundled database schema is optional: run stateless against your own transaction tables, or let the package persist everything for you. ## Install ```sh # npm npm install @akira-io/sisp # pnpm pnpm add @akira-io/sisp # yarn yarn add @akira-io/sisp # bun bun add @akira-io/sisp ``` Add the database driver you use (`better-sqlite3`, `pg`, or `mysql2`) and the framework peer for the HTTP routes. Fastify is the default adapter; Express and NestJS are supported as well. All of them are optional peer dependencies. ```json { "dependencies": { "@akira-io/sisp": "^0.1", "@fastify/formbody": "^8", "better-sqlite3": "^12", "fastify": "^5" } } ``` ## Quick start ```ts import { createSisp } from '@akira-io/sisp'; import { sispFastifyPlugin } from '@akira-io/sisp/fastify'; import Fastify from 'fastify'; const sisp = await createSisp({ posId: process.env.SISP_POS_ID, posAutCode: process.env.SISP_POS_AUT_CODE, url: process.env.SISP_URL, appKey: process.env.APP_KEY, baseUrl: 'app.example.cv', sandbox: true, database: { client: 'better-sqlite3', connection: { filename: './sisp.db' } }, }); const app = Fastify(); await app.register(sispFastifyPlugin, { sisp, prefix: '/sisp' }); sisp.on('payment:completed', ({ transaction }) => { fulfillOrder(transaction.merchant_ref, transaction.amount_cents); }); const request = sisp.payment().amount(1500).customerEmail('a@b.cv').build(); await sisp.refund(transaction).full().reason(' …