@delopay/sdk 0.154.0 → 0.155.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.
@@ -5853,6 +5853,72 @@ function airwallexFieldWeightValue(weight) {
5853
5853
  }
5854
5854
  var AIRWALLEX_NETWORK_MARKS = ["visa", "mastercard", "amex", "discover"];
5855
5855
 
5856
+ // src/cardFormStyles.ts
5857
+ var CARD_FIELD_CHROMES = AIRWALLEX_FIELD_CHROMES;
5858
+ var CARD_FIELD_FONT_SIZES = AIRWALLEX_FIELD_FONT_SIZES;
5859
+ var CARD_FIELD_WEIGHTS = AIRWALLEX_FIELD_WEIGHTS;
5860
+ var CARD_FOCUS_RINGS = AIRWALLEX_FOCUS_RINGS;
5861
+ function cardFieldFontPx(size) {
5862
+ return size === "sm" ? 14 : size === "lg" ? 18 : 16;
5863
+ }
5864
+ function cardFieldWeightValue(weight) {
5865
+ return weight === "regular" ? 400 : weight === "semibold" ? 600 : 500;
5866
+ }
5867
+ var STRIPE_THEMES = ["auto", "stripe", "flat", "night"];
5868
+ function resolveStripeTheme(theme, dark) {
5869
+ if (theme === "auto") return dark ? "night" : "stripe";
5870
+ return theme;
5871
+ }
5872
+ var STRIPE_INPUT_STYLES = ["spaced", "condensed"];
5873
+ var STRIPE_LABEL_PLACEMENTS = ["above", "floating"];
5874
+ var STRIPE_SPACINGS = ["compact", "comfortable", "spacious"];
5875
+ function stripeSpacingValues(spacing) {
5876
+ if (spacing === "compact") return { spacingUnit: "3px", gridRowSpacing: "8px" };
5877
+ if (spacing === "spacious") return { spacingUnit: "5px", gridRowSpacing: "16px" };
5878
+ return { spacingUnit: "4px", gridRowSpacing: "12px" };
5879
+ }
5880
+ var PAYPAL_CARD_LAYOUTS = ["split", "stacked"];
5881
+ var PAYPAL_LABEL_STYLES = ["above", "none"];
5882
+ var NOMUPAY_FORM_STYLES = ["plain", "card"];
5883
+ var APPLE_PAY_BUTTON_STYLES = ["auto", "black", "white", "white-outline"];
5884
+ function resolveApplePayButtonStyle(style, dark) {
5885
+ if (style === "auto") return dark ? "white" : "black";
5886
+ return style;
5887
+ }
5888
+ var APPLE_PAY_BUTTON_TYPES = [
5889
+ "pay",
5890
+ "plain",
5891
+ "buy",
5892
+ "check-out",
5893
+ "continue",
5894
+ "book",
5895
+ "order",
5896
+ "subscribe",
5897
+ "donate",
5898
+ "contribute",
5899
+ "support",
5900
+ "tip",
5901
+ "add-money",
5902
+ "top-up",
5903
+ "reload",
5904
+ "rent"
5905
+ ];
5906
+ var GOOGLE_PAY_BUTTON_COLORS = ["auto", "default", "black", "white"];
5907
+ function resolveGooglePayButtonColor(color, dark) {
5908
+ if (color === "auto") return dark ? "white" : "black";
5909
+ return color;
5910
+ }
5911
+ var GOOGLE_PAY_BUTTON_TYPES = [
5912
+ "pay",
5913
+ "plain",
5914
+ "buy",
5915
+ "checkout",
5916
+ "book",
5917
+ "order",
5918
+ "subscribe",
5919
+ "donate"
5920
+ ];
5921
+
5856
5922
  // src/branding.ts
