@zinn-digital/sdk 0.1.1936 → 0.1.1938

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.
@@ -10873,7 +10873,7 @@ export interface paths {
10873
10873
  put?: never;
10874
10874
  /**
10875
10875
  * Record that nothing is owed for an unmatched payment (staff, audited).
10876
- * @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
10876
+ * @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`); on a `surplus` row it must be 20+ characters (`422 refusal.orphanPayment.surplusReasonRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
10877
10877
  */
10878
10878
  post: operations["ignoreOrphanPayment"];
10879
10879
  delete?: never;
@@ -10893,7 +10893,7 @@ export interface paths {
10893
10893
  put?: never;
10894
10894
  /**
10895
10895
  * Credit an unmatched payment to a customer's wallet (staff, audited).
10896
- * @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
10896
+ * @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. A `surplus` row credits only the account whose order it paid (`422 refusal.orphanPayment.surplusOrgMismatch`), the provider-confirmed amount, once (keyed on the provider payment). Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
10897
10897
  */
10898
10898
  post: operations["linkOrphanPayment"];
10899
10899
  delete?: never;
@@ -10913,7 +10913,7 @@ export interface paths {
10913
10913
  put?: never;
10914
10914
  /**
10915
10915
  * Refund an unmatched payment at the provider that took it (staff, audited).
10916
- * @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
10916
+ * @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. A `surplus` row is never refunded to its source: `422 refusal.orphanPayment.surplusCreditOnly` (refunds are account credit only; use link). Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
10917
10917
  */
10918
10918
  post: operations["refundOrphanPayment"];
10919
10919
  delete?: never;
@@ -98278,18 +98278,30 @@ export interface components {
98278
98278
  claimed_org_id: string;
98279
98279
  /** @description ISO 4217; empty when the provider did not say. */
98280
98280
  currency: string;
98281
+ /** @description The provider's own figures for a `surplus` row (crypto: what actually arrived, pay currency and amount, the quote). Empty on every other kind. */
98282
+ details: {
98283
+ [key: string]: unknown;
98284
+ };
98281
98285
  event_type: string;
98282
98286
  /** Format: date-time */
98283
98287
  first_seen_at: string;
98284
98288
  /** Format: uuid */
98285
98289
  id: string;
98286
- /** @enum {string} */
98287
- kind: "payment" | "unmatched" | "subscription_charge" | "closed_org" | "provider_subscription";
98290
+ /**
98291
+ * @description `surplus` (DOUBLEPAY): a second payment for an order another payment (or account credit) had already paid. HELD for staff: credit it to the order's own account (link, with that org) or ignore it with a reason of 20+ characters; a refund to the source is refused (`422 refusal.orphanPayment.surplusCreditOnly`), as refunds are account credit only.
98292
+ * @enum {string}
98293
+ */
98294
+ kind: "payment" | "unmatched" | "subscription_charge" | "closed_org" | "provider_subscription" | "surplus";
98288
98295
  /** Format: date-time */
98289
98296
  last_seen_at: string;
98290
98297
  /** Format: uuid */
98291
98298
  linked_org_id: string | null;
98292
98299
  livemode: boolean;
98300
+ /**
98301
+ * Format: uuid
98302
+ * @description The order a `surplus` row paid twice; null on every other kind.
98303
+ */
98304
+ order_id: string | null;
98293
98305
  payer_email: string;
98294
98306
  /** @enum {string} */
98295
98307
  provider: "stripe" | "paypal" | "nowpayments";
@@ -193209,7 +193221,7 @@ export interface operations {
193209
193221
  401: components["responses"]["Unauthorized"];
193210
193222
  403: components["responses"]["Forbidden"];
193211
193223
  404: components["responses"]["NotFound"];
193212
- /** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. */
193224
+ /** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. Also (DAY-0350): another payment for this order is already being processed (a second tab, or a PayPal capture in progress), so nothing was asked of any processor and nothing was charged; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order: it is either paid or payable again. A failed attempt frees the order at once; an attempt whose outcome is unknown frees it after 10 minutes. */
193213
193225
  409: {
193214
193226
  headers: {
193215
193227
  [name: string]: unknown;
@@ -193380,7 +193392,7 @@ export interface operations {
193380
193392
  401: components["responses"]["Unauthorized"];
193381
193393
  403: components["responses"]["Forbidden"];
193382
193394
  404: components["responses"]["NotFound"];
193383
- /** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. */
193395
+ /** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. Also (DAY-0350): another payment for this order is already being processed (a card payment or a second capture), so PayPal was not asked to capture and nothing was taken; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order. */
193384
193396
  409: {
193385
193397
  headers: {
193386
193398
  [name: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1936",
3
+ "version": "0.1.1938",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",