Skip to content

feat: @agentaos/pay SDK - regulated stablecoin payments#7

Merged
PancheI merged 3 commits intomainfrom
feat/payment-sdk
Mar 17, 2026
Merged

feat: @agentaos/pay SDK - regulated stablecoin payments#7
PancheI merged 3 commits intomainfrom
feat/payment-sdk

Conversation

@PancheI
Copy link
Contributor

@PancheI PancheI commented Mar 17, 2026

Summary

New SDK package for accepting regulated stablecoin payments: @agentaos/pay

SDK (packages/pay/):

  • checkouts.create() - standalone or from payment link template
  • checkouts.list(), .retrieve(), .cancel()
  • paymentLinks.create(), .list(), .retrieve(), .cancel()
  • transactions.list() - unified inbound/outbound ledger
  • invoices.list(), .retrieve(), .void(), .downloadPdf(), .downloadStatement(), .exportCsv()
  • webhooks.verify() - HMAC-SHA256 signature verification
  • Zero dependencies, ESM only, Node.js 20+

Example (examples/pay-express-shop/):

  • Complete Express e-commerce integration
  • Checkout creation, webhook verification, order fulfillment, polling fallback

Usage

import { AgentaOS } from '@agentaos/pay';

const agentaos = new AgentaOS('sk_live_...');

const checkout = await agentaos.checkouts.create({
  amount: 49.99,
  currency: 'EUR',
  successUrl: 'https://shop.com/success',
  webhookUrl: 'https://shop.com/webhooks',
});

console.log(checkout.checkoutUrl);

Platform PR

Companion platform changes: https://github.com/AgentaOS/platform/pull/6

Test plan

  • npm install @agentaos/pay resolves
  • checkouts.create() returns checkoutUrl
  • webhooks.verify() correctly rejects invalid signatures
  • Express example runs end-to-end
  • Browser detection throws error
  • Invalid API key format throws error

PancheI added 3 commits March 17, 2026 12:19
New package: packages/pay/ (@agentaos/pay v0.2.1)

SDK:
- AgentaOS client with browser guard, API key validation
- checkouts: create, list, retrieve, cancel (standalone or from payment link)
- paymentLinks: create, list, retrieve, cancel
- transactions: list with direction/date filters
- invoices: list, retrieve, void, downloadPdf, downloadStatement, exportCsv
- webhooks: verify signatures (HMAC-SHA256, timing-safe)
- HTTP layer: retry on 5xx, 429 handling, timeout, idempotency keys
- Zero dependencies (native fetch + crypto)
- ESM only, Node.js 20+

Example:
- examples/pay-express-shop/ - complete Express e-commerce integration
@PancheI PancheI merged commit ffd4ed7 into main Mar 17, 2026
1 check passed
@PancheI PancheI deleted the feat/payment-sdk branch March 17, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant