@siglume/direct-request-payment 0.3.0 → 0.3.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/CHANGELOG.md +61 -50
- package/LICENSE +21 -21
- package/README.md +406 -404
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/docs/announcement-ja.md +69 -64
- package/docs/api-reference.md +331 -274
- package/docs/merchant-quickstart.md +296 -296
- package/docs/pricing.md +73 -73
- package/docs/security.md +110 -99
- package/examples/express-checkout.ts +106 -106
- package/examples/setup-merchant.ts +17 -17
- package/package.json +71 -71
package/docs/api-reference.md
CHANGED
|
@@ -1,274 +1,331 @@
|
|
|
1
|
-
# API Reference
|
|
2
|
-
|
|
3
|
-
The TypeScript package is `@siglume/direct-request-payment`. The Python package
|
|
4
|
-
is `siglume-direct-request-payment` and imports as
|
|
5
|
-
`siglume_direct_request_payment`.
|
|
6
|
-
|
|
7
|
-
## Environment Variables
|
|
8
|
-
|
|
9
|
-
| Name | Used by | Purpose |
|
|
10
|
-
| --- | --- | --- |
|
|
11
|
-
| `SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET` | merchant server | HMAC secret for order challenges |
|
|
12
|
-
| `SIGLUME_MERCHANT_AUTH_TOKEN` | merchant setup helper | merchant Siglume bearer token for self-service setup |
|
|
13
|
-
| `SIGLUME_AUTH_TOKEN` | buyer payment helper | buyer Siglume bearer token for API calls |
|
|
14
|
-
| `SIGLUME_API_BASE` | optional | API base URL override; defaults to `https://siglume.com/v1` |
|
|
15
|
-
| `SIGLUME_WEBHOOK_SECRET` | merchant server | webhook signing secret returned as `whsec_...` |
|
|
16
|
-
|
|
17
|
-
Do not use a Developer Portal `cli_` API key as either auth token. Merchant
|
|
18
|
-
setup is merchant-JWT authenticated; payment requirement creation is
|
|
19
|
-
buyer-JWT authenticated.
|
|
20
|
-
|
|
21
|
-
## `createDirectRequestPaymentChallenge(input)` / `create_direct_request_payment_challenge(...)`
|
|
22
|
-
|
|
23
|
-
Creates the merchant-signed challenge required by Siglume.
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
const challenge = await createDirectRequestPaymentChallenge({
|
|
27
|
-
merchant: "example_merchant",
|
|
28
|
-
amount_minor: 1200,
|
|
29
|
-
currency: "JPY",
|
|
30
|
-
secret: process.env.SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET!,
|
|
31
|
-
nonce: "order_123-attempt_1",
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
```py
|
|
36
|
-
import os
|
|
37
|
-
|
|
38
|
-
challenge = create_direct_request_payment_challenge(
|
|
39
|
-
merchant="example_merchant",
|
|
40
|
-
amount_minor=1200,
|
|
41
|
-
currency="JPY",
|
|
42
|
-
secret=os.environ["SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET"],
|
|
43
|
-
nonce="order_123-attempt_1",
|
|
44
|
-
)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Returns:
|
|
48
|
-
|
|
49
|
-
- `challenge`: value to pass to Siglume
|
|
50
|
-
- `challenge_hash`: value to store on the order
|
|
51
|
-
- `signature`: HMAC-SHA256 hex digest
|
|
52
|
-
- `nonce`
|
|
53
|
-
|
|
54
|
-
`nonce` must not contain `:` because the platform challenge string is delimited
|
|
55
|
-
as `scheme:nonce:signature`.
|
|
56
|
-
|
|
57
|
-
## `verifyDirectRequestPaymentChallenge(secret, input)` / `verify_direct_request_payment_challenge(...)`
|
|
58
|
-
|
|
59
|
-
Verifies a challenge against merchant, amount, currency, and secret. This is
|
|
60
|
-
useful in tests and internal checkout assertions.
|
|
61
|
-
|
|
62
|
-
## `
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
`
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
`
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
- `
|
|
262
|
-
- `
|
|
263
|
-
- `
|
|
264
|
-
- `
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
The TypeScript package is `@siglume/direct-request-payment`. The Python package
|
|
4
|
+
is `siglume-direct-request-payment` and imports as
|
|
5
|
+
`siglume_direct_request_payment`.
|
|
6
|
+
|
|
7
|
+
## Environment Variables
|
|
8
|
+
|
|
9
|
+
| Name | Used by | Purpose |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET` | merchant server | HMAC secret for order challenges |
|
|
12
|
+
| `SIGLUME_MERCHANT_AUTH_TOKEN` | merchant setup helper | merchant Siglume bearer token for self-service setup |
|
|
13
|
+
| `SIGLUME_AUTH_TOKEN` | buyer payment helper | buyer Siglume bearer token for API calls |
|
|
14
|
+
| `SIGLUME_API_BASE` | optional | API base URL override; defaults to `https://siglume.com/v1` |
|
|
15
|
+
| `SIGLUME_WEBHOOK_SECRET` | merchant server | webhook signing secret returned as `whsec_...` |
|
|
16
|
+
|
|
17
|
+
Do not use a Developer Portal `cli_` API key as either auth token. Merchant
|
|
18
|
+
setup is merchant-JWT authenticated; payment requirement creation is
|
|
19
|
+
buyer-JWT authenticated.
|
|
20
|
+
|
|
21
|
+
## `createDirectRequestPaymentChallenge(input)` / `create_direct_request_payment_challenge(...)`
|
|
22
|
+
|
|
23
|
+
Creates the merchant-signed challenge required by Siglume.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const challenge = await createDirectRequestPaymentChallenge({
|
|
27
|
+
merchant: "example_merchant",
|
|
28
|
+
amount_minor: 1200,
|
|
29
|
+
currency: "JPY",
|
|
30
|
+
secret: process.env.SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET!,
|
|
31
|
+
nonce: "order_123-attempt_1",
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```py
|
|
36
|
+
import os
|
|
37
|
+
|
|
38
|
+
challenge = create_direct_request_payment_challenge(
|
|
39
|
+
merchant="example_merchant",
|
|
40
|
+
amount_minor=1200,
|
|
41
|
+
currency="JPY",
|
|
42
|
+
secret=os.environ["SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET"],
|
|
43
|
+
nonce="order_123-attempt_1",
|
|
44
|
+
)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
|
|
49
|
+
- `challenge`: value to pass to Siglume
|
|
50
|
+
- `challenge_hash`: value to store on the order
|
|
51
|
+
- `signature`: HMAC-SHA256 hex digest
|
|
52
|
+
- `nonce`
|
|
53
|
+
|
|
54
|
+
`nonce` must not contain `:` because the platform challenge string is delimited
|
|
55
|
+
as `scheme:nonce:signature`.
|
|
56
|
+
|
|
57
|
+
## `verifyDirectRequestPaymentChallenge(secret, input)` / `verify_direct_request_payment_challenge(...)`
|
|
58
|
+
|
|
59
|
+
Verifies a challenge against merchant, amount, currency, and secret. This is
|
|
60
|
+
useful in tests and internal checkout assertions.
|
|
61
|
+
|
|
62
|
+
## `createDirectRequestPaymentRecurringChallenge(input)` / `create_direct_request_payment_recurring_challenge(...)`
|
|
63
|
+
|
|
64
|
+
Creates the merchant-signed, one-time approval challenge used when a buyer sets
|
|
65
|
+
up a subscription or scheduled autopay authorization.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const recurring = await createDirectRequestPaymentRecurringChallenge({
|
|
69
|
+
merchant: "example_merchant",
|
|
70
|
+
amount_minor: 980,
|
|
71
|
+
currency: "JPY",
|
|
72
|
+
cadence: "daily",
|
|
73
|
+
secret: process.env.SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET!,
|
|
74
|
+
nonce: "schedule_setup_4711",
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```py
|
|
79
|
+
recurring = create_direct_request_payment_recurring_challenge(
|
|
80
|
+
merchant="example_merchant",
|
|
81
|
+
amount_minor=980,
|
|
82
|
+
currency="JPY",
|
|
83
|
+
cadence="daily",
|
|
84
|
+
secret=os.environ["SIGLUME_DIRECT_PAYMENT_CHALLENGE_SECRET"],
|
|
85
|
+
nonce="schedule_setup_4711",
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The recurring signature binds:
|
|
90
|
+
|
|
91
|
+
- merchant key
|
|
92
|
+
- amount in minor units
|
|
93
|
+
- currency
|
|
94
|
+
- cadence
|
|
95
|
+
- nonce
|
|
96
|
+
|
|
97
|
+
The HMAC material is:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
merchant:amount_minor:currency:cadence:nonce
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`cadence` must be:
|
|
104
|
+
|
|
105
|
+
- `monthly` for subscriptions
|
|
106
|
+
- `daily` for scheduled autopay
|
|
107
|
+
|
|
108
|
+
For scheduled autopay, `daily` is an approval tag. It is not a one-run-per-day
|
|
109
|
+
limit. Occurrence execution is bounded by the buyer-approved per-run, daily, and
|
|
110
|
+
monthly auto-pay budget.
|
|
111
|
+
|
|
112
|
+
Returns the same fields as the one-time challenge helper, plus `cadence`.
|
|
113
|
+
|
|
114
|
+
## `verifyDirectRequestPaymentRecurringChallenge(secret, input)` / `verify_direct_request_payment_recurring_challenge(...)`
|
|
115
|
+
|
|
116
|
+
Verifies a recurring approval challenge against merchant, amount, currency,
|
|
117
|
+
cadence, and secret.
|
|
118
|
+
|
|
119
|
+
## `directRequestPaymentChallengeHash(challenge)` / `direct_request_payment_challenge_hash(...)`
|
|
120
|
+
|
|
121
|
+
Returns the `sha256:`-prefixed hash for an existing challenge string.
|
|
122
|
+
|
|
123
|
+
## `directRequestPaymentRequestHash(input)` / `direct_request_payment_request_hash(...)`
|
|
124
|
+
|
|
125
|
+
Returns the SDK-side request hash material for merchant, amount, currency, and
|
|
126
|
+
challenge. This is mostly useful for tests and internal assertions.
|
|
127
|
+
|
|
128
|
+
## `DirectRequestPaymentMerchantClient`
|
|
129
|
+
|
|
130
|
+
Use this client with the merchant's Siglume bearer token. It is the self-service
|
|
131
|
+
setup surface for an external merchant integrating Direct Request Payment.
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
const merchant = new DirectRequestPaymentMerchantClient({
|
|
135
|
+
auth_token: merchantSiglumeBearerToken,
|
|
136
|
+
base_url: "https://siglume.com/v1",
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```py
|
|
141
|
+
merchant = DirectRequestPaymentMerchantClient(
|
|
142
|
+
auth_token=merchant_siglume_bearer_token,
|
|
143
|
+
base_url="https://siglume.com/v1",
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `setupCheckout(input)` / `setup_checkout(...)`
|
|
148
|
+
|
|
149
|
+
High-level setup for most integrations. It calls merchant setup, billing mandate
|
|
150
|
+
preparation, and webhook subscription creation.
|
|
151
|
+
|
|
152
|
+
Input:
|
|
153
|
+
|
|
154
|
+
- `merchant`: self-service merchant key, 3-64 chars using lowercase letters,
|
|
155
|
+
numbers, `_`, or `-`
|
|
156
|
+
- `display_name`: optional public merchant name
|
|
157
|
+
- `billing_plan`: `launch`, `starter`, `growth`, or `pro`
|
|
158
|
+
- `billing_currency`: `JPY`; `USD` requires agreed USD/USDC billing terms
|
|
159
|
+
- `webhook_callback_url`: HTTPS callback URL for signed payment events
|
|
160
|
+
- `max_amount_minor`: optional billing mandate cap
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
|
|
164
|
+
- `merchant`: merchant account setup response
|
|
165
|
+
- `billing_mandate`: billing mandate preparation response, when requested
|
|
166
|
+
- `webhook_subscription`: webhook subscription response, when created
|
|
167
|
+
- `env`: server environment values to store, including returned secrets
|
|
168
|
+
|
|
169
|
+
Secrets are returned only when created or rotated. Existing secrets are not
|
|
170
|
+
replayed by `getMerchant` / `get_merchant`.
|
|
171
|
+
|
|
172
|
+
### `setupMerchant(input)` / `setup_merchant(...)`
|
|
173
|
+
|
|
174
|
+
Calls:
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
POST /v1/market/api-store/direct-payments/merchants
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Creates or updates the merchant account for the authenticated merchant user.
|
|
181
|
+
|
|
182
|
+
### `getMerchant(merchant)` / `get_merchant(merchant)`
|
|
183
|
+
|
|
184
|
+
Calls:
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
GET /v1/market/api-store/direct-payments/merchants/{merchant}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Returns setup and billing status without returning the challenge secret.
|
|
191
|
+
|
|
192
|
+
### `rotateChallengeSecret(merchant)` / `rotate_challenge_secret(merchant)`
|
|
193
|
+
|
|
194
|
+
Calls:
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
POST /v1/market/api-store/direct-payments/merchants/{merchant}/challenge-secret/rotate
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Returns the new challenge secret once.
|
|
201
|
+
|
|
202
|
+
### `prepareBillingMandate(merchant, input)` / `prepare_billing_mandate(...)`
|
|
203
|
+
|
|
204
|
+
Calls:
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
POST /v1/market/api-store/direct-payments/merchants/{merchant}/billing-mandate
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Creates or reuses the merchant billing mandate. If the returned mandate requires
|
|
211
|
+
wallet approval, complete that Siglume wallet step before accepting payments.
|
|
212
|
+
|
|
213
|
+
### `createWebhookSubscription(input)` / `create_webhook_subscription(...)`
|
|
214
|
+
|
|
215
|
+
Calls:
|
|
216
|
+
|
|
217
|
+
```text
|
|
218
|
+
POST /v1/market/webhooks/subscriptions
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Defaults event types to `direct_payment.confirmed` and
|
|
222
|
+
`direct_payment.spent`. The returned `signing_secret` is shown only at creation
|
|
223
|
+
or rotation.
|
|
224
|
+
|
|
225
|
+
## `DirectRequestPaymentClient`
|
|
226
|
+
|
|
227
|
+
Thin wrapper around the current Siglume Direct Request Payment HTTP contract.
|
|
228
|
+
Use it with the authenticated buyer's Siglume bearer token. Developer Portal
|
|
229
|
+
`cli_` API keys are not accepted by these buyer-authenticated routes.
|
|
230
|
+
|
|
231
|
+
Payment requirements include `fee_bps` from the Siglume platform. The SDK does
|
|
232
|
+
not calculate merchant plan fees locally; see [Pricing](./pricing.md).
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
const siglume = new DirectRequestPaymentClient({
|
|
236
|
+
auth_token: buyerSiglumeBearerToken,
|
|
237
|
+
base_url: "https://siglume.com/v1",
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
```py
|
|
242
|
+
siglume = DirectRequestPaymentClient(
|
|
243
|
+
auth_token=buyer_siglume_bearer_token,
|
|
244
|
+
base_url="https://siglume.com/v1",
|
|
245
|
+
)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### `createPaymentRequirement(input)` / `create_payment_requirement(...)`
|
|
249
|
+
|
|
250
|
+
Calls:
|
|
251
|
+
|
|
252
|
+
```text
|
|
253
|
+
POST /v1/market/api-store/direct-payments/requirements
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The SDK sends `mode="external_402"` internally.
|
|
257
|
+
|
|
258
|
+
Input:
|
|
259
|
+
|
|
260
|
+
- `merchant`: Siglume merchant key
|
|
261
|
+
- `amount_minor`: positive integer in minor currency units
|
|
262
|
+
- `currency`: `JPY` or `USD` when enabled for the merchant account
|
|
263
|
+
- `challenge`: merchant-signed challenge string
|
|
264
|
+
- `token_symbol`: optional `JPYC` or `USDC` when enabled for the merchant account
|
|
265
|
+
- `allowance_amount_minor`: optional positive integer
|
|
266
|
+
- `metadata`: optional JSON object
|
|
267
|
+
|
|
268
|
+
### `executeAllowanceTransaction(requirement)` / `execute_allowance_transaction(...)`
|
|
269
|
+
|
|
270
|
+
Executes `requirement.approve_transaction_request` through:
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
POST /v1/market/web3/transactions/execute-prepared
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Only call this when Siglume returned an approval transaction.
|
|
277
|
+
|
|
278
|
+
### `executePaymentTransaction(requirement)` / `execute_payment_transaction(...)`
|
|
279
|
+
|
|
280
|
+
Executes `requirement.transaction_request` through the same prepared transaction
|
|
281
|
+
route.
|
|
282
|
+
|
|
283
|
+
### `verifyPaymentRequirement(requirement_id, input)` / `verify_payment_requirement(...)`
|
|
284
|
+
|
|
285
|
+
Calls:
|
|
286
|
+
|
|
287
|
+
```text
|
|
288
|
+
POST /v1/market/api-store/direct-payments/requirements/{requirement_id}/verify
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Input may include:
|
|
292
|
+
|
|
293
|
+
- `receipt_id`
|
|
294
|
+
- `chain_receipt_id`
|
|
295
|
+
- `await_finality`
|
|
296
|
+
- `await_required_status`
|
|
297
|
+
- `await_timeout_seconds`
|
|
298
|
+
- `await_poll_seconds`
|
|
299
|
+
|
|
300
|
+
## Webhook Helpers
|
|
301
|
+
|
|
302
|
+
- `buildWebhookSignatureHeader(secret, body)` for tests
|
|
303
|
+
- `verifyWebhookSignature(secret, body, header)`
|
|
304
|
+
- `verifyDirectRequestPaymentWebhook(secret, body, header)`
|
|
305
|
+
- `parseDirectRequestPaymentWebhookEvent(payload)`
|
|
306
|
+
- Python equivalents use snake_case:
|
|
307
|
+
`build_webhook_signature_header`, `verify_webhook_signature`,
|
|
308
|
+
`verify_direct_request_payment_webhook`, and
|
|
309
|
+
`parse_direct_request_payment_webhook_event`.
|
|
310
|
+
|
|
311
|
+
`verifyDirectRequestPaymentWebhook` verifies the signature and parses the event
|
|
312
|
+
in one call.
|
|
313
|
+
|
|
314
|
+
## Errors
|
|
315
|
+
|
|
316
|
+
TypeScript exports:
|
|
317
|
+
|
|
318
|
+
- `SiglumeDirectRequestPaymentError`
|
|
319
|
+
- `SiglumeApiError`
|
|
320
|
+
- `SiglumeWebhookSignatureError`
|
|
321
|
+
- `SiglumeWebhookPayloadError`
|
|
322
|
+
|
|
323
|
+
Python exports:
|
|
324
|
+
|
|
325
|
+
- `DirectRequestPaymentError`
|
|
326
|
+
- `SiglumeApiError`
|
|
327
|
+
- `SiglumeWebhookSignatureError`
|
|
328
|
+
- `SiglumeWebhookPayloadError`
|
|
329
|
+
|
|
330
|
+
`SiglumeApiError` includes the HTTP status, platform error code, and parsed
|
|
331
|
+
response data where available.
|