@delopay/sdk 0.138.0 → 0.140.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.
@@ -1779,6 +1779,45 @@ var Payments = class {
1779
1779
  options
1780
1780
  );
1781
1781
  }
1782
+ /**
1783
+ * The routing decision recorded behind each attempt of a payment: which rule
1784
+ * matched, which candidates routing produced and which filter removed each,
1785
+ * which volume bucket was drawn and what the counters read, which
1786
+ * configuration version was live.
1787
+ *
1788
+ * This is the only truthful account of **how the connector was chosen**.
1789
+ * `routing_approach` on the payment is seeded on creation and several paths —
1790
+ * mandate, pre-routed and pinned-account among them — return before it is
1791
+ * overwritten, so it can still read `default_fallback` on a payment that was
1792
+ * routed by a rule. Read {@link RoutingDecision.decision_kind} instead.
1793
+ *
1794
+ * An attempt with `decision: null` simply has no record: the recorder is
1795
+ * best-effort, attempts that never reached routing have nothing to record,
1796
+ * and attempts predating the record exist in quantity. It is not an error.
1797
+ *
1798
+ * `GET /payments/{paymentId}/routing-decisions`
1799
+ *
1800
+ * @param paymentId - The payment intent ID.
1801
+ * @param options - Optional per-call extras: extra `headers`, a `timeout`
1802
+ * override, and an `AbortSignal`.
1803
+ * @returns Every attempt returned for this payment, with its decision.
1804
+ *
1805
+ * @example
1806
+ * ```typescript
1807
+ * const { attempts } = await delopay.payments.routingDecisions('pay_abc123');
1808
+ * for (const attempt of attempts) {
1809
+ * if (!attempt.decision) continue;
1810
+ * console.log(attempt.connector, attempt.decision.decision_kind);
1811
+ * }
1812
+ * ```
1813
+ */
1814
+ async routingDecisions(paymentId, options) {
1815
+ return this.request(
1816
+ "GET",
1817
+ `/payments/${encodeURIComponent(paymentId)}/routing-decisions`,
1818
+ options
1819
+ );
1820
+ }
1782
1821
  /**
1783
1822
  * Soft-delete a payment. Only payments whose status is in the merchant's
1784
1823
  * delete policy (see {@link Payments.getDeletePolicy}) can be deleted;
@@ -5489,7 +5528,12 @@ var SURCHARGE_POSITIONS = [
5489
5528
  "cornerStart",
5490
5529
  "cornerEnd"
5491
5530
  ];
5492
- var NATIVE_ELEMENT_POSITIONS = ["top", "bottom"];
5531
+ var NATIVE_ELEMENT_POSITIONS = [
5532
+ "top",
5533
+ "belowFields",
5534
+ "belowCard",
5535
+ "bottom"
5536
+ ];
5493
5537
  var SURCHARGE_STYLES = [
5494
5538
  "plain",
5495
5539
  "underline",
@@ -5905,6 +5949,8 @@ var DEFAULT_BRANDING_BASE = {
5905
5949
  // The button is the surface a buyer recognises fastest; it leads its section
5906
5950
  // unless the merchant says otherwise.
5907
5951
  nativeElementPosition: "top",
5952
+ // Side by side — see the field.
5953
+ nativeElementStacked: false,
5908
5954
  surchargeStyle: "badge",
5909
5955
  surchargeSize: "sm",
5910
5956
  surchargeShape: "pill",
@@ -5972,6 +6018,8 @@ var DEFAULT_BRANDING_BASE = {
5972
6018
  airwallexCardPreset: "",
5973
6019
  // Off. With this on, no buyer can pay by card on the shop.
5974
6020
  airwallexHideCard: false,
6021
+ // Off: the section is named, like every other section on the surface.
6022
+ airwallexHideCardTitle: false,
5975
6023
  airwallexFieldChrome: "outlined",
5976
6024
  airwallexLabelStyle: "",
5977
6025
  airwallexFieldFontSize: "md",
@@ -6568,6 +6616,10 @@ function decodeBranding(source) {
6568
6616
  SURCHARGE_POSITIONS,
6569
6617
  DEFAULT_BRANDING.surchargePosition
6570
6618
  ),
6619
+ nativeElementStacked: parseBool(
6620
+ extras["nativeElementStacked"],
6621
+ DEFAULT_BRANDING.nativeElementStacked
6622
+ ),
6571
6623
  nativeElementPosition: pickEnum(
6572
6624
  extras["nativeElementPosition"],
6573
6625
  NATIVE_ELEMENT_POSITIONS,
@@ -6673,6 +6725,10 @@ function decodeBranding(source) {
6673
6725
  AIRWALLEX_CARD_PRESETS
6674
6726
  ),
6675
6727
  airwallexHideCard: parseBool(extras["airwallexHideCard"], DEFAULT_BRANDING.airwallexHideCard),
6728
+ airwallexHideCardTitle: parseBool(
6729
+ extras["airwallexHideCardTitle"],
6730
+ DEFAULT_BRANDING.airwallexHideCardTitle
6731
+ ),
6676
6732
  airwallexFieldChrome: pickEnum(
6677
6733
  extras["airwallexFieldChrome"],
6678
6734
  AIRWALLEX_FIELD_CHROMES,
@@ -6740,6 +6796,7 @@ function encodeBranding(branding, base) {
6740
6796
  showSurcharge: String(branding.showSurcharge),
6741
6797
  surchargePosition: branding.surchargePosition,
6742
6798
  nativeElementPosition: branding.nativeElementPosition,
6799
+ nativeElementStacked: String(branding.nativeElementStacked),
6743
6800
  surchargeStyle: branding.surchargeStyle,
6744
6801
  surchargeSize: branding.surchargeSize,
6745
6802
  surchargeShape: branding.surchargeShape,
@@ -6772,6 +6829,7 @@ function encodeBranding(branding, base) {
6772
6829
  // by accident, which is how `summaryOrder` was lost.
6773
6830
  airwallexCardPreset: branding.airwallexCardPreset,
6774
6831
  airwallexHideCard: String(branding.airwallexHideCard),
6832
+ airwallexHideCardTitle: String(branding.airwallexHideCardTitle),
6775
6833
  airwallexFieldChrome: branding.airwallexFieldChrome,
6776
6834
  airwallexLabelStyle: branding.airwallexLabelStyle,
6777
6835
  airwallexFieldFontSize: branding.airwallexFieldFontSize,
@@ -6913,6 +6971,7 @@ function parseImportedBranding(raw) {
6913
6971
  SURCHARGE_POSITIONS,
6914
6972
  dflt.surchargePosition
6915
6973
  ),
6974
+ nativeElementStacked: parseBool(root["nativeElementStacked"], dflt.nativeElementStacked),
6916
6975
  nativeElementPosition: pickEnum(
6917
6976
  root["nativeElementPosition"],
6918
6977
  NATIVE_ELEMENT_POSITIONS,
@@ -7017,6 +7076,7 @@ function parseImportedBranding(raw) {
7017
7076
  AIRWALLEX_CARD_PRESETS
7018
7077
  ),
7019
7078
  airwallexHideCard: parseBool(root["airwallexHideCard"], dflt.airwallexHideCard),
7079
+ airwallexHideCardTitle: parseBool(root["airwallexHideCardTitle"], dflt.airwallexHideCardTitle),
7020
7080
  airwallexFieldChrome: pickEnum(
7021
7081
  root["airwallexFieldChrome"],
7022
7082
  AIRWALLEX_FIELD_CHROMES,
@@ -8055,4 +8115,4 @@ export {
8055
8115
  decodeNativePanes,
8056
8116
  encodeNativePanes
8057
8117
  };
8058
- //# sourceMappingURL=chunk-OMJ6MVD4.js.map
8118
+ //# sourceMappingURL=chunk-WW33CCSB.js.map