@delopay/sdk 0.129.0 → 0.130.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
@@ -58,6 +58,7 @@ __export(index_exports, {
58
58
  MAX_SECTION_ORDER: () => MAX_SECTION_ORDER,
59
59
  METHOD_SECTIONS: () => METHOD_SECTIONS,
60
60
  MIN_SECTION_ORDER: () => MIN_SECTION_ORDER,
61
+ NATIVE_ELEMENT_POSITIONS: () => NATIVE_ELEMENT_POSITIONS,
61
62
  NATIVE_PANES_MAX: () => NATIVE_PANES_MAX,
62
63
  NATIVE_PANE_CATEGORY_KEYS: () => NATIVE_PANE_CATEGORY_KEYS,
63
64
  NATIVE_PANE_ICON_KEYS: () => NATIVE_PANE_ICON_KEYS,
@@ -5416,6 +5417,7 @@ var SURCHARGE_POSITIONS = [
5416
5417
  "cornerStart",
5417
5418
  "cornerEnd"
5418
5419
  ];
5420
+ var NATIVE_ELEMENT_POSITIONS = ["top", "bottom"];
5419
5421
  var SURCHARGE_STYLES = [
5420
5422
  "plain",
5421
5423
  "underline",
@@ -5828,6 +5830,9 @@ var DEFAULT_BRANDING_BASE = {
5828
5830
  // find out about on the statement.
5829
5831
  showSurcharge: true,
5830
5832
  surchargePosition: "trailing",
5833
+ // The button is the surface a buyer recognises fastest; it leads its section
5834
+ // unless the merchant says otherwise.
5835
+ nativeElementPosition: "top",
5831
5836
  surchargeStyle: "badge",
5832
5837
  surchargeSize: "sm",
5833
5838
  surchargeShape: "pill",
@@ -6468,6 +6473,11 @@ function decodeBranding(source) {
6468
6473
  SURCHARGE_POSITIONS,
6469
6474
  DEFAULT_BRANDING.surchargePosition
6470
6475
  ),
6476
+ nativeElementPosition: pickEnum(
6477
+ extras["nativeElementPosition"],
6478
+ NATIVE_ELEMENT_POSITIONS,
6479
+ DEFAULT_BRANDING.nativeElementPosition
6480
+ ),
6471
6481
  surchargeStyle: pickEnum(
6472
6482
  extras["surchargeStyle"],
6473
6483
  SURCHARGE_STYLES,
@@ -6587,6 +6597,7 @@ function encodeBranding(branding, base) {
6587
6597
  buttonSize: branding.buttonSize,
6588
6598
  showSurcharge: String(branding.showSurcharge),
6589
6599
  surchargePosition: branding.surchargePosition,
6600
+ nativeElementPosition: branding.nativeElementPosition,
6590
6601
  surchargeStyle: branding.surchargeStyle,
6591
6602
  surchargeSize: branding.surchargeSize,
6592
6603
  surchargeShape: branding.surchargeShape,
@@ -6745,6 +6756,11 @@ function parseImportedBranding(raw) {
6745
6756
  SURCHARGE_POSITIONS,
6746
6757
  dflt.surchargePosition
6747
6758
  ),
6759
+ nativeElementPosition: pickEnum(
6760
+ root["nativeElementPosition"],
6761
+ NATIVE_ELEMENT_POSITIONS,
6762
+ dflt.nativeElementPosition
6763
+ ),
6748
6764
  surchargeStyle: pickEnum(
6749
6765
  root["surchargeStyle"],
6750
6766
  SURCHARGE_STYLES,
@@ -7687,6 +7703,7 @@ var encodeNativePanes = encodePanes;
7687
7703
  MAX_SECTION_ORDER,
7688
7704
  METHOD_SECTIONS,
7689
7705
  MIN_SECTION_ORDER,
7706
+ NATIVE_ELEMENT_POSITIONS,
7690
7707
  NATIVE_PANES_MAX,
7691
7708
  NATIVE_PANE_CATEGORY_KEYS,
7692
7709
  NATIVE_PANE_ICON_KEYS,