@agent-cards/sdk 0.20.0 → 0.22.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.
Files changed (111) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/PREFLIGHT.md +34 -0
  3. package/README.md +1217 -15
  4. package/dist/aci.d.ts +173 -0
  5. package/dist/aci.generated.d.ts +87 -0
  6. package/dist/aci.generated.js +306 -0
  7. package/dist/aci.js +371 -0
  8. package/dist/adyen-merchant-hosted.generated.d.ts +3 -3
  9. package/dist/adyen-merchant-hosted.generated.js +283 -49
  10. package/dist/agentcard.d.ts +9 -2
  11. package/dist/agentcard.js +4 -2
  12. package/dist/amadeus-checkout.generated.d.ts +57 -0
  13. package/dist/amadeus-checkout.generated.js +549 -0
  14. package/dist/amadeus.d.ts +41 -0
  15. package/dist/amadeus.js +81 -0
  16. package/dist/builtin-registry.generated.js +1 -1
  17. package/dist/card-endpoint.d.ts +177 -0
  18. package/dist/card-endpoint.js +286 -0
  19. package/dist/card-fields.generated.d.ts +5 -3
  20. package/dist/card-fields.generated.js +284 -7
  21. package/dist/cdp.d.ts +6 -1
  22. package/dist/cdp.js +983 -147
  23. package/dist/client.d.ts +493 -13
  24. package/dist/client.js +1100 -82
  25. package/dist/creditguard.generated.d.ts +79 -0
  26. package/dist/creditguard.generated.js +662 -0
  27. package/dist/cse-body.js +11 -1
  28. package/dist/cybersource-flex.d.ts +183 -0
  29. package/dist/cybersource-flex.generated.d.ts +92 -0
  30. package/dist/cybersource-flex.generated.js +689 -0
  31. package/dist/cybersource-flex.js +275 -0
  32. package/dist/datatrans.d.ts +96 -0
  33. package/dist/datatrans.generated.d.ts +64 -0
  34. package/dist/datatrans.generated.js +426 -0
  35. package/dist/datatrans.js +178 -0
  36. package/dist/elavon-converge.d.ts +37 -0
  37. package/dist/elavon-converge.generated.d.ts +49 -0
  38. package/dist/elavon-converge.generated.js +439 -0
  39. package/dist/elavon-converge.js +84 -0
  40. package/dist/eprotect.d.ts +152 -0
  41. package/dist/eprotect.generated.d.ts +77 -0
  42. package/dist/eprotect.generated.js +498 -0
  43. package/dist/eprotect.js +222 -0
  44. package/dist/gmo.d.ts +63 -0
  45. package/dist/gmo.generated.d.ts +60 -0
  46. package/dist/gmo.generated.js +586 -0
  47. package/dist/gmo.js +119 -0
  48. package/dist/hosted-form.d.ts +3 -2
  49. package/dist/hosted-form.js +3 -2
  50. package/dist/index.d.ts +19 -3
  51. package/dist/index.js +6 -1
  52. package/dist/juspay-gate.d.ts +82 -0
  53. package/dist/juspay-gate.js +126 -0
  54. package/dist/juspay.generated.d.ts +89 -0
  55. package/dist/juspay.generated.js +705 -0
  56. package/dist/lifecycle.d.ts +62 -6
  57. package/dist/lifecycle.js +123 -8
  58. package/dist/merchant-card-endpoints.generated.d.ts +63 -0
  59. package/dist/merchant-card-endpoints.generated.js +1103 -0
  60. package/dist/merchant-hosted.d.ts +4 -1
  61. package/dist/merchant-hosted.js +5 -2
  62. package/dist/merchant-session-probe.d.ts +48 -0
  63. package/dist/merchant-session-probe.js +53 -0
  64. package/dist/merchant-session.generated.d.ts +69 -0
  65. package/dist/merchant-session.generated.js +919 -0
  66. package/dist/payrails.d.ts +133 -0
  67. package/dist/payrails.generated.d.ts +73 -0
  68. package/dist/payrails.generated.js +596 -0
  69. package/dist/payrails.js +305 -0
  70. package/dist/pelecard.d.ts +32 -0
  71. package/dist/pelecard.generated.d.ts +32 -0
  72. package/dist/pelecard.generated.js +283 -0
  73. package/dist/pelecard.js +42 -0
  74. package/dist/pre-claim.d.ts +84 -3
  75. package/dist/pre-claim.js +987 -9
  76. package/dist/preflight-catalog.json +2310 -263
  77. package/dist/preflight-schemas.json +187 -6
  78. package/dist/preflight.generated.d.ts +1 -1
  79. package/dist/preflight.generated.js +247 -4
  80. package/dist/preparation.d.ts +5 -2
  81. package/dist/preparation.js +36 -10
  82. package/dist/prepared-processor.d.ts +86 -5
  83. package/dist/prepared-processor.js +157 -6
  84. package/dist/primer.d.ts +53 -0
  85. package/dist/primer.generated.d.ts +38 -0
  86. package/dist/primer.generated.js +624 -0
  87. package/dist/primer.js +82 -0
  88. package/dist/registry.d.ts +114 -12
  89. package/dist/registry.js +85 -11
  90. package/dist/shiji-sts.d.ts +144 -0
  91. package/dist/shiji-sts.generated.d.ts +72 -0
  92. package/dist/shiji-sts.generated.js +913 -0
  93. package/dist/shiji-sts.js +222 -0
  94. package/dist/stripe-checkout.generated.d.ts +1 -1
  95. package/dist/stripe-checkout.generated.js +735 -10
  96. package/dist/stripe-setup.d.ts +16 -0
  97. package/dist/stripe-setup.js +61 -0
  98. package/dist/substitutions.generated.js +187 -29
  99. package/dist/verifone.d.ts +68 -0
  100. package/dist/verifone.generated.d.ts +51 -0
  101. package/dist/verifone.generated.js +1401 -0
  102. package/dist/verifone.js +119 -0
  103. package/dist/voice-types.d.ts +27 -0
  104. package/dist/voice.d.ts +6 -1
  105. package/dist/voice.js +6 -1
  106. package/dist/wspay.d.ts +41 -0
  107. package/dist/wspay.generated.d.ts +41 -0
  108. package/dist/wspay.generated.js +370 -0
  109. package/dist/wspay.js +65 -0
  110. package/examples/preflight/kernel-native/inventory.json +1 -1
  111. package/package.json +3 -3
