@delopay/sdk 0.245.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/index.cjs CHANGED
@@ -2615,6 +2615,48 @@ var Payments = class {
2615
2615
  options
2616
2616
  );
2617
2617
  }
2618
+ /**
2619
+ * The traffic of a payment, oldest first: the requests DeloPay sent to the
2620
+ * payment provider, the webhooks the provider sent, and the webhooks DeloPay
2621
+ * sent to the shop with every delivery attempt. No payloads; read an entry
2622
+ * with {@link getLogConnectorCall}, {@link getLogIncomingWebhook} or
2623
+ * {@link getLogOutgoingWebhook}. Dashboard (JWT) only.
2624
+ *
2625
+ * @param paymentId - The payment intent ID.
2626
+ *
2627
+ * @example
2628
+ * ```typescript
2629
+ * const logs = await delopay.payments.listLogs('pay_abc123');
2630
+ * if (!logs.psp_traffic_recorded) console.log('provider traffic is not recorded');
2631
+ * ```
2632
+ */
2633
+ async listLogs(paymentId, options) {
2634
+ return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/logs`, options);
2635
+ }
2636
+ /** One provider request of a payment, with its masked request, response and error. */
2637
+ async getLogConnectorCall(paymentId, callId, options) {
2638
+ return this.request(
2639
+ "GET",
2640
+ `/payments/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,
2641
+ options
2642
+ );
2643
+ }
2644
+ /** One provider webhook of a payment, with its masked headers and body. */
2645
+ async getLogIncomingWebhook(paymentId, eventId, options) {
2646
+ return this.request(
2647
+ "GET",
2648
+ `/payments/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,
2649
+ options
2650
+ );
2651
+ }
2652
+ /** Every delivery attempt of one shop webhook of a payment, with request and response. */
2653
+ async getLogOutgoingWebhook(paymentId, initialAttemptId, options) {
2654
+ return this.request(
2655
+ "GET",
2656
+ `/payments/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,
2657
+ options
2658
+ );
2659
+ }
2618
2660
  /**
2619
2661
  * What the payment's rail says about settling each attempt: whether the
2620
2662
  * money is still `pending` in the rail's hands, `available` in its balance