@agent-cards/sdk 0.23.28 → 0.24.1
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/CHANGELOG.md +84 -0
- package/PREFLIGHT.md +7 -1
- package/README.md +197 -102
- package/dist/aci.d.ts +52 -22
- package/dist/aci.js +79 -15
- package/dist/adyen-merchant-hosted.generated.d.ts +2 -2
- package/dist/adyen-merchant-hosted.generated.js +586 -55
- package/dist/agent-amount.generated.js +1 -1
- package/dist/agentcard.d.ts +4 -5
- package/dist/agentcard.js +4 -5
- package/dist/amadeus.d.ts +9 -3
- package/dist/amadeus.js +33 -4
- package/dist/api-module.d.ts +1 -7
- package/dist/api-module.js +3 -5
- package/dist/{voice-retry.js → api-retry.js} +1 -1
- package/dist/api-types.d.ts +53 -0
- package/dist/{voice-types.js → api-types.js} +7 -2
- package/dist/approvals.d.ts +166 -0
- package/dist/approvals.js +213 -0
- package/dist/aurus.d.ts +33 -0
- package/dist/aurus.js +75 -0
- package/dist/builtin-registry.generated.js +1 -1
- package/dist/buy.d.ts +20 -101
- package/dist/buy.js +19 -74
- package/dist/capabilities.generated.js +1 -1
- package/dist/card-fields.generated.js +2864 -249
- package/dist/cardlink-vpos.d.ts +43 -0
- package/dist/cardlink-vpos.js +90 -0
- package/dist/cdp.d.ts +3 -13
- package/dist/cdp.js +244 -175
- package/dist/checkout-com.generated.js +5 -1
- package/dist/client.d.ts +170 -22
- package/dist/client.js +281 -40
- package/dist/creditguard.generated.d.ts +4 -4
- package/dist/cybersource-flex.generated.d.ts +39 -1
- package/dist/cybersource-flex.generated.js +100 -11
- package/dist/datatrans.generated.js +22 -1
- package/dist/eghl.d.ts +40 -0
- package/dist/eghl.js +72 -0
- package/dist/elavon-converge.generated.js +5 -3
- package/dist/gmo.generated.js +7 -2
- package/dist/hold.d.ts +8 -0
- package/dist/hold.js +43 -2
- package/dist/hosted-entry.js +4 -0
- package/dist/index.d.ts +9 -15
- package/dist/index.js +6 -10
- package/dist/lifecycle.d.ts +9 -61
- package/dist/lifecycle.js +24 -10
- package/dist/merchant-card-endpoints.generated.d.ts +6 -1
- package/dist/merchant-card-endpoints.generated.js +344 -19
- package/dist/merchant-hosted.d.ts +8 -1
- package/dist/nike-order.d.ts +51 -0
- package/dist/nike-order.js +81 -0
- package/dist/oceanpayment.d.ts +38 -0
- package/dist/oceanpayment.js +70 -0
- package/dist/paddle-tokenex.generated.js +111 -11
- package/dist/payplug.d.ts +41 -0
- package/dist/payplug.js +71 -0
- package/dist/payrails.generated.js +33 -8
- package/dist/pre-claim.d.ts +11 -0
- package/dist/pre-claim.js +130 -7
- package/dist/preflight-capabilities.generated.d.ts +0 -4
- package/dist/preflight-capabilities.generated.js +0 -5
- package/dist/preflight-catalog.json +200 -6
- package/dist/preflight-playwright.d.ts +2 -2
- package/dist/preflight-playwright.js +63 -14
- package/dist/preflight-schemas.json +18 -0
- package/dist/preflight.generated.d.ts +5 -4
- package/dist/preflight.generated.js +63 -3
- package/dist/preparation.d.ts +7 -0
- package/dist/preparation.js +21 -0
- package/dist/prepared-processor.d.ts +18 -5
- package/dist/prepared-processor.js +48 -8
- package/dist/primer.generated.js +2889 -268
- package/dist/processout.generated.d.ts +61 -0
- package/dist/processout.generated.js +577 -0
- package/dist/requests.js +1 -1
- package/dist/shiji-sts.generated.js +111 -11
- package/dist/stripe-checkout.generated.js +2761 -319
- package/dist/substitutions.generated.js +553 -26
- package/dist/tap-payments.generated.js +111 -11
- package/dist/twoc2p.generated.js +111 -11
- package/dist/url-masks/bluesnap.d.ts +2 -0
- package/dist/url-masks/bluesnap.js +15 -0
- package/dist/url-masks/oceanpayment.d.ts +2 -0
- package/dist/url-masks/oceanpayment.js +13 -0
- package/dist/url-masks/payplug.d.ts +2 -0
- package/dist/url-masks/payplug.js +13 -0
- package/dist/url-masks/vtex_payments.d.ts +2 -0
- package/dist/url-masks/vtex_payments.js +12 -0
- package/dist/url-masks.generated.d.ts +1 -1
- package/dist/url-masks.generated.js +6 -2
- package/dist/verifone.generated.js +42 -2
- package/dist/vtex-payments.generated.d.ts +127 -0
- package/dist/vtex-payments.generated.js +544 -0
- package/dist/webhooks.d.ts +2 -2
- package/dist/webhooks.js +2 -2
- package/examples/preflight/kernel-native/inventory.json +1 -1
- package/package.json +6 -8
- package/dist/languages.d.ts +0 -23
- package/dist/languages.js +0 -76
- package/dist/voice-pkce.d.ts +0 -49
- package/dist/voice-pkce.js +0 -147
- package/dist/voice-stream.generated.d.ts +0 -118
- package/dist/voice-stream.generated.js +0 -170
- package/dist/voice-types.d.ts +0 -735
- package/dist/voice.d.ts +0 -373
- package/dist/voice.js +0 -815
- package/readme.test.mjs +0 -53
- /package/dist/{voice-retry.d.ts → api-retry.d.ts} +0 -0
package/dist/aci.d.ts
CHANGED
|
@@ -10,6 +10,20 @@ export type AciLeg = ({
|
|
|
10
10
|
leg: 'refuse';
|
|
11
11
|
code: string;
|
|
12
12
|
} & AciAt);
|
|
13
|
+
/** What one request on a JSON split card is, keyed by the URL its legs share. */
|
|
14
|
+
export type JsonSplitLeg = {
|
|
15
|
+
leg: 'card' | 'absorb' | 'pass';
|
|
16
|
+
group: string;
|
|
17
|
+
psp: string;
|
|
18
|
+
} | {
|
|
19
|
+
leg: 'refuse';
|
|
20
|
+
code: string;
|
|
21
|
+
group: string;
|
|
22
|
+
psp: string;
|
|
23
|
+
namesCard: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** One request on a split card: ACI's, or a JSON split card's. */
|
|
26
|
+
export type SplitLeg = AciLeg | JsonSplitLeg;
|
|
13
27
|
/** The processor id, as the registry and the API name it. */
|
|
14
28
|
export declare const ACI_PSP = "aci";
|
|
15
29
|
/** The dark-launch capability the API serves the ACI recognizer behind (payment-core definitions.js). */
|
|
@@ -43,6 +57,10 @@ export declare const ACI_PAYMENT_UNAPPROVED = "aci_payment_unapproved";
|
|
|
43
57
|
export declare const ACI_PAYMENT_REPEATED = "aci_payment_repeated";
|
|
44
58
|
/** A card-number request on a checkout whose card-number request is running or was answered here. */
|
|
45
59
|
export declare const ACI_CHECKOUT_REUSED = "aci_checkout_reused";
|
|
60
|
+
/** A JSON split card's card request on a URL whose card request is running or was answered here. */
|
|
61
|
+
export declare const SPLIT_CARD_REUSED = "split_card_reused";
|
|
62
|
+
/** A request on a JSON split card's URL that is neither its card request nor a leg its definition names. */
|
|
63
|
+
export declare const SPLIT_CARD_LEG_UNSUPPORTED = "split_card_leg_unsupported";
|
|
46
64
|
/**
|
|
47
65
|
* How many failed checkouts one attachment keeps. A failed checkout only makes its later CVC and
|
|
48
66
|
* expiry requests fail at once instead of after ACI_SIBLING_WAIT_MS, so the oldest are dropped past
|
|
@@ -83,12 +101,20 @@ export declare const ACI_ENGINE_PROBE_MS = 5000;
|
|
|
83
101
|
* Chromium allows.
|
|
84
102
|
*/
|
|
85
103
|
export declare function playwrightReplacesNavigationBody(page: any, probeMs?: number): Promise<boolean>;
|
|
104
|
+
/** A split card's key: an ACI checkout (host and checkout id), or the URL a JSON split card's legs share. */
|
|
105
|
+
type LegAt = {
|
|
106
|
+
host: string;
|
|
107
|
+
checkoutId: string;
|
|
108
|
+
} | {
|
|
109
|
+
group: string;
|
|
110
|
+
};
|
|
86
111
|
/**
|
|
87
|
-
* One attachment's
|
|
88
|
-
* /payment submission is matched against a card-number request
|
|
89
|
-
* answered, never taken on the page's word. Inert (classify returns
|
|
90
|
-
*
|
|
91
|
-
* served
|
|
112
|
+
* One attachment's split cards, keyed by ACI checkout (host and checkout id) or by a JSON split
|
|
113
|
+
* card's URL. Every sibling and every /payment submission is matched against a card-number request
|
|
114
|
+
* this attachment itself paused and answered, never taken on the page's word. Inert (classify returns
|
|
115
|
+
* null) until the registry serves ACI or a JSON split card, which a client reaches only by syncing
|
|
116
|
+
* with the processor's capability, so a build or an API that never served one leaves every request
|
|
117
|
+
* exactly as before.
|
|
92
118
|
*/
|
|
93
119
|
export declare class AciGate {
|
|
94
120
|
private readonly vault;
|
|
@@ -100,10 +126,22 @@ export declare class AciGate {
|
|
|
100
126
|
private current;
|
|
101
127
|
constructor(vault: {
|
|
102
128
|
recognizesProcessor?: (psp: string) => boolean;
|
|
129
|
+
recognizerOf?: (url: string, method?: string) => unknown;
|
|
103
130
|
} | undefined, siblingWaitMs?: number);
|
|
104
131
|
private served;
|
|
105
|
-
/**
|
|
106
|
-
|
|
132
|
+
/**
|
|
133
|
+
* What this request is: an ACI leg when the registry serves ACI and it is a POST to an ACI checkout, a JSON split
|
|
134
|
+
* card's leg when the registry serves a recognizer for it whose JSON definition names a `splitCard`; null leaves it
|
|
135
|
+
* to the other gates.
|
|
136
|
+
*/
|
|
137
|
+
classify(url: string, method: string, body: string | null | undefined): SplitLeg | null;
|
|
138
|
+
/**
|
|
139
|
+
* A JSON split card's leg, judged as payment-core judges it: the processor's own refusal first, then the card
|
|
140
|
+
* request, then the leg its definition names by the body's members; any other body is refused, never forwarded.
|
|
141
|
+
*/
|
|
142
|
+
private jsonLeg;
|
|
143
|
+
/** The code a card request this attachment cannot begin is refused with (begin answered false). */
|
|
144
|
+
reuseCode(url: string): string;
|
|
107
145
|
/**
|
|
108
146
|
* Playwright's route predicate sees only the URL. The card-number, CVC, expiry and holder
|
|
109
147
|
* requests share the recognizer's URL; /payment and /registration do not, so they are routed
|
|
@@ -115,16 +153,13 @@ export declare class AciGate {
|
|
|
115
153
|
* False, with nothing changed, for a checkout whose card-number request is still running or was
|
|
116
154
|
* answered here: its group keeps its answer and its one /payment, so a second approval can never
|
|
117
155
|
* reopen that checkout for another /payment. The pre-claim gate refuses such a request first
|
|
118
|
-
* (reused, aci_checkout_reused), before it claims a preparation; the adapters
|
|
119
|
-
* A refused begin leaves the running approval it found running. A
|
|
120
|
-
* request failed begins again.
|
|
156
|
+
* (reused, aci_checkout_reused or split_card_reused), before it claims a preparation; the adapters
|
|
157
|
+
* fail it here too (reuseCode). A refused begin leaves the running approval it found running. A
|
|
158
|
+
* checkout whose card-number request failed begins again.
|
|
121
159
|
*/
|
|
122
160
|
begin(url: string, method: string, body: string | null | undefined, merchantOrigin: string | undefined): boolean;
|
|
123
161
|
/** Whether this checkout's card-number request is running or was answered here: another one is refused. */
|
|
124
|
-
reused(leg:
|
|
125
|
-
host: string;
|
|
126
|
-
checkoutId: string;
|
|
127
|
-
}): boolean;
|
|
162
|
+
reused(leg: LegAt): boolean;
|
|
128
163
|
private live;
|
|
129
164
|
/** Drops the oldest failed checkouts past ACI_FAILED_CHECKOUTS_KEPT; running and answered ones stay. */
|
|
130
165
|
private prune;
|
|
@@ -139,20 +174,15 @@ export declare class AciGate {
|
|
|
139
174
|
* until a card-number request begins. A refused request that names no card number, such as a
|
|
140
175
|
* fingerprint longer than ACI takes, says nothing about the card-number request a later Pay sends,
|
|
141
176
|
* so its siblings keep waiting for it. A running or answered card-number request keeps its siblings.
|
|
177
|
+
* A JSON split card's refused request names the card when it holds a card field its recognizer declares.
|
|
142
178
|
*/
|
|
143
|
-
refused(leg:
|
|
144
|
-
host: string;
|
|
145
|
-
checkoutId: string;
|
|
146
|
-
}, body: string | null | undefined): void;
|
|
179
|
+
refused(leg: SplitLeg, body: string | null | undefined): void;
|
|
147
180
|
/**
|
|
148
181
|
* A sibling leg (the page's CVC or expiry request): the answer to hand it, once its checkout's
|
|
149
182
|
* card-number request was answered, or null when that request failed, never began within
|
|
150
183
|
* siblingWaitMs, or cannot be answered here. Never resolves to anything the page did not get.
|
|
151
184
|
*/
|
|
152
|
-
hold(leg:
|
|
153
|
-
host: string;
|
|
154
|
-
checkoutId: string;
|
|
155
|
-
}): Promise<AciAnswer | null>;
|
|
185
|
+
hold(leg: LegAt): Promise<AciAnswer | null>;
|
|
156
186
|
/**
|
|
157
187
|
* The page's /payment submission: continue it with the body to send, or refuse it. It continues
|
|
158
188
|
* only as a frame navigation (the widget's form posting into its hidden iframe; a script's fetch
|
package/dist/aci.js
CHANGED
|
@@ -25,7 +25,17 @@
|
|
|
25
25
|
// It continues only as a frame navigation, which is how the widget's form posts it into its
|
|
26
26
|
// hidden iframe, and a classic-mode body only on a browser shown to send the body the SDK
|
|
27
27
|
// replaced on a navigation (Chromium; see playwrightReplacesNavigationBody).
|
|
28
|
+
//
|
|
29
|
+
// A JSON split card is held by the same rules: a served recognizer whose JSON definition names a
|
|
30
|
+
// `splitCard` (payment-core card-fields.js splitCardLeg), where each card field sends its own JSON
|
|
31
|
+
// object to one URL, and that URL stands where ACI's checkout id stands. Its card request pauses;
|
|
32
|
+
// its code and expiry requests are held and answered with that request's answer; a holder request
|
|
33
|
+
// continues; a second card request on a URL whose first one is running or was answered is refused
|
|
34
|
+
// (split_card_reused), except the page's retry while that approval is still open, which the
|
|
35
|
+
// adapters bind to it; anything the processor's own gate refuses, or that is no leg, is refused. It
|
|
36
|
+
// has no /payment submission.
|
|
28
37
|
import { ACI_CARD_FIELD, aciBrandOfCardLeg as brandOfCardLeg, aciEndpoint, classifyAciRequest, prepareAciContinuation, sanitizeAciResponse, } from './aci.generated.js';
|
|
38
|
+
import { cardRequestRefusal, carriesCardFields, splitCardLeg } from './card-fields.generated.js';
|
|
29
39
|
const classifyLeg = classifyAciRequest;
|
|
30
40
|
const judgePayment = prepareAciContinuation;
|
|
31
41
|
/** The processor id, as the registry and the API name it. */
|
|
@@ -45,6 +55,10 @@ export const ACI_PAYMENT_UNAPPROVED = 'aci_payment_unapproved';
|
|
|
45
55
|
export const ACI_PAYMENT_REPEATED = 'aci_payment_repeated';
|
|
46
56
|
/** A card-number request on a checkout whose card-number request is running or was answered here. */
|
|
47
57
|
export const ACI_CHECKOUT_REUSED = 'aci_checkout_reused';
|
|
58
|
+
/** A JSON split card's card request on a URL whose card request is running or was answered here. */
|
|
59
|
+
export const SPLIT_CARD_REUSED = 'split_card_reused';
|
|
60
|
+
/** A request on a JSON split card's URL that is neither its card request nor a leg its definition names. */
|
|
61
|
+
export const SPLIT_CARD_LEG_UNSUPPORTED = 'split_card_leg_unsupported';
|
|
48
62
|
/**
|
|
49
63
|
* How many failed checkouts one attachment keeps. A failed checkout only makes its later CVC and
|
|
50
64
|
* expiry requests fail at once instead of after ACI_SIBLING_WAIT_MS, so the oldest are dropped past
|
|
@@ -147,7 +161,8 @@ export async function playwrightReplacesNavigationBody(page, probeMs = ACI_ENGIN
|
|
|
147
161
|
clearTimeout(timer);
|
|
148
162
|
}
|
|
149
163
|
}
|
|
150
|
-
const groupKey = (leg) => `${leg.host}/${leg.checkoutId}
|
|
164
|
+
const groupKey = (leg) => ('group' in leg ? leg.group : `${leg.host}/${leg.checkoutId}`);
|
|
165
|
+
const upper = (method) => (typeof method === 'string' ? method.toUpperCase() : method);
|
|
151
166
|
/** Whether a form body has a card.number key, whatever else it carries and however it broke the rules. */
|
|
152
167
|
function namesCardNumber(body) {
|
|
153
168
|
if (typeof body !== 'string')
|
|
@@ -162,12 +177,33 @@ function namesCardNumber(body) {
|
|
|
162
177
|
}
|
|
163
178
|
});
|
|
164
179
|
}
|
|
180
|
+
/** Whether a JSON body names a card field its recognizer declares, whatever that member holds and however the body broke the rules. */
|
|
181
|
+
function namesJsonCardField(rec, body) {
|
|
182
|
+
let root;
|
|
183
|
+
try {
|
|
184
|
+
root = typeof body === 'string' ? JSON.parse(body) : undefined;
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const paths = Array.isArray(rec.jsonCardFields) ? rec.jsonCardFields : [];
|
|
190
|
+
return paths.some((path) => {
|
|
191
|
+
let node = root;
|
|
192
|
+
return Array.isArray(path) && path.length > 0 && path.every((step) => {
|
|
193
|
+
if (!node || typeof node !== 'object' || !Object.prototype.hasOwnProperty.call(node, step))
|
|
194
|
+
return false;
|
|
195
|
+
node = node[step];
|
|
196
|
+
return true;
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
165
200
|
/**
|
|
166
|
-
* One attachment's
|
|
167
|
-
* /payment submission is matched against a card-number request
|
|
168
|
-
* answered, never taken on the page's word. Inert (classify returns
|
|
169
|
-
*
|
|
170
|
-
* served
|
|
201
|
+
* One attachment's split cards, keyed by ACI checkout (host and checkout id) or by a JSON split
|
|
202
|
+
* card's URL. Every sibling and every /payment submission is matched against a card-number request
|
|
203
|
+
* this attachment itself paused and answered, never taken on the page's word. Inert (classify returns
|
|
204
|
+
* null) until the registry serves ACI or a JSON split card, which a client reaches only by syncing
|
|
205
|
+
* with the processor's capability, so a build or an API that never served one leaves every request
|
|
206
|
+
* exactly as before.
|
|
171
207
|
*/
|
|
172
208
|
export class AciGate {
|
|
173
209
|
vault;
|
|
@@ -184,11 +220,36 @@ export class AciGate {
|
|
|
184
220
|
served() {
|
|
185
221
|
return typeof this.vault?.recognizesProcessor === 'function' && this.vault.recognizesProcessor(ACI_PSP) === true;
|
|
186
222
|
}
|
|
187
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* What this request is: an ACI leg when the registry serves ACI and it is a POST to an ACI checkout, a JSON split
|
|
225
|
+
* card's leg when the registry serves a recognizer for it whose JSON definition names a `splitCard`; null leaves it
|
|
226
|
+
* to the other gates.
|
|
227
|
+
*/
|
|
188
228
|
classify(url, method, body) {
|
|
189
|
-
|
|
229
|
+
return (this.served() ? classifyLeg({ url, method: upper(method), body }) : null) ?? this.jsonLeg(url, method, body);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* A JSON split card's leg, judged as payment-core judges it: the processor's own refusal first, then the card
|
|
233
|
+
* request, then the leg its definition names by the body's members; any other body is refused, never forwarded.
|
|
234
|
+
*/
|
|
235
|
+
jsonLeg(url, method, body) {
|
|
236
|
+
const rec = typeof this.vault?.recognizerOf === 'function' ? this.vault.recognizerOf(url, upper(method)) : null;
|
|
237
|
+
if (!rec || rec.encoding !== 'json' || !rec.splitCard || typeof rec.splitCard !== 'object' || typeof rec.psp !== 'string')
|
|
190
238
|
return null;
|
|
191
|
-
|
|
239
|
+
const at = { group: url, psp: rec.psp };
|
|
240
|
+
const refusal = cardRequestRefusal(rec, url, body);
|
|
241
|
+
if (typeof refusal === 'string')
|
|
242
|
+
return { leg: 'refuse', code: refusal, namesCard: namesJsonCardField(rec, body), ...at };
|
|
243
|
+
if (carriesCardFields(rec, body))
|
|
244
|
+
return { leg: 'card', ...at };
|
|
245
|
+
const leg = splitCardLeg(rec, body);
|
|
246
|
+
if (leg === 'absorb' || leg === 'pass')
|
|
247
|
+
return { leg, ...at };
|
|
248
|
+
return { leg: 'refuse', code: SPLIT_CARD_LEG_UNSUPPORTED, namesCard: namesJsonCardField(rec, body), ...at };
|
|
249
|
+
}
|
|
250
|
+
/** The code a card request this attachment cannot begin is refused with (begin answered false). */
|
|
251
|
+
reuseCode(url) {
|
|
252
|
+
return aciEndpoint(url) !== null ? ACI_CHECKOUT_REUSED : SPLIT_CARD_REUSED;
|
|
192
253
|
}
|
|
193
254
|
/**
|
|
194
255
|
* Playwright's route predicate sees only the URL. The card-number, CVC, expiry and holder
|
|
@@ -203,12 +264,12 @@ export class AciGate {
|
|
|
203
264
|
* False, with nothing changed, for a checkout whose card-number request is still running or was
|
|
204
265
|
* answered here: its group keeps its answer and its one /payment, so a second approval can never
|
|
205
266
|
* reopen that checkout for another /payment. The pre-claim gate refuses such a request first
|
|
206
|
-
* (reused, aci_checkout_reused), before it claims a preparation; the adapters
|
|
207
|
-
* A refused begin leaves the running approval it found running. A
|
|
208
|
-
* request failed begins again.
|
|
267
|
+
* (reused, aci_checkout_reused or split_card_reused), before it claims a preparation; the adapters
|
|
268
|
+
* fail it here too (reuseCode). A refused begin leaves the running approval it found running. A
|
|
269
|
+
* checkout whose card-number request failed begins again.
|
|
209
270
|
*/
|
|
210
271
|
begin(url, method, body, merchantOrigin) {
|
|
211
|
-
const leg = classifyLeg({ url, method:
|
|
272
|
+
const leg = classifyLeg({ url, method: upper(method), body }) ?? this.jsonLeg(url, method, body);
|
|
212
273
|
if (leg?.leg !== 'card') {
|
|
213
274
|
this.current = null;
|
|
214
275
|
return true;
|
|
@@ -252,7 +313,9 @@ export class AciGate {
|
|
|
252
313
|
/** The card-number request's answer reached the page; its siblings get the same answer. */
|
|
253
314
|
answered(url, answer, authorizationId) {
|
|
254
315
|
const endpoint = aciEndpoint(url);
|
|
255
|
-
|
|
316
|
+
// A JSON split card's legs share its URL; an ACI URL counts only as a checkout's leg URL.
|
|
317
|
+
const key = endpoint === null ? url : endpoint.kind === 'leg' ? groupKey(endpoint) : null;
|
|
318
|
+
if (key === null || this.current !== key)
|
|
256
319
|
return;
|
|
257
320
|
const group = this.groups.get(this.current);
|
|
258
321
|
if (!group || group.state !== 'running')
|
|
@@ -284,9 +347,10 @@ export class AciGate {
|
|
|
284
347
|
* until a card-number request begins. A refused request that names no card number, such as a
|
|
285
348
|
* fingerprint longer than ACI takes, says nothing about the card-number request a later Pay sends,
|
|
286
349
|
* so its siblings keep waiting for it. A running or answered card-number request keeps its siblings.
|
|
350
|
+
* A JSON split card's refused request names the card when it holds a card field its recognizer declares.
|
|
287
351
|
*/
|
|
288
352
|
refused(leg, body) {
|
|
289
|
-
if (!namesCardNumber(body))
|
|
353
|
+
if (!('group' in leg ? leg.leg === 'refuse' && leg.namesCard : namesCardNumber(body)))
|
|
290
354
|
return;
|
|
291
355
|
const key = groupKey(leg);
|
|
292
356
|
const known = this.groups.get(key);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare var MERCHANT_EXCHANGES_MAX: number;
|
|
2
2
|
declare var MERCHANT_PROFILE_RECOGNIZERS: any;
|
|
3
3
|
declare function declaredEndpointRefusal(endpoint: any): string | null;
|
|
4
|
-
declare function isAdyenWebJweCompact(s: any): boolean;
|
|
5
4
|
declare function sha256Hex(input: any): string;
|
|
5
|
+
declare function isAdyenWebJweCompact(s: any): boolean;
|
|
6
6
|
declare function merchantAmountFromResponses(profile: any, input: any): {
|
|
7
7
|
ok: boolean;
|
|
8
8
|
code: any;
|
|
@@ -240,7 +240,7 @@ declare function merchantTotalFromResponses(profileId: any, input: any): {
|
|
|
240
240
|
bodyAmount: string;
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
|
-
declare function merchantProfileUrlRelation(profileId: any, rawUrl: any): "
|
|
243
|
+
declare function merchantProfileUrlRelation(profileId: any, rawUrl: any): "other" | "sibling" | "endpoint" | "then" | null;
|
|
244
244
|
declare function carriesAdyenCardCiphertext(body: any): any;
|
|
245
245
|
declare function classifyMerchantBody(profileId: any, body: any): Readonly<{
|
|
246
246
|
verdict: "pass";
|