@delopay/sdk 0.76.0 → 0.77.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/dist/index.d.cts CHANGED
@@ -187,6 +187,26 @@ interface PaymentCreateRequest {
187
187
  browser_info?: Record<string, unknown> | null;
188
188
  /** Set to `true` to generate a hosted payment link for this payment. */
189
189
  payment_link?: boolean | null;
190
+ /**
191
+ * Whether this is a test payment. The environment belongs to the payment, not to
192
+ * the processor.
193
+ *
194
+ * - `true` — run against the processor's sandbox and record the transaction as a
195
+ * test, keeping it out of live transaction lists and analytics. A processor with
196
+ * no sandbox credentials stored is called with the only credentials it has, so a
197
+ * live-only processor will charge for real.
198
+ * - `false` — run live, even if the processor still carries the deprecated
199
+ * account-level test-mode toggle.
200
+ * - omit — the processor's toggle decides, as it did before this field existed.
201
+ *
202
+ * Create-only: `confirm` and `update` can be called from the browser with a client
203
+ * secret, so the environment is fixed when you create the payment on your server.
204
+ *
205
+ * Requires a DeloPay backend that knows this field. The payments API rejects
206
+ * unknown fields, so sending it to an older deployment fails the whole create
207
+ * with `IR_06` rather than ignoring it.
208
+ */
209
+ test_mode?: boolean | null;
190
210
  }
191
211
  interface PaymentUpdateRequest {
192
212
  amount?: number | null;
@@ -349,9 +369,10 @@ interface PaymentResponse {
349
369
  /** Bank statement descriptor (suffix portion). */
350
370
  statement_descriptor_suffix?: string | null;
351
371
  /**
352
- * Whether this payment ran in test mode (against a sandbox/test connector).
353
- * Set at confirm from the connector account's test mode; `null` for payments
354
- * created but never confirmed against a connector.
372
+ * Which environment this payment ran in. Reflects the `test_mode` you sent at
373
+ * create; when you sent nothing it is filled in from the processor's own toggle
374
+ * once a processor is picked, and stays `null` for a payment that never reached
375
+ * one. `null` counts as live everywhere it is filtered on.
355
376
  */
356
377
  test_mode?: boolean | null;
357
378
  [key: string]: unknown;
@@ -3958,6 +3979,17 @@ declare class Payments {
3958
3979
  * { headers: { 'Idempotency-Key': 'order_1001' } },
3959
3980
  * );
3960
3981
  * ```
3982
+ *
3983
+ * @example Send `test_mode` to pick the environment per payment, so a staging
3984
+ * deploy cannot charge real cards and a forgotten processor toggle cannot
3985
+ * swallow production traffic:
3986
+ * ```typescript
3987
+ * const payment = await delopay.payments.create({
3988
+ * amount: 5000,
3989
+ * currency: 'EUR',
3990
+ * test_mode: process.env.NODE_ENV !== 'production',
3991
+ * });
3992
+ * ```
3961
3993
  */
3962
3994
  create(params: PaymentCreateRequest, options?: RequestExtras): Promise<PaymentResponse>;
3963
3995
  /**
package/dist/index.d.ts CHANGED
@@ -187,6 +187,26 @@ interface PaymentCreateRequest {
187
187
  browser_info?: Record<string, unknown> | null;
188
188
  /** Set to `true` to generate a hosted payment link for this payment. */
189
189
  payment_link?: boolean | null;
190
+ /**
191
+ * Whether this is a test payment. The environment belongs to the payment, not to
192
+ * the processor.
193
+ *
194
+ * - `true` — run against the processor's sandbox and record the transaction as a
195
+ * test, keeping it out of live transaction lists and analytics. A processor with
196
+ * no sandbox credentials stored is called with the only credentials it has, so a
197
+ * live-only processor will charge for real.
198
+ * - `false` — run live, even if the processor still carries the deprecated
199
+ * account-level test-mode toggle.
200
+ * - omit — the processor's toggle decides, as it did before this field existed.
201
+ *
202
+ * Create-only: `confirm` and `update` can be called from the browser with a client
203
+ * secret, so the environment is fixed when you create the payment on your server.
204
+ *
205
+ * Requires a DeloPay backend that knows this field. The payments API rejects
206
+ * unknown fields, so sending it to an older deployment fails the whole create
207
+ * with `IR_06` rather than ignoring it.
208
+ */
209
+ test_mode?: boolean | null;
190
210
  }
191
211
  interface PaymentUpdateRequest {
192
212
  amount?: number | null;
@@ -349,9 +369,10 @@ interface PaymentResponse {
349
369
  /** Bank statement descriptor (suffix portion). */
350
370
  statement_descriptor_suffix?: string | null;
351
371
  /**
352
- * Whether this payment ran in test mode (against a sandbox/test connector).
353
- * Set at confirm from the connector account's test mode; `null` for payments
354
- * created but never confirmed against a connector.
372
+ * Which environment this payment ran in. Reflects the `test_mode` you sent at
373
+ * create; when you sent nothing it is filled in from the processor's own toggle
374
+ * once a processor is picked, and stays `null` for a payment that never reached
375
+ * one. `null` counts as live everywhere it is filtered on.
355
376
  */
356
377
  test_mode?: boolean | null;
357
378
  [key: string]: unknown;
@@ -3958,6 +3979,17 @@ declare class Payments {
3958
3979
  * { headers: { 'Idempotency-Key': 'order_1001' } },
3959
3980
  * );
3960
3981
  * ```
3982
+ *
3983
+ * @example Send `test_mode` to pick the environment per payment, so a staging
3984
+ * deploy cannot charge real cards and a forgotten processor toggle cannot
3985
+ * swallow production traffic:
3986
+ * ```typescript
3987
+ * const payment = await delopay.payments.create({
3988
+ * amount: 5000,
3989
+ * currency: 'EUR',
3990
+ * test_mode: process.env.NODE_ENV !== 'production',
3991
+ * });
3992
+ * ```
3961
3993
  */
3962
3994
  create(params: PaymentCreateRequest, options?: RequestExtras): Promise<PaymentResponse>;
3963
3995
  /**
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ import {
74
74
  surfacePadValue,
75
75
  verticalGapValue,
76
76
  visibleCustomFields
77
- } from "./chunk-D7DPAKI2.js";
77
+ } from "./chunk-RODMYISN.js";
78
78
  export {
79
79
  ALL_CUSTOM_FIELD_CONDITION_SOURCES,
80
80
  ALL_CUSTOM_FIELD_OPERATORS,
package/dist/internal.cjs CHANGED
@@ -1281,6 +1281,17 @@ var Payments = class {
1281
1281
  * { headers: { 'Idempotency-Key': 'order_1001' } },
1282
1282
  * );
1283
1283
  * ```
1284
+ *
1285
+ * @example Send `test_mode` to pick the environment per payment, so a staging
1286
+ * deploy cannot charge real cards and a forgotten processor toggle cannot
1287
+ * swallow production traffic:
1288
+ * ```typescript
1289
+ * const payment = await delopay.payments.create({
1290
+ * amount: 5000,
1291
+ * currency: 'EUR',
1292
+ * test_mode: process.env.NODE_ENV !== 'production',
1293
+ * });
1294
+ * ```
1284
1295
  */
1285
1296
  async create(params, options) {
1286
1297
  return this.request("POST", "/payments", { body: params, ...options });