5857
5923
  function surchargeShowsLabel(labelMode, style, position) {
5858
5924
  if (labelMode !== "labelled") return false;
@@ -6416,6 +6482,34 @@ var DEFAULT_BRANDING_BASE = {
6416
6482
  airwallexAutofill: "system",
6417
6483
  airwallexValidTint: false,
6418
6484
  airwallexNetworkMarks: false,
6485
+ // Every card-form field below starts on what its pane drew before the
6486
+ // setting existed, so a merchant who never opens a section sees no change.
6487
+ stripeTheme: "auto",
6488
+ stripeInputs: "spaced",
6489
+ stripeLabels: "above",
6490
+ stripeSpacing: "comfortable",
6491
+ stripeFieldFontSize: "md",
6492
+ stripeFieldWeight: "medium",
6493
+ stripeFocusRing: "strong",
6494
+ stripeDisableAnimations: false,
6495
+ paypalCardLayout: "split",
6496
+ paypalLabelStyle: "above",
6497
+ paypalFieldChrome: "outlined",
6498
+ paypalFieldFontSize: "md",
6499
+ paypalFieldWeight: "regular",
6500
+ paypalFocusRing: "strong",
6501
+ paypalValidTint: false,
6502
+ nomupayFormStyle: "plain",
6503
+ nomupayShowLabels: true,
6504
+ nomupayShowPlaceholders: true,
6505
+ nomupayShowCvvHint: false,
6506
+ nomupayFieldChrome: "outlined",
6507
+ nomupayFieldFontSize: "md",
6508
+ nomupayFocusRing: "none",
6509
+ nomupayApplePayButtonStyle: "auto",
6510
+ nomupayApplePayButtonType: "pay",
6511
+ nomupayGooglePayButtonColor: "auto",
6512
+ nomupayGooglePayButtonType: "pay",
6419
6513
  customCss: ""
6420
6514
  };
6421
6515
  var DEFAULT_BRANDING = {
@@ -7154,6 +7248,125 @@ function decodeBranding(source) {
7154
7248
  extras["airwallexNetworkMarks"],
7155
7249
  DEFAULT_BRANDING.airwallexNetworkMarks
7156
7250
  ),
7251
+ stripeTheme: pickEnum(
7252
+ extras["stripeTheme"],
7253
+ STRIPE_THEMES,
7254
+ DEFAULT_BRANDING.stripeTheme
7255
+ ),
7256
+ stripeInputs: pickEnum(
7257
+ extras["stripeInputs"],
7258
+ STRIPE_INPUT_STYLES,
7259
+ DEFAULT_BRANDING.stripeInputs
7260
+ ),
7261
+ stripeLabels: pickEnum(
7262
+ extras["stripeLabels"],
7263
+ STRIPE_LABEL_PLACEMENTS,
7264
+ DEFAULT_BRANDING.stripeLabels
7265
+ ),
7266
+ stripeSpacing: pickEnum(
7267
+ extras["stripeSpacing"],
7268
+ STRIPE_SPACINGS,
7269
+ DEFAULT_BRANDING.stripeSpacing
7270
+ ),
7271
+ stripeFieldFontSize: pickEnum(
7272
+ extras["stripeFieldFontSize"],
7273
+ CARD_FIELD_FONT_SIZES,
7274
+ DEFAULT_BRANDING.stripeFieldFontSize
7275
+ ),
7276
+ stripeFieldWeight: pickEnum(
7277
+ extras["stripeFieldWeight"],
7278
+ CARD_FIELD_WEIGHTS,
7279
+ DEFAULT_BRANDING.stripeFieldWeight
7280
+ ),
7281
+ stripeFocusRing: pickEnum(
7282
+ extras["stripeFocusRing"],
7283
+ CARD_FOCUS_RINGS,
7284
+ DEFAULT_BRANDING.stripeFocusRing
7285
+ ),
7286
+ stripeDisableAnimations: parseBool(
7287
+ extras["stripeDisableAnimations"],
7288
+ DEFAULT_BRANDING.stripeDisableAnimations
7289
+ ),
7290
+ paypalCardLayout: pickEnum(
7291
+ extras["paypalCardLayout"],
7292
+ PAYPAL_CARD_LAYOUTS,
7293
+ DEFAULT_BRANDING.paypalCardLayout
7294
+ ),
7295
+ paypalLabelStyle: pickEnum(
7296
+ extras["paypalLabelStyle"],
7297
+ PAYPAL_LABEL_STYLES,
7298
+ DEFAULT_BRANDING.paypalLabelStyle
7299
+ ),
7300
+ paypalFieldChrome: pickEnum(
7301
+ extras["paypalFieldChrome"],
7302
+ CARD_FIELD_CHROMES,
7303
+ DEFAULT_BRANDING.paypalFieldChrome
7304
+ ),
7305
+ paypalFieldFontSize: pickEnum(
7306
+ extras["paypalFieldFontSize"],
7307
+ CARD_FIELD_FONT_SIZES,
7308
+ DEFAULT_BRANDING.paypalFieldFontSize
7309
+ ),
7310
+ paypalFieldWeight: pickEnum(
7311
+ extras["paypalFieldWeight"],
7312
+ CARD_FIELD_WEIGHTS,
7313
+ DEFAULT_BRANDING.paypalFieldWeight
7314
+ ),
7315
+ paypalFocusRing: pickEnum(
7316
+ extras["paypalFocusRing"],
7317
+ CARD_FOCUS_RINGS,
7318
+ DEFAULT_BRANDING.paypalFocusRing
7319
+ ),
7320
+ paypalValidTint: parseBool(extras["paypalValidTint"], DEFAULT_BRANDING.paypalValidTint),
7321
+ nomupayFormStyle: pickEnum(
7322
+ extras["nomupayFormStyle"],
7323
+ NOMUPAY_FORM_STYLES,
7324
+ DEFAULT_BRANDING.nomupayFormStyle
7325
+ ),
7326
+ nomupayShowLabels: parseBool(extras["nomupayShowLabels"], DEFAULT_BRANDING.nomupayShowLabels),
7327
+ nomupayShowPlaceholders: parseBool(
7328
+ extras["nomupayShowPlaceholders"],
7329
+ DEFAULT_BRANDING.nomupayShowPlaceholders
7330
+ ),
7331
+ nomupayShowCvvHint: parseBool(
7332
+ extras["nomupayShowCvvHint"],
7333
+ DEFAULT_BRANDING.nomupayShowCvvHint
7334
+ ),
7335
+ nomupayFieldChrome: pickEnum(
7336
+ extras["nomupayFieldChrome"],
7337
+ CARD_FIELD_CHROMES,
7338
+ DEFAULT_BRANDING.nomupayFieldChrome
7339
+ ),
7340
+ nomupayFieldFontSize: pickEnum(
7341
+ extras["nomupayFieldFontSize"],
7342
+ CARD_FIELD_FONT_SIZES,
7343
+ DEFAULT_BRANDING.nomupayFieldFontSize
7344
+ ),
7345
+ nomupayFocusRing: pickEnum(
7346
+ extras["nomupayFocusRing"],
7347
+ CARD_FOCUS_RINGS,
7348
+ DEFAULT_BRANDING.nomupayFocusRing
7349
+ ),
7350
+ nomupayApplePayButtonStyle: pickEnum(
7351
+ extras["nomupayApplePayButtonStyle"],
7352
+ APPLE_PAY_BUTTON_STYLES,
7353
+ DEFAULT_BRANDING.nomupayApplePayButtonStyle
7354
+ ),
7355
+ nomupayApplePayButtonType: pickEnum(
7356
+ extras["nomupayApplePayButtonType"],
7357
+ APPLE_PAY_BUTTON_TYPES,
7358
+ DEFAULT_BRANDING.nomupayApplePayButtonType
7359
+ ),
7360
+ nomupayGooglePayButtonColor: pickEnum(
7361
+ extras["nomupayGooglePayButtonColor"],
7362
+ GOOGLE_PAY_BUTTON_COLORS,
7363
+ DEFAULT_BRANDING.nomupayGooglePayButtonColor
7364
+ ),
7365
+ nomupayGooglePayButtonType: pickEnum(
7366
+ extras["nomupayGooglePayButtonType"],
7367
+ GOOGLE_PAY_BUTTON_TYPES,
7368
+ DEFAULT_BRANDING.nomupayGooglePayButtonType
7369
+ ),
7157
7370
  customCss: s(extras["customCss"])
7158
7371
  };
7159
7372
  }
