@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.
- package/dist/{chunk-3NOAX6WN.js → chunk-FRH5BWGL.js} +51 -17
- package/dist/{chunk-3NOAX6WN.js.map → chunk-FRH5BWGL.js.map} +1 -1
- package/dist/index.cjs +50 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -5
- package/dist/index.d.ts +56 -5
- package/dist/index.js +1 -1
- package/dist/internal.cjs +50 -16
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +17 -18
package/dist/index.cjs
CHANGED
|
@@ -11569,6 +11569,21 @@ function withoutCredentialHeaders(extra) {
|
|
|
11569
11569
|
}
|
|
11570
11570
|
return out;
|
|
11571
11571
|
}
|
|
11572
|
+
function vaultFormQuery(params) {
|
|
11573
|
+
const look = params?.appearance;
|
|
11574
|
+
return {
|
|
11575
|
+
locale: params?.locale,
|
|
11576
|
+
form_surface: look?.surface,
|
|
11577
|
+
form_text: look?.text,
|
|
11578
|
+
form_border: look?.border,
|
|
11579
|
+
form_accent: look?.accent,
|
|
11580
|
+
form_danger: look?.danger,
|
|
11581
|
+
form_font: look?.font,
|
|
11582
|
+
form_radius: look?.radius,
|
|
11583
|
+
form_size: look?.size,
|
|
11584
|
+
form_labels: look?.labels
|
|
11585
|
+
};
|
|
11586
|
+
}
|
|
11572
11587
|
function withoutHeader(headers, name) {
|
|
11573
11588
|
const out = {};
|
|
11574
11589
|
for (const [key, value] of Object.entries(headers)) {
|
|
@@ -11988,21 +12003,31 @@ var CheckoutSession = class {
|
|
|
11988
12003
|
* `GET /payment-link/{merchantId}/{paymentId}/vault/collect-session`
|
|
11989
12004
|
*/
|
|
11990
12005
|
async vaultCollectSession(options, params) {
|
|
11991
|
-
const look = params?.appearance;
|
|
11992
12006
|
return this.client.request("GET", `${this.linkBase}/vault/collect-session`, {
|
|
11993
12007
|
...options,
|
|
11994
|
-
query:
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12008
|
+
query: vaultFormQuery(params),
|
|
12009
|
+
headers: this.bearerHeaders(options?.headers)
|
|
12010
|
+
});
|
|
12011
|
+
}
|
|
12012
|
+
/**
|
|
12013
|
+
* The saved cards the buyer of this payment can pay with, on a shop whose
|
|
12014
|
+
* vault keeps the security code itself (Enigma Vault): the cards of the
|
|
12015
|
+
* payment's own customer that the shop's vault holds, most recently used
|
|
12016
|
+
* first. A payment without a customer answers an empty list.
|
|
12017
|
+
*
|
|
12018
|
+
* Draw saved cards from this list, not from the customer's payment-method
|
|
12019
|
+
* list: that one also carries cards the security-code form cannot open.
|
|
12020
|
+
* To pay with one, mint its form with {@link vaultSecurityCodeSession},
|
|
12021
|
+
* and confirm with its `payment_token` once the form reports the code
|
|
12022
|
+
* stored.
|
|
12023
|
+
*
|
|
12024
|
+
* A shop without a vault, and a VGS shop, answer `400`.
|
|
12025
|
+
*
|
|
12026
|
+
* `GET /payment-link/{merchantId}/{paymentId}/vault/saved-cards`
|
|
12027
|
+
*/
|
|
12028
|
+
async vaultSavedCards(options) {
|
|
12029
|
+
return this.client.request("GET", `${this.linkBase}/vault/saved-cards`, {
|
|
12030
|
+
...options,
|
|
12006
12031
|
headers: this.bearerHeaders(options?.headers)
|
|
12007
12032
|
});
|
|
12008
12033
|
}
|
|
@@ -12012,15 +12037,24 @@ var CheckoutSession = class {
|
|
|
12012
12037
|
* vault's own form, so it never reaches the checkout; confirm with the saved
|
|
12013
12038
|
* card's `payment_token` once the form reports it stored.
|
|
12014
12039
|
*
|
|
12015
|
-
* `paymentToken` is the saved card's token from
|
|
12040
|
+
* `paymentToken` is the saved card's token from {@link vaultSavedCards}. A
|
|
12016
12041
|
* VGS shop answers `400`: VGS re-collects the code with Collect.
|
|
12017
12042
|
*
|
|
12043
|
+
* `params.appearance` asks for a form styled to match the page, as on
|
|
12044
|
+
* {@link vaultCollectSession}. The styled form is the security-code field
|
|
12045
|
+
* alone, with no label: draw the label beside the frame, and size the frame
|
|
12046
|
+
* to the answer's `height`. `labels` is ignored. If the vault refuses the
|
|
12047
|
+
* styled form the answer is the plain one, without `height`.
|
|
12048
|
+
*
|
|
12049
|
+
* The form stores one code and then disables itself. After a failed
|
|
12050
|
+
* payment, mint a new form before the buyer tries again.
|
|
12051
|
+
*
|
|
12018
12052
|
* `GET /payment-link/{merchantId}/{paymentId}/vault/security-code-session`
|
|
12019
12053
|
*/
|
|
12020
|
-
async vaultSecurityCodeSession(paymentToken, options) {
|
|
12054
|
+
async vaultSecurityCodeSession(paymentToken, options, params) {
|
|
12021
12055
|
return this.client.request("GET", `${this.linkBase}/vault/security-code-session`, {
|
|
12022
12056
|
...options,
|
|
12023
|
-
query: { payment_token: paymentToken },
|
|
12057
|
+
query: { payment_token: paymentToken, ...vaultFormQuery(params) },
|
|
12024
12058
|
headers: this.bearerHeaders(options?.headers)
|
|
12025
12059
|
});
|
|
12026
12060
|
}
|