@siglume/direct-request-payment 0.4.11 → 0.4.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.13 - 2026-06-19
4
+
5
+ Seller-borne Micro / Nano protocol fee correction.
6
+
7
+ - Added `provider_usage_amount_minor` to provider usage events so provider usage
8
+ amount and provider receivable can be reconciled separately.
9
+ - Clarified that all SDRP payment fees are seller-borne: Micro / Nano protocol
10
+ fees are deducted from provider receivable and are not added to buyer debit.
11
+ - Updated metered statement formulas, CSV documentation, and API reference amount
12
+ names to match the seller-borne settlement model.
13
+
14
+ ## 0.4.12 - 2026-06-19
15
+
16
+ Documentation-only fee-unit correction.
17
+
18
+ - Unified Micro and Nano protocol fee units as `/ SDRP Tx`.
19
+ - Clarified that `Tx` means one accepted SDRP payment, not the later on-chain
20
+ settlement transaction.
21
+
3
22
  ## 0.4.11 - 2026-06-19
4
23
 
5
24
  Documentation-only pricing correction.
@@ -20,9 +39,9 @@ Public beta scope and metered usage hardening patch.
20
39
  - Clarified that the current public beta supports JPYC / USDC settlement on
21
40
  Polygon PoS only and does not support multi-chain, cross-chain, or
22
41
  multi-wallet settlement routing through the public SDK.
23
- - Clarified that Standard Payment fees are deducted from merchant settlement,
24
- while Micro / Nano protocol fees are added to buyer debit and are not provider
25
- revenue.
42
+ - Clarified Standard Payment fee deduction and Micro / Nano fee reporting. The
43
+ Micro / Nano fee-burden wording from that release was superseded by the
44
+ seller-borne correction in 0.4.13.
26
45
 
27
46
  ## 0.4.9 - 2026-06-19
28
47
 
@@ -128,7 +147,7 @@ public capability is now documented and every signature verified against code.
128
147
  `buildPreparedTransactionExecutionPayload`, and `computeWebhookSignature` (plus
129
148
  full per-function webhook-verification entries with examples).
130
149
  - Added an **Exported Constants** table (all 8 importable constants with values)
