@siglume/direct-request-payment 0.4.8 → 0.4.10

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.
@@ -8,6 +8,8 @@ Siglume Direct Request Payment 向けの外部事業者用SDKを公開しまし
8
8
 
9
9
  > **Beta / サーバーロールアウト中**: Hosted Checkout はアカウントごとに段階提供中です。未提供アカウントでは `createCheckoutSession(...)` / `getCheckoutSession(...)` が `HostedCheckoutNotAvailableError` を返します。生の 404/409 をそのまま利用者へ見せず、提供開始まで既存の agent/API 経路を利用してください。
10
10
 
11
+ > **対応チェーン**: 現在の公開ベータは **Polygon PoS 上の JPYC / USDC 精算のみ** に対応しています。マルチチェーン、チェーン選択、クロスチェーン精算、複数の merchant settlement wallet、決済ごとの settlement wallet override、分割・マルチウォレット課金には対応していません。
12
+
11
13
  このSDKは、外部EC、予約サービス、会員制サービス、有料API、scheduled autopay などで、SDRP の Standard Payment / 通常決済を自社プロダクトに組み込むためのSDKです。
12
14
 
13
15
  ## できること
@@ -4,6 +4,14 @@ The TypeScript package is `@siglume/direct-request-payment`. The Python package
4
4
  is `siglume-direct-request-payment` and imports as
5
5
  `siglume_direct_request_payment`.
6
6
 
7
+ ## Current Public Beta Scope
8
+
9
+ SDRP currently settles JPYC / USDC on **Polygon PoS only**. The public SDK does
10
+ not expose chain selection, cross-chain payment, multiple merchant settlement
11
+ wallets, per-payment settlement-wallet overrides, or split / multi-wallet
12
+ charging. Route each payment through the buyer's Siglume wallet and the merchant
13
+ account's configured Siglume settlement wallet.
14
+
7
15
  ## Two Buyer Systems
8
16
 
9
17
  SDRP serves two kinds of buyer, and you integrate each differently. In both
@@ -28,9 +36,9 @@ card — and the merchant SDK never authenticates the buyer.
28
36
 
29
37
  In both systems the merchant handles the same signed `direct_payment.confirmed`
30
38
  webhook. Hosted Checkout adds no new money movement and no new webhook. Inspect
31
- `pricing_band`, `finality`, and `settlement_status`: Standard can be marked paid
32
- only after settled per-payment finality, while Micro / Nano usage is accepted
33
- before the later aggregated settlement.
39
+ `pricing_band`, `settlement_cadence`, `finality`, and `settlement_status`:
40
+ Standard can be marked paid only after settled per-payment finality, while Micro
41
+ / Nano usage is accepted before the later aggregated settlement.
34
42
 
35
43
  ## Environment Variables
36
44
 
@@ -466,8 +474,8 @@ Returns a `HostedCheckoutSession` status object with:
466
474
  - `authenticated_at` (nullable; set when the shopper signs into Siglume)
467
475
  - `paid_at` (nullable; set when Hosted Checkout has accepted the wallet
468
476
  payment flow. For Micro / Nano, this is not the same as final provider
469
- settlement; use `pricing_band`, `finality`, `settlement_status`, and the
470
- statement APIs.)
477
+ settlement; use `pricing_band`, `settlement_cadence`, `finality`,
478
+ `settlement_status`, and the statement APIs.)
471
479
  - `cancelled_at` (nullable; set when the shopper cancels)
472
480
  - `created_at` (nullable)
473
481
  - `metadata_jsonb`
@@ -971,15 +979,18 @@ requirements; keep accepting `event.data.request_hash` for historical payloads.
971
979
  Recommended branch: call `classifyDirectPaymentConfirmation(event)` /
972
980
  `classify_direct_payment_confirmation(event)` and switch on `kind`:
973
981
 
974
- - `metered_batch_settled`: no order `challenge_hash` is expected. Reconcile the
975
- batch with the returned non-empty `settlement_batch_id`, `chain_receipt_id`,
976
- and `usage_event_digest`.
982
+ - `metered_batch_settled`: no order `challenge_hash` is expected. This requires
983
+ Micro / Nano pricing, the matching settlement cadence (`micro` -> `weekly`,
984
+ `nano` -> `monthly`), `finality === "aggregated_onchain_settlement"`, settled
985
+ status, and non-empty `settlement_batch_id`, `chain_receipt_id`, and
986
+ `usage_event_digest`. Reconcile the batch with those returned identifiers.
977
987
  - `standard_settled`: mark the mapped order paid once. This requires Standard
978
988
  pricing, per-payment on-chain finality, settled status, non-empty
979
989
  `requirement_id`, non-empty `challenge_hash`, and non-empty
980
990
  `chain_receipt_id`.
