@delopay/sdk 0.244.0 → 0.246.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
@@ -2631,6 +2631,48 @@ var Payments = class {
2631
2631
  options
2632
2632
  );
2633
2633
  }
2634
+ /**
2635
+ * The traffic of a payment, oldest first: the requests DeloPay sent to the
2636
+ * payment provider, the webhooks the provider sent, and the webhooks DeloPay
2637
+ * sent to the shop with every delivery attempt. No payloads; read an entry
2638
+ * with {@link getLogConnectorCall}, {@link getLogIncomingWebhook} or
2639
+ * {@link getLogOutgoingWebhook}. Dashboard (JWT) only.
2640
+ *
2641
+ * @param paymentId - The payment intent ID.
2642
+ *
2643
+ * @example
2644
+ * ```typescript
2645
+ * const logs = await delopay.payments.listLogs('pay_abc123');
2646
+ * if (!logs.psp_traffic_recorded) console.log('provider traffic is not recorded');
2647
+ * ```
2648
+ */
2649
+ async listLogs(paymentId, options) {
2650
+ return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/logs`, options);
2651
+ }
2652
+ /** One provider request of a payment, with its masked request, response and error. */
2653
+ async getLogConnectorCall(paymentId, callId, options) {
2654
+ return this.request(
2655
+ "GET",
2656
+ `/payments/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,
2657
+ options
2658
+ );
2659
+ }
2660
+ /** One provider webhook of a payment, with its masked headers and body. */
2661
+ async getLogIncomingWebhook(paymentId, eventId, options) {
2662
+ return this.request(
2663
+ "GET",
2664
+ `/payments/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,
2665
+ options
2666
+ );
2667
+ }
2668
+ /** Every delivery attempt of one shop webhook of a payment, with request and response. */
2669
+ async getLogOutgoingWebhook(paymentId, initialAttemptId, options) {
2670
+ return this.request(
2671
+ "GET",
2672
+ `/payments/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,
2673
+ options
2674
+ );
2675
+ }
2634
2676
  /**
2635
2677
  * What the payment's rail says about settling each attempt: whether the
2636
2678
  * money is still `pending` in the rail's hands, `available` in its balance
@@ -13164,6 +13206,35 @@ var AdminPortal = class {
13164
13206
  `/admin-portal/transactions/${encodeURIComponent(paymentId)}/status-history`
13165
13207
  );
13166
13208
  }
13209
+ /**
13210
+ * The traffic of a transaction of ANY merchant: provider requests, provider
13211
+ * webhooks and shop webhooks, oldest first, without payloads. Same shape as
13212
+ * `payments.listLogs`.
13213
+ */
13214
+ async getTransactionLogs(paymentId) {
13215
+ return this.request("GET", `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs`);
13216
+ }
13217
+ /** One provider request of a transaction of ANY merchant, with its masked payloads. */
13218
+ async getTransactionLogConnectorCall(paymentId, callId) {
13219
+ return this.request(
13220
+ "GET",
13221
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`
13222
+ );
13223
+ }
13224
+ /** One provider webhook of a transaction of ANY merchant, with its masked headers and body. */
13225
+ async getTransactionLogIncomingWebhook(paymentId, eventId) {
13226
+ return this.request(
13227
+ "GET",
13228
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`
13229
+ );
13230
+ }
13231
+ /** Every delivery attempt of one shop webhook of a transaction of ANY merchant. */
13232
+ async getTransactionLogOutgoingWebhook(paymentId, initialAttemptId) {
13233
+ return this.request(
13234
+ "GET",
13235
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`
13236
+ );
13237
+ }
13167
13238
  /**
13168
13239
  * The invoices and credit notes issued for a transaction of ANY merchant,
13169
13240
  * each its own row, newest first. At most 100 per page.