131
- and an **Aliases** table (the `external_402*` legacy aliases → preferred
150
+ and an **Aliases** table (the `external_402*` legacy aliases ↁEpreferred
132
151
  `DirectRequestPayment*` names).
133
152
  - Replaced the "Python uses snake_case" hand-wave with the **actual Python
134
153
  keyword-only signatures** for the challenge / webhook / signature verifiers.
@@ -167,7 +186,7 @@ and humans pay through a Siglume-hosted checkout page.
167
186
  challenge server-side and returns a `checkout_url`; redirect the shopper there.
168
187
  The shopper logs into Siglume, approves, and pays from their own Siglume wallet
169
188
  (JPYC / USDC), then returns to your `success_url`. Fulfill on the existing
170
- `direct_payment.confirmed` webhook — the source of truth — exactly as with the
189
+ `direct_payment.confirmed` webhook  Ethe source of truth  Eexactly as with the
171
190
  agent flow. The merchant SDK still does not authenticate the buyer.
172
191
  - **`getCheckoutSession(session_id)`** (TS + Py): read a session's status
173
192
  (`open` / `authenticated` / `paid` / `expired` / `cancelled` / `failed`).
@@ -178,7 +197,7 @@ and humans pay through a Siglume-hosted checkout page.
178
197
  - Docs: documented the **two buyer systems** (human Web = Hosted Checkout; AI
179
198
  agent / AtoA = direct API / tools), the AtoA **prerequisite** that the buyer
180
199
  agent is pre-connected to Siglume (MCP/OAuth, or a custom app holding the
181
- buyer's Siglume JWT), and the merchant / Siglume / buyer **boundaries**
200
+ buyer's Siglume JWT), and the merchant / Siglume / buyer **boundaries**  E
182
201
  including that the buyer needs a Siglume wallet and this is **not** a card
183
202
  payment.
184
203
 
@@ -195,7 +214,7 @@ challenges and clients from 0.3.x interoperate unchanged.
195
214
  pricing guide: Micro settles weekly, Nano settles monthly, with the closing
196
215
  period, timezone, revenue-recognition point, retry / carry-over, and
197
216
  rejected / no-charge behavior spelled out. The exact close time, default
198
- timezone, and settlement lag are marked platform-managed — the platform
217
+ timezone, and settlement lag are marked platform-managed  Ethe platform
199
218
  response is the source of truth.
200
219
  - Clarified that Micro / Nano provider revenue stays unsettled until the weekly /
201
220
  monthly on-chain settlement succeeds, that failed settlements are retried and
@@ -218,8 +237,8 @@ challenges and clients from 0.3.x interoperate unchanged.
218
237
 
219
238
  ## 0.3.4 - 2026-06-18
220
239
 
221
- - Docs: clarified the SDRP pricing structure — a Standard plan is selected, and
222
- Micro / Nano are applied automatically by amount — across the README and
240
+ - Docs: clarified the SDRP pricing structure  Ea Standard plan is selected, and
241
+ Micro / Nano are applied automatically by amount  Eacross the README and
223
242
  pricing guide.
224
243
 
225
244
  ## 0.3.3 - 2026-06-18
@@ -237,7 +256,7 @@ challenges and clients from 0.3.x interoperate unchanged.
237
256
  tag, not a once-per-day run limit. Siglume no longer caps scheduled autopay
238
257
  at one charge per day; occurrences are bounded by the buyer's per-run,
239
258
  daily, and monthly auto-pay budget plus the authorization's `max_runs` /
240
- expiry. No code or wire-format changes — challenges signed by 0.3.0 verify
259
+ expiry. No code or wire-format changes  Echallenges signed by 0.3.0 verify
241
260
  unchanged.
242
261
  - Release automation now uses npm and PyPI Trusted Publishing from GitHub
243
262
  Actions, so normal releases do not require local npm OTP or PyPI credentials.
@@ -261,7 +280,7 @@ Recurring payment approval release.
261
280
  - Documented the recurring payment flow (subscription and scheduled autopay)
262
281
  in the README.
263
282
  - Updated pricing docs: the Launch plan's free monthly allowance of 100
264
- payments is retired — Launch is now a flat 1.8% payment fee; the per-payment
283
+ payments is retired  ELaunch is now a flat 1.8% payment fee; the per-payment
265
284
  minimum fee is JPY 30 (USD merchants: USD 0.20); JPY/JPYC and USD/USDC
266
285
  settlement are both documented as first-class.
267
286
 
package/README.md CHANGED
@@ -10,6 +10,17 @@ that want to accept Siglume wallet payments. The merchant fixes the order,
10
10
  amount, and currency on its server; the buyer pays with a Siglume wallet;
11
11
  Siglume applies the correct pricing and settlement path from the payment amount.
12
12
 
13
+ **Relationship to HTTP 402.** SDRP is built around the HTTP **402 Payment
14
+ Required** status: the Siglume platform returns **402 Payment Required** when a
15
+ payment is required but not yet completed (for example, attempting to consume a
16
+ payment requirement before it is confirmed). SDRP is **not wire-compatible with
17
+ Coinbase's x402** — the challenge and payment-payload design is different. SDRP
18
+ binds a signed `scheme:nonce:signature` challenge to the merchant, amount, and
19
+ currency, settles through a Siglume wallet (JPYC / USDC), and confirms via a
20
+ signed webhook; it does **not** use x402's HTTP-header payment payload or its
21
+ single-request pay-and-retry handshake. The internal mode name `external_402`
22
+ reflects this 402 lineage.
23
+
13
24
  Use this package when an external EC site, booking service, membership service,
14
25
  or paid API wants to accept Siglume wallet payments without taking custody of
15
26
  customer funds. The SDK creates and verifies one-time and recurring wallet
@@ -188,16 +199,23 @@ setup, and after that the applied fee and the settlement timing follow the
188
199
  - **Standard Payment** — most payments. Your selected plan's percentage fee,
189
200
  settled on-chain immediately after each payment confirms.
190
201
  - **Micro Payment** — small payments, applied automatically by amount. A flat
191
- per-transaction protocol fee, **settled weekly**.
202
+ per-SDRP-Tx protocol fee, settled weekly or earlier when the buyer/payee
203
+ batch reaches JPY 10,000 / USD 100.00.
192
204
  - **Nano Payment** — very small payments, applied automatically by amount. A
193
- flat per-usage protocol fee, **settled monthly**.
205
+ flat per-SDRP-Tx protocol fee, settled monthly or earlier when the buyer/payee
206
+ batch reaches JPY 10,000 / USD 100.00.
207
+
208
+ Here, `Tx` means one accepted SDRP payment, not the later on-chain settlement
209
+ transaction. Micro / Nano settlement batches are aggregated on-chain after the
210
+ weekly or monthly close, or earlier when the fixed amount threshold is reached.
194
211
 
195
212
  Micro Payment and Nano Payment are not separate products you opt into; they are
196
213
  amount bands Siglume applies on your behalf. Your integration code is the same
197
214
  regardless of which band a payment falls into. The full fee table and the exact
198
- weekly / monthly settlement schedule are in [docs/pricing.md](./docs/pricing.md).
215
+ weekly / monthly settlement schedule plus early threshold settlement rule are in
216
+ [docs/pricing.md](./docs/pricing.md).
199
217
  Provider revenue in the Micro and Nano bands is not settled revenue until the
200
- weekly or monthly on-chain settlement succeeds. Siglume keeps outstanding failed
218
+ aggregated on-chain settlement succeeds. Siglume keeps outstanding failed
201
219
  settlements for retry under the published policy, but does not advance or
202
220
  guarantee provider revenue before settlement succeeds. Merchant setup and the
203
221
  billing mandate terms assume the merchant accepts this Micro / Nano delayed
@@ -211,10 +229,11 @@ Sub-minor-unit Nano fees are accumulated with decimal precision and rounded only
211
229
  when a settlement batch is created; see [Pricing](./docs/pricing.md) for the
212
230
  rounding formula and `rounding_delta_minor` semantics.
213
231
  For low-count Nano batches, integer-token settlement can make the effective
214
- buyer burden per usage higher than the headline USD 0.001 protocol fee; the
215
- difference is reported as batch `rounding_delta_minor`. Treat Micro / Nano
216
- minor amounts as decimal strings and use a decimal library or `Decimal` for
217
- accounting.
232
+ rounded debit per SDRP Tx higher than the decimal provider usage amount; the
233
+ difference is reported as batch `rounding_delta_minor`. Micro / Nano protocol
234
+ fees are provider-borne and are not added to the buyer debit. Treat Micro /
235
+ Nano minor amounts as decimal strings and use a decimal library or `Decimal`
236
+ for accounting.
218
237
  For operational reconciliation, expected revenue, settled revenue, retry state,
219
238
  and CSV exports, see
220
239
  [docs/metered-statements.md](./docs/metered-statements.md).
@@ -264,8 +283,11 @@ amounts differ.
264
283
  | Public one-time payment amount | Applied automatically | What you select | Fee | Settlement |
265
284
  | --- | --- | --- | --- | --- |
266
285
  | JPY 501+ / USD 3.01+ | Standard Payment | Select one Standard plan: Launch, Starter, Growth, or Pro | Launch: JPY 0 / USD 0 monthly, 1.8%; Starter: JPY 980 / USD 6 monthly, 1.0%; Growth: JPY 2,980 / USD 18 monthly, 0.7%; Pro: JPY 9,800 / USD 60 monthly, 0.5%. Minimum JPY 30 / USD 0.20 per payment. | Settled on-chain immediately after the payment confirms |
267
- | JPY 50-500 / USD 0.31-3.00 | Micro Payment | Applied automatically by amount | USD 0.01 / Tx, about JPY 2 | Weekly settlement - see [Settlement schedule](./docs/pricing.md#settlement-schedule) |
268
- | JPY 1-49 / USD 0.01-0.30 | Nano Payment | Applied automatically by amount | USD 0.001 / usage, about JPY 0.2 | Monthly settlement - see [Settlement schedule](./docs/pricing.md#settlement-schedule) |
286
+ | JPY 50-500 / USD 0.31-3.00 | Micro Payment | Applied automatically by amount | USD 0.01 / SDRP Tx, about JPY 2 | Weekly settlement, or earlier at JPY 10,000 / USD 100.00 - see [Settlement schedule](./docs/pricing.md#settlement-schedule) |
287
+ | JPY 1-49 / USD 0.01-0.30 | Nano Payment | Applied automatically by amount | USD 0.001 / SDRP Tx, about JPY 0.2 | Monthly settlement, or earlier at JPY 10,000 / USD 100.00 - see [Settlement schedule](./docs/pricing.md#settlement-schedule) |
288
+
289
+ In this table, `Tx` means one accepted SDRP payment, not an on-chain settlement
290
+ transaction.
269
291
 
270
292
  A merchant billing mandate is required before accepting payments, even on the
271
293
  Launch plan. The current public API chooses the payment band from
@@ -281,9 +303,12 @@ returned on a payment requirement is the authoritative fee rate for that payment
281
303
  in the merchant's settlement currency. For Micro / Nano, the statement APIs
282
304
  expose `protocol_fee_minor`, `gross_buyer_debit_minor`, `buyer_debit_minor`, and
283
305
  `rounding_delta_minor`.
284
- Standard Payment fees are deducted from the merchant settlement amount. Micro /
285
- Nano protocol fees are added to the buyer debit and are not provider revenue.
286
- The full fee table and the weekly / monthly settlement schedule live in
306
+ All SDRP payment fees are seller-borne. Standard Payment fees are deducted from
307
+ the merchant settlement amount. Micro / Nano protocol fees are deducted from
308
+ provider receivable at aggregated settlement and are not added to the buyer
309
+ debit.
310
+ The full fee table, the weekly / monthly settlement schedule, and the JPY
311
+ 10,000 / USD 100.00 early settlement threshold live in
287
312
  [docs/pricing.md](./docs/pricing.md). Statement APIs for "how much was used,
288
313
  when will it close, when can it debit, and what is settled" are documented in
289
314
  [docs/metered-statements.md](./docs/metered-statements.md).
@@ -630,11 +655,12 @@ Read [docs/security.md](./docs/security.md) before going live.
630
655
 
631
656
  - The Direct Request Payment HTTP endpoints live under
632
657
  `/v1/sdrp/direct-payments/...`; the SDK targets them for you.
633
- - For wire compatibility the platform still tags these payments with the legacy
634
- mode value `external_402`, and the merchant registry may still expose the
635
- legacy billing-plan key `free` for the Launch tier. The SDK sets and reads
636
- these values for you treat them as compatibility identifiers, not public
637
- product names.
658
+ - The platform tags these payments with the internal mode value `external_402`,
659
+ which reflects SDRP's HTTP 402 Payment Required lineage (it is **not**
660
+ x402-wire-compatible see "Relationship to HTTP 402"). The merchant registry
661
+ may also still expose the legacy billing-plan key `free` for the Launch tier.
662
+ The SDK sets and reads these values for you; `external_402` is an internal
663
+ mode identifier, not a public product name.
638
664
 
639
665
  ## Documentation
640
666
 
package/dist/index.cjs CHANGED
@@ -83,7 +83,7 @@ var DIRECT_REQUEST_PAYMENT_RECEIPT_KIND = "sdrp_direct_payment";
83
83
  var DIRECT_REQUEST_PAYMENT_ALLOWANCE_RECEIPT_KIND = "sdrp_direct_payment_allowance";
84
84
  var DIRECT_REQUEST_PAYMENT_REFERENCE_TYPE = "sdrp_direct_payment_requirement";
85
85
  var DEFAULT_WEBHOOK_TOLERANCE_SECONDS = 300;
86
- var DIRECT_REQUEST_PAYMENT_SDK_VERSION = "0.4.10";
86
+ var DIRECT_REQUEST_PAYMENT_SDK_VERSION = "0.4.13";
87
87
  var DIRECT_REQUEST_PAYMENT_STANDARD_SETTLED_STATUS = "settled";
88
88
  var DIRECT_REQUEST_PAYMENT_METERED_ACCEPTED_STATUS = "pending_settlement";
89
89
  var DIRECT_REQUEST_PAYMENT_STANDARD_FINALITY = "per_payment_onchain";