@0to1pay/server-sdk 0.0.0-stage → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 apfl99
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # 0to1Pay Server SDK
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Node.js 22.20.0 or newer. Install the verified tarball in your merchant backend.
4
+
5
+ ```sh
6
+ npm install ./0to1pay-server-sdk-1.0.0.tgz
7
+ ```
8
+
9
+ Once the package is published to npm, use the scoped name.
10
+
11
+ ```sh
12
+ npm install @0to1pay/server-sdk@1.0.0
13
+ ```
14
+
15
+ Open `/developers` on your 0to1Pay API origin to create a test project and issue a server key. Set the HTTPS origin and scoped key in your backend environment.
16
+
17
+ ```ts
18
+ import { ZeroToOnePayClient } from '@0to1pay/server-sdk';
19
+
20
+ const client = new ZeroToOnePayClient({
21
+ origin: process.env.ZERO_TO_ONE_PAY_ORIGIN!,
22
+ apiKey: process.env.ZERO_TO_ONE_PAY_API_KEY!,
23
+ });
24
+ const { data } = await client.call('listPayments', { query: { limit: 1 } });
25
+ ```
26
+
27
+ Use `call` for the full merchant API. Use the same idempotency key when retrying a mutation for the same logical request. The client validates requests and responses against the bundled OpenAPI contract. The hosted API also serves the contract at `/openapi.json`. Keep the scoped key on your server and route browser actions through your merchant backend.
28
+
29
+ The SDK is available under the MIT license. See the `LICENSE` file included in the package.