@sphoq/payments 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/types.d.ts +23 -3
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -1,20 +1,34 @@
1
1
  /**
2
2
  * Configuration options for the {@link SphoqPayments} client.
3
3
  *
4
+ * The API key prefix determines the environment:
5
+ * - `spq_live_*` — Production (real PIX charges)
6
+ * - `spq_test_*` — Development/Sandbox (EfiBank sandbox, no real money)
7
+ *
4
8
  * @example
5
9
  * ```ts
6
10
  * import { SphoqPayments } from "@sphoq/payments";
7
11
  *
12
+ * // Production
8
13
  * const sphoq = new SphoqPayments({
9
- * apiKey: "spk_live_abc123...",
14
+ * apiKey: "spq_live_abc123...",
15
+ * baseUrl: "https://your-deployment.convex.site",
16
+ * });
17
+ *
18
+ * // Sandbox / Testing
19
+ * const sphoqTest = new SphoqPayments({
20
+ * apiKey: "spq_test_abc123...",
10
21
  * baseUrl: "https://your-deployment.convex.site",
11
22
  * });
12
23
  * ```
13
24
  */
14
25
  export interface SphoqPaymentsOptions {
15
26
  /**
16
- * Your Sphoq API key. Starts with `spk_`.
17
- * Generate one from the Plugin page in your Sphoq store dashboard.
27
+ * Your Sphoq API key.
28
+ * - `spq_live_*` keys target the **production** EfiBank environment (real charges).
29
+ * - `spq_test_*` keys target the **sandbox** EfiBank environment (test charges).
30
+ *
31
+ * Generate keys from the Plugin page in your Sphoq store dashboard.
18
32
  */
19
33
  apiKey: string;
20
34
  /**
@@ -238,6 +252,12 @@ export interface Charge {
238
252
  * Returned as-is from the API.
239
253
  */
240
254
  metadata?: Record<string, unknown>;
255
+ /**
256
+ * The environment this charge was created in.
257
+ * - `"production"` — Real PIX charge.
258
+ * - `"development"` — EfiBank sandbox charge (no real money).
259
+ */
260
+ environment?: "production" | "development";
241
261
  /** Unix timestamp (milliseconds) when the charge was created. */
242
262
  createdAt: number;
243
263
  /** Unix timestamp (milliseconds) when the PIX QR code expires. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphoq/payments",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Sphoq Payments SDK — integrate PIX payment processing into your app",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",