@0to1pay/fulfillment-sdk 2.1.0 → 2.2.0

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 CHANGED
@@ -3,11 +3,11 @@
3
3
  Node.js 22.20.0 or newer and a merchant PostgreSQL database. Install the SDKs from npm after publication or use the verified tarballs in your merchant backend.
4
4
 
5
5
  ```sh
6
- npm install @0to1pay/server-sdk@2.1.0 @0to1pay/fulfillment-sdk@2.1.0
6
+ npm install @0to1pay/server-sdk@2.2.0 @0to1pay/fulfillment-sdk@2.2.0
7
7
  ```
8
8
 
9
9
  ```sh
10
- npm install ./0to1pay-server-sdk-2.1.0.tgz ./0to1pay-fulfillment-sdk-2.1.0.tgz
10
+ npm install ./0to1pay-server-sdk-2.2.0.tgz ./0to1pay-fulfillment-sdk-2.2.0.tgz
11
11
  ```
12
12
 
13
13
  1. Register an HTTPS webhook endpoint for `fulfillment.requested`. Save the returned signing key ID and base64url secret in your backend's secret store. Configure `FulfillmentInbox` with the merchant ID, project ID and environment of the same project, and decode the signing secret with `Buffer.from(secret, 'base64url')`.
@@ -244,6 +244,48 @@ paths:
244
244
  $ref: '#/components/responses/Conflict'
245
245
  '503':
246
246
  $ref: '#/components/responses/Unavailable'
247
+ /billing/test-keys:
248
+ post:
249
+ operationId: issueTestBillingKey
250
+ summary: Issue a scoped Sandbox server key
251
+ tags: [Billing]
252
+ x-required-scope: billing:write
253
+ description: >-
254
+ Issue a test-only integration key without a paid subscription. A project may issue up to five
255
+ Sandbox keys per rolling 24 hours and hold up to five active Sandbox keys.
256
+ Keep the returned secret server-side. If the response is lost, retry with the same billing
257
+ credential and Idempotency-Key. Regular reads never expose the secret.
258
+ parameters:
259
+ - $ref: '#/components/parameters/IdempotencyKey'
260
+ requestBody:
261
+ required: true
262
+ content:
263
+ application/json:
264
+ schema:
265
+ $ref: '#/components/schemas/BillingKeyRequest'
266
+ responses:
267
+ '201':
268
+ description: Test-only server key.
269
+ content:
270
+ application/json:
271
+ schema:
272
+ $ref: '#/components/schemas/TestBillingKey'
273
+ '400':
274
+ $ref: '#/components/responses/BadRequest'
275
+ '401':
276
+ $ref: '#/components/responses/Unauthorized'
277
+ '403':
278
+ $ref: '#/components/responses/BillingForbidden'
279
+ '409':
280
+ $ref: '#/components/responses/Conflict'
281
+ '429':
282
+ description: Sandbox key limit reached.
283
+ content:
284
+ application/json:
285
+ schema:
286
+ $ref: '#/components/schemas/Error'
287
+ '503':
288
+ $ref: '#/components/responses/Unavailable'
247
289
  /chain/assets:
248
290
  get:
249
291
  operationId: listChainAssets
@@ -251,6 +293,7 @@ paths:
251
293
  description: >
252
294
  Live checkout supports Ethereum native USDC and USDT, TRON USDT, and Base native USDC.
253
295
  Only configured networks in the caller's environment are returned.
296
+ Base Sepolia's test USDC can appear for Sandbox keys when the deployment enables it.
254
297
  tags: [Connections]
255
298
  x-required-scope: payments:read
256
299
  responses:
@@ -1639,7 +1682,7 @@ components:
1639
1682
  pattern: '^0x[0-9a-fA-F]{64}$'
1640
1683
  ChainSelectorId:
1641
1684
  type: integer
1642
- enum: [1, 999, 8453, 42161, 31337, 31338, 31339, 31340, 900001, 900002, 728126428, 900003]
1685
+ enum: [1, 999, 8453, 84532, 42161, 31337, 31338, 31339, 31340, 900001, 900002, 728126428, 900003]
1643
1686
  description: EVM or TRON chain ID, or a local or Solana selector. Use network_id for the network reference.
1644
1687
  ChainNetworkId:
1645
1688
  type: string
@@ -2780,6 +2823,16 @@ components:
2780
2823
  $ref: '#/components/schemas/Environment'
2781
2824
  required: [key_id, token, environment]
2782
2825
  additionalProperties: false
2826
+ TestBillingKey:
2827
+ allOf:
2828
+ - $ref: '#/components/schemas/BillingKey'
2829
+ - type: object
2830
+ properties:
2831
+ environment:
2832
+ const: test
2833
+ token:
2834
+ type: string
2835
+ pattern: '^sp_test_[0-9a-f]{16}\.[A-Za-z0-9_-]{43}$'
2783
2836
  ChainCheckoutSessionRef:
2784
2837
  type: string
2785
2838
  pattern: '^[A-Za-z0-9_-]{16,128}$'
