@curless/agentbank-merchant-sdk 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,17 +9,21 @@ and you get:
|
|
|
9
9
|
- **`checkout.openUCP`** — merchant-quoted **card** checkout over the **UCP** wire ([ucp.dev](https://ucp.dev)) — the UCP twin of `openACP` (same card settlement; reaches agents in the UCP ecosystem).
|
|
10
10
|
- **`checkout.openX402`** — merchant-quoted **USDC (x402)** checkout. You set the authoritative USDC amount; the gateway freezes it and returns the x402 challenge; a buyer agent signs an EIP-3009 authorization and pays `{ sessionId }` on-chain. Settlement is on Base (mainnet or Sepolia, decided by your account/key) — your USDC lands at your address. The stablecoin twin of `openACP`.
|
|
11
11
|
- **`orders`** — read your settled orders: `orders.list({ status, protocol, currency, from, to, limit, offset })` (filtered + paginated, with a total), `orders.get(id)` (one order in full + the card it was paid with), `orders.summary({…})` (count + gross by currency + breakdowns by protocol/status — a dashboard in one call).
|
|
12
|
-
- **`
|
|
12
|
+
- **`orders` refunds** — work the refund queue: `orders.listRefundRequests({ status })` (buyers' refund requests on your orders), `orders.approveRefund(id)` (approve → forwarded to Curless), `orders.rejectRefund(id, { note })`, and `orders.refund(orderId, { amount, reason })` (merchant-initiated direct refund, no buyer request). See **Refunds** below.
|
|
13
|
+
- **`AgentbankMerchant`** — typed client; also exposes `PaymentIntents` (create/get/capture/list/ledger-entries across ACP / x402 / AP2 / UCP / A2A), `PaymentLinks`, `Customers`, `BalanceTransactions`, and `WebhookEndpoints`. (`PaymentIntents` has no `refund()` — the refund flow lives on `orders`.)
|
|
13
14
|
- **`verifyWebhook` / `parseVerifiedWebhook`** — HMAC-SHA256 signature verification (Stripe-style `t=…,v1=…`), constant-time, **edge-safe** (Web Crypto, runs on Vercel Edge / Cloudflare Workers). Async — `await` them.
|
|
14
15
|
- **`x402`** — emit/parse payments yourself (`buildChallenge()`, `decodeXPaymentHeader()`) **plus zero-crypto-knowledge helpers**: `usdc(network)` (contract + EIP-712 domain + decimals — no hardcoded hex), `isMainnet/isTestnet(network)`, `explorerTxUrl(network, txHash)` (a basescan / sepolia.basescan receipt link), `formatUsdc(baseUnits)` (exact 6-dp string, no float drift).
|
|
15
16
|
|
|
16
17
|
agentbank never stores your catalog — the price you pass is authoritative, and you accept every agent-payment protocol with zero protocol code. One runtime dependency (`@curless/agentbank-core`). **Edge-safe** — Web Crypto only, no `node:` builtins. Node 18+.
|
|
17
18
|
|
|
18
|
-
> **Refunds**:
|
|
19
|
-
>
|
|
20
|
-
>
|
|
21
|
-
>
|
|
22
|
-
>
|
|
19
|
+
> **Refunds**: a buyer opens a refund request, or the merchant refunds directly
|
|
20
|
+
> via `orders.refund(orderId)`. The merchant works the queue with
|
|
21
|
+
> `orders.listRefundRequests` / `approveRefund` / `rejectRefund`. Approve forwards
|
|
22
|
+
> the refund to Curless (which holds the money and executes the card refund); the
|
|
23
|
+
> order flips to `refunded` / `partially_refunded` once Curless confirms via
|
|
24
|
+
> webhook. Read the resulting state via `orders.list({ status: 'refunded' })` or
|
|
25
|
+
> `paymentIntents.get()`. (agentbank never touches the rail directly — Curless
|
|
26
|
+
> originates the actual money movement.)
|
|
23
27
|
|
|
24
28
|
## Fast path — open a merchant-quoted checkout
|
|
25
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curless/agentbank-merchant-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Merchant-side SDK for agentbank — accept agent payments: open a merchant-quoted card (ACP / UCP) or USDC (x402) checkout you price, list/summarize orders, PaymentIntents, edge-safe webhook verification, and x402 helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|