← All packages

@lacspace/connectips

v1.1.0Nepal Payments0 deps

Connect IPS (Nepal) merchant integration over Web Crypto — RSA-SHA256-sign the redirect token, build or send the validate-txn request, verify signatures, and validate/inspect the canonical message fields offline. Zero-dep, isomorphic.

npm i @lacspace/connectips

Usage

connectips.ts
import { signToken, buildForm, validateTxn } from "@lacspace/connectips";

// sign the redirect token with your RSA (PKCS#8) private key
const token = await signToken(
  { merchantId, appId, appName, txnId, txnDate, txnAmount, referenceId, remarks },
  privateKeyPkcs8Pem,
);
const form = buildForm({ /* merchant fields + token */ }); // POST to Connect IPS

// confirm server-to-server
const ok = await validateTxn({ merchantId, appId, referenceId, txnAmount }, credentials);

Exports 4

signTokenbuildFormvalidateTxnverifyToken

Keywords

connectipsnepalpaymentnchlrsa-sha256web-crypto

More in Nepal Payments