@@ -7226,6 +7439,32 @@ function encodeBranding(branding, base) {
7226
7439
  airwallexAutofill: branding.airwallexAutofill,
7227
7440
  airwallexValidTint: String(branding.airwallexValidTint),
7228
7441
  airwallexNetworkMarks: String(branding.airwallexNetworkMarks),
7442
+ stripeTheme: branding.stripeTheme,
7443
+ stripeInputs: branding.stripeInputs,
7444
+ stripeLabels: branding.stripeLabels,
7445
+ stripeSpacing: branding.stripeSpacing,
7446
+ stripeFieldFontSize: branding.stripeFieldFontSize,
7447
+ stripeFieldWeight: branding.stripeFieldWeight,
7448
+ stripeFocusRing: branding.stripeFocusRing,
7449
+ stripeDisableAnimations: String(branding.stripeDisableAnimations),
7450
+ paypalCardLayout: branding.paypalCardLayout,
7451
+ paypalLabelStyle: branding.paypalLabelStyle,
7452
+ paypalFieldChrome: branding.paypalFieldChrome,
7453
+ paypalFieldFontSize: branding.paypalFieldFontSize,
7454
+ paypalFieldWeight: branding.paypalFieldWeight,
7455
+ paypalFocusRing: branding.paypalFocusRing,
7456
+ paypalValidTint: String(branding.paypalValidTint),
7457
+ nomupayFormStyle: branding.nomupayFormStyle,
7458
+ nomupayShowLabels: String(branding.nomupayShowLabels),
7459
+ nomupayShowPlaceholders: String(branding.nomupayShowPlaceholders),
7460
+ nomupayShowCvvHint: String(branding.nomupayShowCvvHint),
7461
+ nomupayFieldChrome: branding.nomupayFieldChrome,
7462
+ nomupayFieldFontSize: branding.nomupayFieldFontSize,
7463
+ nomupayFocusRing: branding.nomupayFocusRing,
7464
+ nomupayApplePayButtonStyle: branding.nomupayApplePayButtonStyle,
7465
+ nomupayApplePayButtonType: branding.nomupayApplePayButtonType,
7466
+ nomupayGooglePayButtonColor: branding.nomupayGooglePayButtonColor,
7467
+ nomupayGooglePayButtonType: branding.nomupayGooglePayButtonType,
7229
7468
  trustBadges: encodeBadges(branding.trustBadges),
7230
7469
  [METHOD_SECTION_ORDER_KEY]: encodeMethodSectionOrder(branding.methodSectionOrder)
7231
7470
  };