@@ -153,6 +153,26 @@ export interface paths {
153
153
  patch?: never;
154
154
  trace?: never;
155
155
  };
156
+ "/billing/test-keys": {
157
+ parameters: {
158
+ query?: never;
159
+ header?: never;
160
+ path?: never;
161
+ cookie?: never;
162
+ };
163
+ get?: never;
164
+ put?: never;
165
+ /**
166
+ * Issue a scoped Sandbox server key
167
+ * @description Issue a test-only integration key without a paid subscription. A project may issue up to five Sandbox keys per rolling 24 hours and hold up to five active Sandbox keys. Keep the returned secret server-side. If the response is lost, retry with the same billing credential and Idempotency-Key. Regular reads never expose the secret.
168
+ */
169
+ post: operations["issueTestBillingKey"];
170
+ delete?: never;
171
+ options?: never;
172
+ head?: never;
173
+ patch?: never;
174
+ trace?: never;
175
+ };
156
176
  "/chain/assets": {
157
177
  parameters: {
158
178
  query?: never;
@@ -162,7 +182,7 @@ export interface paths {
162
182
  };
163
183
  /**
164
184
  * List supported USDC and USDT deployments on configured networks
165
- * @description Live checkout supports Ethereum native USDC and USDT, TRON USDT, and Base native USDC. Only configured networks in the caller's environment are returned.
185
+ * @description Live checkout supports Ethereum native USDC and USDT, TRON USDT, and Base native USDC. Only configured networks in the caller's environment are returned. Base Sepolia's test USDC can appear for Sandbox keys when the deployment enables it.
166
186
  */
167
187
  get: operations["listChainAssets"];
168
188
  put?: never;
@@ -745,7 +765,7 @@ export interface components {
745
765
  * @description EVM or TRON chain ID, or a local or Solana selector. Use network_id for the network reference.
746
766
  * @enum {integer}
747
767
  */
748
- ChainSelectorId: 1 | 999 | 8453 | 42161 | 31337 | 31338 | 31339 | 31340 | 900001 | 900002 | 728126428 | 900003;
768
+ ChainSelectorId: 1 | 999 | 8453 | 84532 | 42161 | 31337 | 31338 | 31339 | 31340 | 900001 | 900002 | 728126428 | 900003;
749
769
  /** @description Decimal TRON identifiers are emitted. The hexadecimal TRON mainnet alias is accepted on connection creation. */
750
770
  ChainNetworkId: string;
751
771
  /** @enum {string} */
@@ -1184,6 +1204,11 @@ export interface components {
1184
1204
  token: string;
1185
1205
  environment: components["schemas"]["Environment"];
1186
1206
  };
1207
+ TestBillingKey: components["schemas"]["BillingKey"] & {
1208
+ /** @constant */
1209
+ environment?: "test";
1210
+ token?: string;
1211
+ };
1187
1212
  /** @description Stable opaque reference assigned by the merchant server to the authenticated buyer checkout. */
1188
1213
  ChainCheckoutSessionRef: string;
1189
1214
  /** @description Use a 0x-prefixed wallet signature. Encode raw Solana Ed25519 signature bytes as hex. */
@@ -1867,6 +1892,47 @@ export interface operations {
1867
1892
  503: components["responses"]["Unavailable"];
1868
1893
  };
1869
1894
  };
1895
+ issueTestBillingKey: {
1896
+ parameters: {
1897
+ query?: never;
1898
+ header: {
1899
+ /** @description Stable per logical caller mutation, scoped to bound merchant/project/environment + operation. Same key with different canonical request -> 409. Claim responses dynamically revalidate validity. */
1900
+ "Idempotency-Key": components["parameters"]["IdempotencyKey"];
1901
+ };
1902
+ path?: never;
1903
+ cookie?: never;
1904
+ };
1905
+ requestBody: {
1906
+ content: {
1907
+ "application/json": components["schemas"]["BillingKeyRequest"];
1908
+ };
1909
+ };
1910
+ responses: {
1911
+ /** @description Test-only server key. */
1912
+ 201: {
1913
+ headers: {
1914
+ [name: string]: unknown;
1915
+ };
1916
+ content: {
1917
+ "application/json": components["schemas"]["TestBillingKey"];
1918
+ };
1919
+ };
1920
+ 400: components["responses"]["BadRequest"];
1921
+ 401: components["responses"]["Unauthorized"];
1922
+ 403: components["responses"]["BillingForbidden"];
1923
+ 409: components["responses"]["Conflict"];
1924
+ /** @description Sandbox key limit reached. */
1925
+ 429: {
1926
+ headers: {
1927
+ [name: string]: unknown;
1928
+ };
1929
+ content: {
1930
+ "application/json": components["schemas"]["Error"];
1931
+ };
1932
+ };
1933
+ 503: components["responses"]["Unavailable"];
1934
+ };
1935
+ };
1870
1936
  listChainAssets: {
1871
1937
  parameters: {
1872
1938
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0to1pay/fulfillment-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "0to1Pay signed webhook receiver and PostgreSQL fulfillment worker",