@delopay/sdk 0.234.0 → 0.235.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.
@@ -11305,6 +11305,21 @@ function withoutCredentialHeaders(extra) {
11305
11305
  }
11306
11306
  return out;
11307
11307
  }
11308
+ function vaultFormQuery(params) {
11309
+ const look = params?.appearance;
11310
+ return {
11311
+ locale: params?.locale,
11312
+ form_surface: look?.surface,
11313
+ form_text: look?.text,
11314
+ form_border: look?.border,
11315
+ form_accent: look?.accent,
11316
+ form_danger: look?.danger,
11317
+ form_font: look?.font,
11318
+ form_radius: look?.radius,
11319
+ form_size: look?.size,
11320
+ form_labels: look?.labels
11321
+ };
11322
+ }
11308
11323
  function withoutHeader(headers, name) {
11309
11324
  const out = {};
11310
11325
  for (const [key, value] of Object.entries(headers)) {
@@ -11724,21 +11739,31 @@ var CheckoutSession = class {
11724
11739
  * `GET /payment-link/{merchantId}/{paymentId}/vault/collect-session`
11725
11740
  */
11726
11741
  async vaultCollectSession(options, params) {
11727
- const look = params?.appearance;
11728
11742
  return this.client.request("GET", `${this.linkBase}/vault/collect-session`, {
11729
11743
  ...options,
11730
- query: {
11731
- locale: params?.locale,
11732
- form_surface: look?.surface,
11733
- form_text: look?.text,
11734
- form_border: look?.border,
11735
- form_accent: look?.accent,
11736
- form_danger: look?.danger,
11737
- form_font: look?.font,
11738
- form_radius: look?.radius,
11739
- form_size: look?.size,
11740
- form_labels: look?.labels
11741
- },
11744
+ query: vaultFormQuery(params),
11745
+ headers: this.bearerHeaders(options?.headers)
11746
+ });
11747
+ }
11748
+ /**
11749
+ * The saved cards the buyer of this payment can pay with, on a shop whose
11750
+ * vault keeps the security code itself (Enigma Vault): the cards of the
11751
+ * payment's own customer that the shop's vault holds, most recently used
11752
+ * first. A payment without a customer answers an empty list.
11753
+ *
11754
+ * Draw saved cards from this list, not from the customer's payment-method
11755
+ * list: that one also carries cards the security-code form cannot open.
11756
+ * To pay with one, mint its form with {@link vaultSecurityCodeSession},
11757
+ * and confirm with its `payment_token` once the form reports the code
11758
+ * stored.
11759
+ *
11760
+ * A shop without a vault, and a VGS shop, answer `400`.
11761
+ *
11762
+ * `GET /payment-link/{merchantId}/{paymentId}/vault/saved-cards`
11763
+ */
11764
+ async vaultSavedCards(options) {
11765
+ return this.client.request("GET", `${this.linkBase}/vault/saved-cards`, {
11766
+ ...options,
11742
11767
  headers: this.bearerHeaders(options?.headers)
11743
11768
  });
11744
11769
  }
@@ -11748,15 +11773,24 @@ var CheckoutSession = class {
11748
11773
  * vault's own form, so it never reaches the checkout; confirm with the saved
11749
11774
  * card's `payment_token` once the form reports it stored.
11750
11775
  *
11751
- * `paymentToken` is the saved card's token from the payment-method list. A
11776
+ * `paymentToken` is the saved card's token from {@link vaultSavedCards}. A
11752
11777
  * VGS shop answers `400`: VGS re-collects the code with Collect.
11753
11778
  *
11779
+ * `params.appearance` asks for a form styled to match the page, as on
11780
+ * {@link vaultCollectSession}. The styled form is the security-code field
11781
+ * alone, with no label: draw the label beside the frame, and size the frame
11782
+ * to the answer's `height`. `labels` is ignored. If the vault refuses the
11783
+ * styled form the answer is the plain one, without `height`.
11784
+ *
11785
+ * The form stores one code and then disables itself. After a failed
11786
+ * payment, mint a new form before the buyer tries again.
11787
+ *
11754
11788
  * `GET /payment-link/{merchantId}/{paymentId}/vault/security-code-session`
11755
11789
  */
11756
- async vaultSecurityCodeSession(paymentToken, options) {
11790
+ async vaultSecurityCodeSession(paymentToken, options, params) {
11757
11791
  return this.client.request("GET", `${this.linkBase}/vault/security-code-session`, {
11758
11792
  ...options,
11759
- query: { payment_token: paymentToken },
11793
+ query: { payment_token: paymentToken, ...vaultFormQuery(params) },
11760
11794
  headers: this.bearerHeaders(options?.headers)
11761
11795
  });
11762
11796
  }
@@ -12611,4 +12645,4 @@ export {
12611
12645
  decodeNativePanes,
12612
12646
  encodeNativePanes
12613
12647
  };
12614
- //# sourceMappingURL=chunk-3NOAX6WN.js.map
12648
+ //# sourceMappingURL=chunk-FRH5BWGL.js.map