@@ -7496,6 +7735,118 @@ function parseImportedBranding(raw) {
7496
7735
  ),
7497
7736
  airwallexValidTint: parseBool(root["airwallexValidTint"], dflt.airwallexValidTint),
7498
7737
  airwallexNetworkMarks: parseBool(root["airwallexNetworkMarks"], dflt.airwallexNetworkMarks),
7738
+ stripeTheme: pickEnum(root["stripeTheme"], STRIPE_THEMES, dflt.stripeTheme),
7739
+ stripeInputs: pickEnum(
7740
+ root["stripeInputs"],
7741
+ STRIPE_INPUT_STYLES,
7742
+ dflt.stripeInputs
7743
+ ),
7744
+ stripeLabels: pickEnum(
7745
+ root["stripeLabels"],
7746
+ STRIPE_LABEL_PLACEMENTS,
7747
+ dflt.stripeLabels
7748
+ ),
7749
+ stripeSpacing: pickEnum(
7750
+ root["stripeSpacing"],
7751
+ STRIPE_SPACINGS,
7752
+ dflt.stripeSpacing
7753
+ ),
7754
+ stripeFieldFontSize: pickEnum(
7755
+ root["stripeFieldFontSize"],
7756
+ CARD_FIELD_FONT_SIZES,
7757
+ dflt.stripeFieldFontSize
7758
+ ),
7759
+ stripeFieldWeight: pickEnum(
7760
+ root["stripeFieldWeight"],
7761
+ CARD_FIELD_WEIGHTS,
7762
+ dflt.stripeFieldWeight
7763
+ ),
7764
+ stripeFocusRing: pickEnum(
7765
+ root["stripeFocusRing"],
7766
+ CARD_FOCUS_RINGS,
7767
+ dflt.stripeFocusRing
7768
+ ),
7769
+ stripeDisableAnimations: parseBool(
7770
+ root["stripeDisableAnimations"],
7771
+ dflt.stripeDisableAnimations
7772
+ ),
7773
+ paypalCardLayout: pickEnum(
7774
+ root["paypalCardLayout"],
7775
+ PAYPAL_CARD_LAYOUTS,
7776
+ dflt.paypalCardLayout
7777
+ ),
7778
+ paypalLabelStyle: pickEnum(
7779
+ root["paypalLabelStyle"],
7780
+ PAYPAL_LABEL_STYLES,
7781
+ dflt.paypalLabelStyle
7782
+ ),
7783
+ paypalFieldChrome: pickEnum(
7784
+ root["paypalFieldChrome"],
7785
+ CARD_FIELD_CHROMES,
7786
+ dflt.paypalFieldChrome
7787
+ ),
7788
+ paypalFieldFontSize: pickEnum(
7789
+ root["paypalFieldFontSize"],
7790
+ CARD_FIELD_FONT_SIZES,
7791
+ dflt.paypalFieldFontSize
7792
+ ),
7793
+ paypalFieldWeight: pickEnum(
7794
+ root["paypalFieldWeight"],
7795
+ CARD_FIELD_WEIGHTS,
7796
+ dflt.paypalFieldWeight
7797
+ ),
7798
+ paypalFocusRing: pickEnum(
7799
+ root["paypalFocusRing"],
7800
+ CARD_FOCUS_RINGS,
7801
+ dflt.paypalFocusRing
7802
+ ),
7803
+ paypalValidTint: parseBool(root["paypalValidTint"], dflt.paypalValidTint),
7804
+ nomupayFormStyle: pickEnum(
7805
+ root["nomupayFormStyle"],
7806
+ NOMUPAY_FORM_STYLES,
7807
+ dflt.nomupayFormStyle
7808
+ ),
7809
+ nomupayShowLabels: parseBool(root["nomupayShowLabels"], dflt.nomupayShowLabels),
7810
+ nomupayShowPlaceholders: parseBool(
7811
+ root["nomupayShowPlaceholders"],
7812
+ dflt.nomupayShowPlaceholders
7813
+ ),
7814
+ nomupayShowCvvHint: parseBool(root["nomupayShowCvvHint"], dflt.nomupayShowCvvHint),
7815
+ nomupayFieldChrome: pickEnum(
7816
+ root["nomupayFieldChrome"],
7817
+ CARD_FIELD_CHROMES,
7818
+ dflt.nomupayFieldChrome
7819
+ ),
7820
+ nomupayFieldFontSize: pickEnum(
7821
+ root["nomupayFieldFontSize"],
7822
+ CARD_FIELD_FONT_SIZES,
7823
+ dflt.nomupayFieldFontSize
7824
+ ),
7825
+ nomupayFocusRing: pickEnum(
7826
+ root["nomupayFocusRing"],
7827
+ CARD_FOCUS_RINGS,
7828
+ dflt.nomupayFocusRing
7829
+ ),
7830
+ nomupayApplePayButtonStyle: pickEnum(
7831
+ root["nomupayApplePayButtonStyle"],
7832
+ APPLE_PAY_BUTTON_STYLES,
7833
+ dflt.nomupayApplePayButtonStyle
7834
+ ),
7835
+ nomupayApplePayButtonType: pickEnum(
7836
+ root["nomupayApplePayButtonType"],
7837
+ APPLE_PAY_BUTTON_TYPES,
7838
+ dflt.nomupayApplePayButtonType
7839
+ ),
7840
+ nomupayGooglePayButtonColor: pickEnum(
7841
+ root["nomupayGooglePayButtonColor"],
7842
+ GOOGLE_PAY_BUTTON_COLORS,
7843
+ dflt.nomupayGooglePayButtonColor
7844
+ ),
7845
+ nomupayGooglePayButtonType: pickEnum(
7846
+ root["nomupayGooglePayButtonType"],
7847
+ GOOGLE_PAY_BUTTON_TYPES,
7848
+ dflt.nomupayGooglePayButtonType
7849
+ ),
7499
7850
  customCss: sStr(root["customCss"], dflt.customCss).slice(0, CUSTOM_CSS_MAX_LENGTH)