981
991
  - `metered_usage_accepted`: treat the usage as accepted but unsettled. This
982
992
  requires Micro / Nano pricing, `finality === "aggregated_onchain_settlement"`,
993
+ the matching settlement cadence (`micro` -> `weekly`, `nano` -> `monthly`),
983
994
  `settlement_status === "pending_settlement"`, non-empty `requirement_id`, and
984
995
  non-empty `challenge_hash`. SDRP merchant setup and terms assume the merchant
985
996
  accepts this delayed aggregated settlement model for Micro / Nano amount
@@ -998,9 +1009,10 @@ Classifies a parsed `direct_payment.confirmed` event into:
998
1009
  - `metered_batch_settled`
999
1010
  - `unknown`
1000
1011
 
1001
- The classifier is fail-closed: missing finality, missing settlement status,
1002
- empty challenge hashes, empty requirement ids, and empty settlement batch
1003
- receipt identifiers return `kind: "unknown"` with a machine-readable `reason`.
1012
+ The classifier is fail-closed: missing finality, missing pricing band, mismatched
1013
+ Micro / Nano settlement cadence, missing settlement status, empty challenge
1014
+ hashes, empty requirement ids, and empty settlement batch receipt identifiers
1015
+ return `kind: "unknown"` with a machine-readable `reason`.
1004
1016
 
1005
1017
  ### `verifyDirectRequestPaymentWebhook(secret, body, signature_header, options)` / `verify_direct_request_payment_webhook(secret, body, signature_header, *, tolerance_seconds=300, now=None)`
1006
1018
 
@@ -14,6 +14,12 @@ external merchant.
14
14
  The merchant server must not create charges with a customer wallet. It signs the
15
15
  order challenge; the buyer-facing Siglume payment flow pays it.
16
16
 
17
+ **Current public beta scope.** SDRP currently settles JPYC / USDC on **Polygon
18
+ PoS only**. The public SDK does not expose chain selection, cross-chain payment,
19
+ multiple merchant settlement wallets, per-payment settlement-wallet override, or
20
+ split / multi-wallet charging. Route each payment through the buyer's Siglume
21
+ wallet and the merchant account's configured Siglume settlement wallet.
22
+
17
23
  This quickstart uses Standard-band example amounts. Micro Payment and Nano
18
24
  Payment are applied automatically by amount through the same Hosted Checkout or
19
25
  agent/API flow; you do not create a separate Micro/Nano object or manually
@@ -461,8 +461,8 @@ separate from settled revenue.
461
461
 
462
462
  - Your order fulfillment is idempotent by order id and requirement id.
463
463
  - Standard Payment fulfillment still uses verified `direct_payment.confirmed`
464
- only when `pricing_band`, `finality`, and `settlement_status` show settled
465
- per-payment finality.
464
+ only when `pricing_band`, `settlement_cadence`, `finality`, and
465
+ `settlement_status` show settled per-payment finality.
466
466
  - Micro / Nano accounting uses statement APIs or CSV, not only webhooks.
467
467
  - Your dashboard separates settled, unsettled, and past-due provider amounts.
468
468
  - Your support UI shows sanitized failure fields and `support_reference`.
package/docs/pricing.md CHANGED
@@ -24,6 +24,11 @@ percentage (the payment fee column below) is identical in both currencies. Only
24
24
  the flat amounts — the monthly base fee and the per-payment minimum fee — are
25
25
  quoted per currency.
26
26
 
27
+ Current public beta settlement is on **Polygon PoS only**. The public SDK does
28
+ not expose chain selection, cross-chain payment, multiple merchant settlement
29
+ wallets, per-payment settlement-wallet overrides, or split / multi-wallet
30
+ charging.
31
+
27
32
  ## Pricing Table
28
33
 
29
34
  | Payment amount | Applied automatically | What you select | Fee | Settlement |
@@ -62,8 +67,10 @@ If no paid plan is selected during merchant setup, the merchant account uses the
62
67
  Launch plan. A merchant billing mandate is still required before accepting
63
68
  payments so Siglume can collect the monthly base fee automatically.
64
69
 
65
- Per-payment fees are deducted at settlement, so the merchant receives the net
66
- amount for each payment. Monthly base fees are collected separately through the
70
+ Standard Payment fees are deducted at settlement, so the merchant receives the
71
+ net amount for each Standard payment. Micro / Nano protocol fees are different:
72
+ they are added to the buyer debit, are reported as `protocol_fee_minor`, and are
73
+ not provider revenue. Monthly base fees are collected separately through the
67
74
  merchant billing mandate.
68
75
 
69
76
  The same Standard Payment percentage schedule applies in JPY and USD. For
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siglume/direct-request-payment",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "description": "SDK for the Siglume Direct Request Payment SDRP payment protocol",
5
5
  "keywords": [
6
6
  "siglume",