← All packages

@lacspace/connectips

v1.0.0Nepal Payments0 deps

Connect IPS (Nepal) merchant integration over Web Crypto — sign the redirect transaction token with your RSA private key and validate transactions server-to-server. 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