7500
7851
  };
7501
7852
  }
@@ -8415,6 +8766,27 @@ export {
8415
8766
  airwallexFieldFontPx,
8416
8767
  airwallexFieldWeightValue,
8417
8768
  AIRWALLEX_NETWORK_MARKS,
8769
+ CARD_FIELD_CHROMES,
8770
+ CARD_FIELD_FONT_SIZES,
8771
+ CARD_FIELD_WEIGHTS,
8772
+ CARD_FOCUS_RINGS,
8773
+ cardFieldFontPx,
8774
+ cardFieldWeightValue,
8775
+ STRIPE_THEMES,
8776
+ resolveStripeTheme,
8777
+ STRIPE_INPUT_STYLES,
8778
+ STRIPE_LABEL_PLACEMENTS,
8779
+ STRIPE_SPACINGS,
8780
+ stripeSpacingValues,
8781
+ PAYPAL_CARD_LAYOUTS,
8782
+ PAYPAL_LABEL_STYLES,
8783
+ NOMUPAY_FORM_STYLES,
8784
+ APPLE_PAY_BUTTON_STYLES,
8785
+ resolveApplePayButtonStyle,
8786
+ APPLE_PAY_BUTTON_TYPES,
8787
+ GOOGLE_PAY_BUTTON_COLORS,
8788
+ resolveGooglePayButtonColor,
8789
+ GOOGLE_PAY_BUTTON_TYPES,
8418
8790
  surchargeShowsLabel,
8419
8791
  surchargeFigurePlan,
8420
8792
  readableInkOn,
@@ -8540,4 +8912,4 @@ export {
8540
8912
  decodeNativePanes,
8541
8913
  encodeNativePanes
8542
8914
  };
8543
- //# sourceMappingURL=chunk-CRR4YKJV.js.map
8915
+ //# sourceMappingURL=chunk-GV7R45LR.js.map