@delopay/sdk 0.68.0 → 0.70.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/internal.cjs CHANGED
@@ -747,10 +747,14 @@ var Disputes = class {
747
747
  return this.request("PUT", "/disputes/evidence", { body: params });
748
748
  }
749
749
  /**
750
- * Retrieve previously submitted evidence for a dispute.
750
+ * Retrieve previously stored evidence for a dispute.
751
+ *
752
+ * Returns an ARRAY of file-evidence blocks (this was previously mistyped
753
+ * as the flat submit-request shape). Only file evidence is reported —
754
+ * text evidence is not retrievable once submitted.
751
755
  *
752
756
  * @param disputeId - The dispute ID.
753
- * @returns The submitted evidence.
757
+ * @returns The stored file-evidence blocks.
754
758
  */
755
759
  async retrieveEvidence(disputeId) {
756
760
  return this.request("GET", `/disputes/evidence/${encodeURIComponent(disputeId)}`);
@@ -788,16 +792,22 @@ var Disputes = class {
788
792
  return this.request("GET", "/disputes/profile/aggregate", { query: params });
789
793
  }
790
794
  /**
791
- * Fetch the latest dispute state from the connector (gateway).
792
- * `GET /disputes/{connectorId}/fetch`
795
+ * Fetch the latest dispute state from the connector (gateway) and persist it.
796
+ * `GET /disputes/{disputeId}?force_sync=true`
797
+ *
798
+ * The path parameter is the **Delopay dispute id** (`dp_…`). Force-sync asks the
799
+ * backend to pull the dispute from the connector (supported where the connector
800
+ * implements the dispute-sync flow, e.g. Stripe) and update the stored record
801
+ * before returning it.
793
802
  *
794
- * Note: the path parameter is the **connector dispute id** on the gateway, not the
795
- * Delopay dispute id. Method is GET (not POST) and this method signature was
796
- * previously wrongcallers depending on the old `POST /disputes/{id}/fetch_from_connector`
797
- * path were silently hitting 404s.
803
+ * Note: this method previously called `GET /disputes/{id}/fetch`, which is a
804
+ * different backend route a bulk import keyed by **merchant connector account
805
+ * id** with a required date range so every call with a dispute id failed.
798
806
  */
799
- async fetchFromConnector(connectorId) {
800
- return this.request("GET", `/disputes/${encodeURIComponent(connectorId)}/fetch`);
807
+ async fetchFromConnector(disputeId) {
808
+ return this.request("GET", `/disputes/${encodeURIComponent(disputeId)}`, {
809
+ query: { force_sync: "true" }
810
+ });
801
811
  }
802
812
  };
803
813
 
@@ -1309,6 +1319,30 @@ var Payments = class {
1309
1319
  async listAttempts(paymentId, options) {
1310
1320
  return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/attempts`, options);
1311
1321
  }
1322
+ /**
1323
+ * The status timeline of a payment: every recorded creation / status
1324
+ * transition of the intent and its attempts, refunds and disputes, oldest
1325
+ * first. `complete: false` marks timelines partially reconstructed from
1326
+ * current records (payments created before the status log existed).
1327
+ *
1328
+ * @param paymentId - The payment intent ID.
1329
+ * @returns The ordered status-history events.
1330
+ *
1331
+ * @example
1332
+ * ```typescript
1333
+ * const { events, complete } = await delopay.payments.listStatusHistory('pay_abc123');
1334
+ * for (const event of events) {
1335
+ * console.log(event.timestamp, event.entity_type, event.status);
1336
+ * }
1337
+ * ```
1338
+ */
1339
+ async listStatusHistory(paymentId, options) {
1340
+ return this.request(
1341
+ "GET",
1342
+ `/payments/${encodeURIComponent(paymentId)}/status-history`,
1343
+ options
1344
+ );
1345
+ }
1312
1346
  /**
1313
1347
  * Update an existing payment intent before it is confirmed.
1314
1348
  *
@@ -4449,6 +4483,17 @@ var AdminPortal = class {
4449
4483
  `/admin-portal/transactions/${encodeURIComponent(paymentId)}/attempts`
4450
4484
  );
4451
4485
  }
4486
+ /**
4487
+ * Status timeline (intent / attempt / refund / dispute transitions) for a
4488
+ * single transaction of ANY merchant. `complete: false` marks timelines
4489
+ * partially reconstructed from current records.
4490
+ */
4491
+ async getTransactionStatusHistory(paymentId) {
4492
+ return this.request(
4493
+ "GET",
4494
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/status-history`
4495
+ );
4496
+ }
4452
4497
  /**
4453
4498
  * Refunds for a single transaction of ANY merchant.
4454
4499
  */