satispay-business
v0.1.0-next.3
Published
Node.js library for the Satispay Business API.
Readme
Satispay Business Node.js SDK
Node.js library for the Satispay Business API.
Install
npm install satispay-business
# or
yarn add satispay-business
# or
pnpm add satispay-business
# or
bun install satispay-businessSetup
Generate a key pair
openssl genrsa -out private.pem 4096
openssl rsa -in private.pem -outform PEM -pubout -out public.pemimport { Satispay } from "satispay-business";
const satispay = new Satispay({
privateKey: "base64-encoded-private-key",
keyId: "key-id",
});Usage
Consumers
Get consumer
const consumer = await satispay.consumer.get("+393331234567");Payments
Create payment
await satispay.payment.create({
amount_unit: 10 * 100,
currency: "EUR",
flow: "MATCH_CODE",
redirect_url: "https://example.com/redirect",
callbackUrl: "https://example.com/webkook?payment_id={uuid}",
});Get payment
const payment = await satispay.payment.get("payment-id");