@@ -6,26 +6,82 @@ import { isPreparedSpreedlyRequest, isSpreedlyTokenRequest, SPREEDLY_TOKEN_ENDPO
6
6
  import { checkoutComPreparationUrl, isPreparedCheckoutComRequest } from './checkout-com.generated.js';
7
7
  import { classifyDeclaredMerchantRequest, classifyMerchantRequest } from './merchant-hosted.js';
8
8
  import { fiservCapturePinId, fiservPreparationUrl, isPreparedFiservRequest } from './fiserv.js';
9
+ import { cybersourceFlexPreparationUrl, isPreparedCybersourceFlexRequest } from './cybersource-flex.generated.js';
10
+ import { isPreparedAciRequest } from './aci.generated.js';
11
+ import { CREDITGUARD_SANDBOX_HOST, creditguardPageProcessUrl, creditguardPreparationEnvironment, creditguardProcessRefusal, creditguardProcessTxId, } from './creditguard.generated.js';
12
+ import { eprotectPreparationUrl, isPreparedEprotectRequest } from './eprotect.generated.js';
13
+ import { amadeusEnvironment, amadeusPreparationUrls, amadeusRequestRefusal, isPreparedAmadeusRequest } from './amadeus-checkout.generated.js';
14
+ import { isPreparedVerifoneRequest } from './verifone.js';
9
15
  export function preparationMode(psp) {
10
- return psp === 'adyen' || psp === 'fiserv' ? 'cse' : 'token';
16
+ return psp === 'adyen' || psp === 'fiserv' || psp === 'verifone' ? 'cse' : 'token';
17
+ }
18
+ /** The method of the native card request a preparation binds: the registration GET for Worldpay eProtect, a POST for every other processor. */
19
+ export function preparationRequestMethod(psp) {
20
+ return psp === 'worldpay_eprotect' ? 'GET' : 'POST';
11
21
  }
12
22
  /**
13
23
  * Shared endpoint processors cannot attest test/live mode from their URL or key prefix.
14
24
  * Adyen can: test and live are separate hosts and key prefixes. Fiserv's are separate
15
- * hosts too: connect (production) and connect-cert (sandbox).
25
+ * hosts too: connect (production) and connect-cert (sandbox). So are CyberSource
26
+ * Flex's: flex.cybersource.com is live, testflex.cybersource.com is test, and each has
27
+ * its own signing keys. A Verifone preparation pays in the environment of the key its reviewed
28
+ * profile pins.
16
29
  */
17
30
  export function validPreparationEnvironment(psp, environment) {
18
31
  if (psp === 'bambora' || psp === 'mercado_pago' || psp === 'recurly' || psp === 'spreedly')
19
32
  return environment === 'shared';
20
- return ['square', 'braintree', 'worldpay', 'adyen', 'checkout_com', 'paysafe', 'fiserv'].includes(psp) && ['production', 'sandbox'].includes(environment);
33
+ return ['square', 'braintree', 'worldpay', 'adyen', 'checkout_com', 'paysafe', 'fiserv', 'cybersource_flex', 'aci', 'creditguard', 'worldpay_eprotect', 'amadeus_checkout', 'verifone'].includes(psp) && ['production', 'sandbox'].includes(environment);
34
+ }
35
+ /**
36
+ * ACI's prepared endpoint, the literal the API names (backend checkout-prepared-processor.ts): its
37
+ * environment's primary widget host and a checkout id that can never be real, since the merchant
38
+ * mints the checkout only at Pay time. The bind matches the card-number request by host
39
+ * environment and shape instead (matchesPreparedRequest).
40
+ */
41
+ export function aciPreparationUrl(environment) {
42
+ return `https://${environment === 'production' ? 'eu-prod' : 'eu-test'}.oppwa.com/v1/checkouts/prepared`;
43
+ }
44
+ /**
45
+ * A processor whose card request names an id the merchant mints only at Pay time (ACI's checkout
46
+ * id), so no URL can be prepared in advance: whether the adapters can intercept it is asked of the
47
+ * registry (VaultClient.recognizesProcessor), not of the prepared endpoint.
48
+ */
49
+ export function preparationBindsByShape(psp) {
50
+ return psp === 'aci';
51
+ }
52
+ /**
53
+ * The endpoint a CreditGuard preparation stands for, per environment, as the API advertises it: the
54
+ * PPS card submit on pps (production) or ppsuat (sandbox) under the nil transaction id. It only
55
+ * proves the synced registry recognizes CreditGuard. A real submit names the txId of the page the
56
+ * preparation framed and may be on pps2, so it is matched by shape (matchesPreparedRequest), never
57
+ * by equality with this URL.
58
+ */
59
+ export function creditguardPreparationUrl(environment) {
60
+ const host = environment === 'sandbox' ? CREDITGUARD_SANDBOX_HOST : 'pps.creditguard.co.il';
61
+ return `https://${host}/services/v1/txn/00000000-0000-0000-0000-000000000000/process`;
21
62
  }
22
63
  export function preparationEndpoint(psp, environment) {
23
64
  if (!validPreparationEnvironment(psp, environment))
24
65
  throw new Error('unsupported_preparation_processor');
66
+ if (psp === 'cybersource_flex')
67
+ return cybersourceFlexPreparationUrl(environment);
68
+ if (psp === 'creditguard')
69
+ return creditguardPreparationUrl(environment);
70
+ if (psp === 'worldpay_eprotect')
71
+ return eprotectPreparationUrl(environment);
72
+ // A Verifone endpoint is its reviewed profile's leg, never one per environment (verifone.ts).
73
+ if (psp === 'verifone')
74
+ throw new Error('unsupported_preparation_processor');
25
75
  if (psp === 'paysafe')
26
76
  return paysafePreparationUrl(environment);
27
77
  if (psp === 'fiserv')
28
78
  return fiservPreparationUrl(environment);
79
+ if (psp === 'aci')
80
+ return aciPreparationUrl(environment);
81
+ // The SDK's pay URL on the environment's first path, as the API names it. It only tells prepare()
82
+ // the processor is armed; the claim takes every exact card URL of that environment.
83
+ if (psp === 'amadeus_checkout')
84
+ return amadeusPreparationUrls(environment)[0];
29
85
  if (psp === 'checkout_com')
30
86
  return checkoutComPreparationUrl(environment);
31
87
  if (psp === 'adyen')
@@ -86,10 +142,69 @@ function freshCardBody(psp, body) {
86
142
  return false;
87
143
  return true;
88
144
  }
89
- /** Processor identity and environment are part of the device's prior consent. */
90
- export function matchesPreparedRequest(psp, environment, requestUrl, method, body, headers) {
145
+ /**
146
+ * CreditGuard PPS: the host's environment (ppsuat sandbox, pps and pps2 production) is the
147
+ * preparation's, the submit is the /process URL of the page the preparation read, on that page's
148
+ * own host and for its txId, and the request is the page's own new-card submit exactly as the
149
+ * device will judge it, with ppDomain bound to the approved merchant page. A saved card, a wallet,
150
+ * a refused flag, another transaction or another PPS host never spends consent.
151
+ */
152
+ function matchesPreparedCreditguard(environment, requestUrl, body, headers, binding) {
153
+ let hostname = '', merchantHost = '';
154
+ try {
155
+ hostname = new URL(requestUrl).hostname;
156
+ merchantHost = new URL(binding.merchantOrigin ?? '').hostname;
157
+ }
158
+ catch {
159
+ return false;
160
+ }
161
+ if (creditguardPreparationEnvironment(hostname) !== environment)
162
+ return false;
163
+ const page = typeof binding.paymentPageUrl === 'string' ? creditguardPageProcessUrl(binding.paymentPageUrl) : null;
164
+ const txId = creditguardProcessTxId(requestUrl);
165
+ if (page === null || txId === null || page !== requestUrl)
166
+ return false;
167
+ return creditguardProcessRefusal({ url: requestUrl, method: 'POST', headers, body: body ?? '' }, { merchantHost }) === null;
168
+ }
169
+ /**
170
+ * The approved merchant page's host, with its port if it has one: what the Amadeus SDK sends in its
171
+ * Amadeus-Checkout-Sdk-Host header (location.host). Null for anything but an http(s) origin. The
172
+ * API's twin (checkout-prepared-processor.ts) reads the same value.
173
+ */
174
+ export function merchantHostOf(merchantOrigin) {
175
+ try {
176
+ const url = new URL(merchantOrigin ?? '');
177
+ return (url.protocol === 'https:' || url.protocol === 'http:') && url.host ? url.host.toLowerCase() : null;
178
+ }
179
+ catch {
180
+ return null;
181
+ }
182
+ }
183
+ /**
184
+ * Processor identity and environment are part of the device's prior consent. `binding` carries what
185
+ * the preparation fixed beyond them (PreparedRequestBinding); Amadeus binds its SDK's Host header to
186
+ * `binding.merchantOrigin`, the origin the cardholder approved, and fails without one.
187
+ */
188
+ export function matchesPreparedRequest(psp, environment, requestUrl, method, body, headers, binding = {}) {
189
+ // The one prepared GET: the registration itself, bodyless, on the approved environment's host,
190
+ // naming the paypageId the preparation carries (payment-core isPreparedEprotectRequest, the rule
191
+ // the API and the Vault bind with too). A preparation that carries none never matches.
192
+ if (psp === 'worldpay_eprotect') {
193
+ return validPreparationEnvironment(psp, environment)
194
+ && isPreparedEprotectRequest(requestUrl, method.toUpperCase(), body ?? '', environment, binding.paypageId ?? null);
195
+ }
91
196
  if (method.toUpperCase() !== 'POST' || !validPreparationEnvironment(psp, environment))
92
197
  return false;
198
+ // CyberSource Flex: this environment's exact tokens URL, application/jwt with only the headers a
199
+ // browser adds beside it, and a Microform field iframe's JWE. The adapters claim only after the
200
+ // Flex gate verified the issuing field iframe's capture context against that JWE's key.
201
+ if (psp === 'cybersource_flex')
202
+ return isPreparedCybersourceFlexRequest(requestUrl, method.toUpperCase(), body ?? null, environment, headers);
203
+ if (psp === 'creditguard')
204
+ return matchesPreparedCreditguard(environment, requestUrl, body, headers, binding);
205
+ // A Verifone request is judged only through the profile its preparation names (matchesPreparation).
206
+ if (psp === 'verifone')
207
+ return false;
93
208
  if (psp === 'paysafe')
94
209
  return isPreparedPaysafeRequest(requestUrl, method, body ?? null, environment, headers);
95
210
  // Fiserv: that environment's card-capture endpoint exactly, the capture rules on the whole
@@ -97,6 +212,14 @@ export function matchesPreparedRequest(psp, environment, requestUrl, method, bod
97
212
  // and for the merchant the body names (payment-core isPreparedFiservRequest).
98
213
  if (psp === 'fiserv')
99
214
  return isPreparedFiservRequest(requestUrl, method.toUpperCase(), body ?? null, environment, headers);
215
+ // ACI binds the exact card-number request of a checkout on a host of the prepared environment
216
+ // (payment-core isPreparedAciRequest, the rule the API and the Vault bind with too).
217
+ if (psp === 'aci')
218
+ return isPreparedAciRequest({ url: requestUrl, method: method.toUpperCase(), body: body ?? null, headers }, environment);
219
+ if (psp === 'amadeus_checkout') {
220
+ const merchantHost = merchantHostOf(binding.merchantOrigin);
221
+ return merchantHost !== null && isPreparedAmadeusRequest(requestUrl, method, body ?? null, environment, headers, { merchantHost });
222
+ }
100
223
  if (psp === 'checkout_com')
101
224
  return isPreparedCheckoutComRequest(requestUrl, method, body ?? null, environment, headers);
102
225
  if (psp === 'adyen')
@@ -157,8 +280,18 @@ export function matchesPreparedMerchantRequest(profileId, requestUrl, method, bo
157
280
  * the one its envelope's key is pinned as for its endpoint and merchant, must be that
158
281
  * pin, as the API's bind requires. Two pins in one environment (a merchant's old and new
159
282
  * keys during a rotation) never spend each other's approval. No other processor names one.
283
+ * A CreditGuard preparation binds the merchant page it approved and the page it framed
284
+ * (merchantOrigin, paymentPageUrl), which matchesPreparedRequest holds the submit to.
285
+ * A Worldpay eProtect preparation names the paypageId its registration must carry.
286
+ * An Amadeus preparation binds its SDK's Host header to the page the cardholder approved
287
+ * (merchantOrigin), as the API does.
160
288
  */
161
289
  export function matchesPreparation(preparation, requestUrl, method, body, headers) {
290
+ // A Verifone preparation pays only its profile's reviewed leg, as payment-core pauses it.
291
+ if (preparation.psp === 'verifone') {
292
+ return typeof preparation.merchantProfile === 'string' && method.toUpperCase() === 'POST'
293
+ && isPreparedVerifoneRequest(requestUrl, 'POST', body ?? null, preparation.merchantProfile);
294
+ }
162
295
  if (preparation.psp === 'fiserv') {
163
296
  if (!matchesPreparedRequest(preparation.psp, preparation.environment, requestUrl, method, body, headers))
164
297
  return false;
@@ -168,5 +301,23 @@ export function matchesPreparation(preparation, requestUrl, method, body, header
168
301
  return preparation.psp === 'adyen'
169
302
  && matchesPreparedMerchantRequest(preparation.merchantProfile, requestUrl, method, body, preparation.sandboxDeclaration);
170
303
  }
171
- return matchesPreparedRequest(preparation.psp, preparation.environment, requestUrl, method, body, headers);
304
+ return matchesPreparedRequest(preparation.psp, preparation.environment, requestUrl, method, body, headers, { merchantOrigin: preparation.merchantOrigin, paymentPageUrl: preparation.paymentPageUrl, paypageId: preparation.paypageId });
305
+ }
306
+ /**
307
+ * The reason a claim reports for a request its preparation does not match. An Amadeus preparation
308
+ * names what payment-core's Amadeus check refused on its own environment's card URL, as
309
+ * `amadeus_<reason>`: Air France's and KLM's add, whose expiry their own form keeps, is
310
+ * `amadeus_merchant_held_expiry`, every Data Collection Page store is
311
+ * `amadeus_dcp_field_config_unreviewed` until a merchant's field config is reviewed, and a Host
312
+ * header that does not name the approved page is `amadeus_header_binding`. Everything else, another
313
+ * processor's request or the other environment's host included, is `checkout_changed`.
314
+ */
315
+ export function preparedRequestRefusal(psp, environment, requestUrl, body, headers, merchantOrigin) {
316
+ if (psp !== 'amadeus_checkout' || amadeusEnvironment(requestUrl) !== environment)
317
+ return 'checkout_changed';
318
+ const merchantHost = merchantHostOf(merchantOrigin);
319
+ if (merchantHost === null)
320
+ return 'amadeus_header_binding';
321
+ const reason = amadeusRequestRefusal({ url: requestUrl, method: 'POST', body: body ?? null, headers }, null, { merchantHost });
322
+ return typeof reason === 'string' ? `amadeus_${reason}` : 'checkout_changed';
172
323
  }
@@ -0,0 +1,53 @@
1
+ export declare const PRIMER_PSP = "primer";
2
+ /** The dark-launch capability a build declares when it judges every Primer request with classifyPrimerRequest. */
3
+ export declare const PRIMER_CAPABILITY = "primer_payment_instruments";
4
+ /**
5
+ * Why a Primer request was aborted as an unsupported checkout, reported as the `reason` of the
6
+ * `unsupported_checkout` event and of the attachment's `unsupported` state:
7
+ * unsupported_primer_sdk a card request from Primer Checkout (primer-js), whose request gives
8
+ * up after 30 seconds, or any SDK that is not the legacy v2 controller
9
+ * unsupported_primer_request a card request the legacy v2 controller would not send: another URL
10
+ * spelling on the pci host, another header or body shape
11
+ */
12
+ export type PrimerUnsupportedReason = 'unsupported_primer_sdk' | 'unsupported_primer_request';
13
+ /**
14
+ * Why a single Primer request was aborted alone, reported as the detail of a `blocked` event; the
15
+ * attachment is not held, so the next request is judged again:
16
+ * primer_keep_on_file the body asks Primer to save the card for later charges
17
+ * unreadable_primer_request the adapter could not read the body
18
+ */
19
+ export type PrimerBlockedReason = 'primer_keep_on_file' | 'unreadable_primer_request';
20
+ /** What the pre-claim gate does with a request on a Primer pci host. */
21
+ export type PrimerVerdict = {
22
+ kind: 'defer';
23
+ } | {
24
+ kind: 'block';
25
+ reason: PrimerBlockedReason;
26
+ } | {
27
+ kind: 'unsupported';
28
+ reason: PrimerUnsupportedReason;
29
+ };
30
+ /** True for a URL on one of Primer's two pci hosts, whatever its path. */
31
+ export declare function isPrimerPciHost(rawUrl: string): boolean;
32
+ /**
33
+ * The gate's verdict for a POST the registry recognized on a Primer pci host: defer (a new card,
34
+ * which the arbiter pauses, or a body with no card, which the card-field rule continues), block it
35
+ * alone, or abort it as an unsupported checkout. A decision that throws refuses.
36
+ */
37
+ export declare function primerRequestVerdict(request: {
38
+ url: string;
39
+ method: string;
40
+ headers?: Record<string, string>;
41
+ body: string | null;
42
+ }): PrimerVerdict;
43
+ /**
44
+ * The only answer the page may receive for an approved Primer request: status 200 or 201 and
45
+ * Primer's single-use card token rebuilt from payment-core's allow-list (sanitizePrimerResponse),
46
+ * under a JSON content type. Null for anything else: another status, a multi-use token or vaultData
47
+ * (the card was saved), a field out of bounds, a body that does not parse.
48
+ */
49
+ export declare function primerTokenAnswer(status: number, body: string): {
50
+ status: number;
51
+ headers: Record<string, string>;
52
+ body: string;
53
+ } | null;
@@ -0,0 +1,38 @@
1
+ declare var PRIMER_PCI_HOSTS: readonly string[];
2
+ declare var PRIMER_TOKENIZE_PATH: string;
3
+ declare var PRIMER_REFUSAL_REASONS: readonly string[];
4
+ declare var PRIMER_PROVABLE_NETWORKS: readonly string[];
5
+ declare function isPrimerTokenizeUrl(url: any, method?: string): boolean;
6
+ declare function primerBodyRefusal(body: any): "unsupported" | "keep_on_file" | null;
7
+ declare function isPrimerNewCardBody(body: any): boolean;
8
+ declare function primerKeepOnFileRequested(body: any): boolean | null;
9
+ declare function classifyPrimerRequest(url: any, method: any, body: any, headers: any): "card" | "unsupported" | "keep_on_file" | "unsupported_sdk" | null;
10
+ declare function primerTokenizeRefusal(request: any): "unsupported" | "keep_on_file" | "unsupported_sdk" | null;
11
+ declare function isPrimerTokenizeRequest(request: any): boolean;
12
+ declare function primerRefusalMessage(reason: any): string;
13
+ declare function primerCardNetwork(number: any): "VISA" | "AMEX" | "MASTERCARD" | null;
14
+ declare function primerNetworkRefusal(body: any, card: any): "unsupported" | "network_mismatch" | null;
15
+ declare function injectPrimerCard(body: any, card: any): {
16
+ body: string;
17
+ where: string[];
18
+ };
19
+ declare function primerErrorId(body: any): any;
20
+ declare function primerResponseOutcome(status: any, body: any, card: any): {
21
+ outcome: string;
22
+ code: any;
23
+ reason?: undefined;
24
+ } | {
25
+ outcome: string;
26
+ reason: string;
27
+ code?: undefined;
28
+ } | {
29
+ outcome: string;
30
+ code?: undefined;
31
+ reason?: undefined;
32
+ };
33
+ declare function sanitizePrimerResponse(body: any): string;
34
+ declare function primerFacts(status: any, body: any): {
35
+ outcome: string;
36
+ refusalCode: any;
37
+ };
38
+ export { PRIMER_PCI_HOSTS, PRIMER_PROVABLE_NETWORKS, PRIMER_REFUSAL_REASONS, PRIMER_TOKENIZE_PATH, classifyPrimerRequest, injectPrimerCard, isPrimerNewCardBody, isPrimerTokenizeRequest, isPrimerTokenizeUrl, primerBodyRefusal, primerCardNetwork, primerErrorId, primerFacts, primerKeepOnFileRequested, primerNetworkRefusal, primerRefusalMessage, primerResponseOutcome, primerTokenizeRefusal, sanitizePrimerResponse };