@agent-cards/sdk 0.23.20 → 0.23.22

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 (64) hide show
  1. package/CHANGELOG.md +55 -2
  2. package/PREFLIGHT.md +6 -0
  3. package/README.md +169 -5
  4. package/dist/amadeus-checkout.generated.d.ts +6 -1
  5. package/dist/amadeus-checkout.generated.js +26 -2
  6. package/dist/card-fields.generated.js +2341 -127
  7. package/dist/cdp.js +199 -28
  8. package/dist/client.d.ts +177 -9
  9. package/dist/client.js +387 -37
  10. package/dist/comgate.d.ts +50 -0
  11. package/dist/comgate.js +80 -0
  12. package/dist/creditguard.generated.js +4 -2
  13. package/dist/cse-body.js +11 -0
  14. package/dist/cybersource-secure-acceptance.generated.d.ts +1 -1
  15. package/dist/ebanx.d.ts +1 -1
  16. package/dist/ebanx.js +1 -1
  17. package/dist/eprotect.generated.d.ts +1 -1
  18. package/dist/eximbay.d.ts +46 -0
  19. package/dist/eximbay.js +69 -0
  20. package/dist/gmo.generated.js +7 -3
  21. package/dist/hipay.generated.d.ts +5 -5
  22. package/dist/hipay.generated.js +5 -2
  23. package/dist/hold.d.ts +1 -1
  24. package/dist/hold.js +10 -4
  25. package/dist/hosted-entry.d.ts +4 -0
  26. package/dist/hosted-entry.js +32 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/lifecycle.d.ts +9 -4
  29. package/dist/lifecycle.js +16 -4
  30. package/dist/paddle-tokenex.generated.js +7 -3
  31. package/dist/paygent.generated.d.ts +60 -0
  32. package/dist/paygent.generated.js +425 -0
  33. package/dist/payrails.generated.js +7 -3
  34. package/dist/payrexx.d.ts +91 -0
  35. package/dist/payrexx.generated.d.ts +91 -0
  36. package/dist/payrexx.generated.js +536 -0
  37. package/dist/payrexx.js +141 -0
  38. package/dist/pre-claim.d.ts +30 -1
  39. package/dist/pre-claim.js +257 -39
  40. package/dist/preflight-catalog.json +58 -0
  41. package/dist/preflight-schemas.json +4 -0
  42. package/dist/preflight.generated.js +26 -2
  43. package/dist/prepared-processor.d.ts +7 -2
  44. package/dist/prepared-processor.js +16 -2
  45. package/dist/primer.generated.js +2469 -255
  46. package/dist/przelewy24.d.ts +47 -0
  47. package/dist/przelewy24.js +88 -0
  48. package/dist/registry.d.ts +6 -5
  49. package/dist/registry.js +27 -7
  50. package/dist/shiji-sts.generated.js +7 -3
  51. package/dist/stripe-checkout.generated.js +896 -19
  52. package/dist/toast-seal.generated.d.ts +37 -0
  53. package/dist/toast-seal.generated.js +625 -0
  54. package/dist/toast.generated.d.ts +41 -0
  55. package/dist/toast.generated.js +113 -0
  56. package/dist/tokenex-iframe.d.ts +93 -0
  57. package/dist/tokenex-iframe.generated.d.ts +81 -0
  58. package/dist/tokenex-iframe.generated.js +403 -0
  59. package/dist/tokenex-iframe.js +195 -0
  60. package/dist/transbank.d.ts +45 -0
  61. package/dist/transbank.js +73 -0
  62. package/dist/twoc2p.generated.js +7 -3
  63. package/examples/preflight/kernel-native/inventory.json +1 -1
  64. package/package.json +3 -3
@@ -25,11 +25,15 @@
25
25
  * Cashier's card frame for a token, too soon for an approval after Pay. Its one environment is
26
26
  * production: Wix's tokenizer has no test host.
27
27
  *
28
+ * paygent: prepared only. Paygent's PaygentToken.js abandons its token request 35 seconds after the
29
+ * merchant's press sends it, too soon for an approval after the press. Its environments are its two token
30
+ * hosts: token.paygent.co.jp (production) and sandbox.paygent.co.jp (sandbox).
31
+ *
28
32
  * hipay: prepared only. The merchant's page gives HiPay's hosted fields 20 seconds after Pay, too soon for an
29
33
  * approval after Pay. Its environments are its two vault hosts: secure2-vault (production) and
30
34
  * stage-secure2-vault (sandbox).
31
35
  */
32
- export type PreparationProcessor = 'square' | 'braintree' | 'worldpay' | 'bambora' | 'mercado_pago' | 'recurly' | 'spreedly' | 'adyen' | 'checkout_com' | 'paysafe' | 'fiserv' | 'cybersource_flex' | 'aci' | 'creditguard' | 'worldpay_eprotect' | 'amadeus_checkout' | 'verifone' | 'cybersource_secure_acceptance' | 'paddle_vgs' | 'wix_payments' | 'hipay';
36
+ export type PreparationProcessor = 'square' | 'braintree' | 'worldpay' | 'bambora' | 'mercado_pago' | 'recurly' | 'spreedly' | 'adyen' | 'checkout_com' | 'paysafe' | 'fiserv' | 'cybersource_flex' | 'aci' | 'creditguard' | 'worldpay_eprotect' | 'amadeus_checkout' | 'verifone' | 'cybersource_secure_acceptance' | 'paddle_vgs' | 'wix_payments' | 'paygent' | 'hipay';
33
37
  export type PreparationEnvironment = 'production' | 'sandbox' | 'shared';
34
38
  /**
35
39
  * How the approved card reaches the processor: the device's own request (token), or
@@ -66,7 +70,8 @@ export declare function preparedApprovalAnswersRetry(psp: string): boolean;
66
70
  * its own signing keys. A Verifone preparation pays in the environment of the key its reviewed
67
71
  * profile pins. CyberSource Secure Acceptance's are separate hosts too: secureacceptance is
68
72
  * live, testsecureacceptance is test. So are Paddle VGS's two card URLs: vault is live,
69
- * sandbox-vault is test. So are HiPay's two vault hosts: secure2-vault is live, stage-secure2-vault is test.
73
+ * sandbox-vault is test. So are Paygent's two token hosts: token is live, sandbox is test. So are
74
+ * HiPay's two vault hosts: secure2-vault is live, stage-secure2-vault is test.
70
75
  */
71
76
  export declare function validPreparationEnvironment(psp: string, environment: string): boolean;
72
77
  /**
@@ -15,6 +15,7 @@ import { isPreparedVerifoneRequest } from './verifone.js';
15
15
  import { isPreparedSecureAcceptanceRequest, secureAcceptanceEnvironment, secureAcceptancePreparationUrl, secureAcceptanceRequestRefusal, } from './cybersource-secure-acceptance.generated.js';
16
16
  import { PADDLE_VGS_CARDS_URLS, isPreparedPaddleVgsRequest } from './paddle-vgs.generated.js';
17
17
  import { WIX_PAYMENTS_TOKENIZE_URL, isPreparedWixPaymentsRequest } from './wix-payments.generated.js';
18
+ import { paygentEnvironment, paygentPreparationUrl, paygentRequestRefusal } from './paygent.generated.js';
18
19
  import { HIPAY_TOKEN_URLS, hipayRequestRefusal, hipayTokenEnvironment, isPreparedHipayRequest } from './hipay.generated.js';
19
20
  export function preparationMode(psp) {
20
21
  return psp === 'adyen' || psp === 'fiserv' || psp === 'verifone' ? 'cse' : 'token';
@@ -50,7 +51,8 @@ export function preparedApprovalAnswersRetry(psp) {
50
51
  * its own signing keys. A Verifone preparation pays in the environment of the key its reviewed
51
52
  * profile pins. CyberSource Secure Acceptance's are separate hosts too: secureacceptance is
52
53
  * live, testsecureacceptance is test. So are Paddle VGS's two card URLs: vault is live,
53
- * sandbox-vault is test. So are HiPay's two vault hosts: secure2-vault is live, stage-secure2-vault is test.
54
+ * sandbox-vault is test. So are Paygent's two token hosts: token is live, sandbox is test. So are
55
+ * HiPay's two vault hosts: secure2-vault is live, stage-secure2-vault is test.
54
56
  */
55
57
  export function validPreparationEnvironment(psp, environment) {
56
58
  if (psp === 'bambora' || psp === 'mercado_pago' || psp === 'recurly' || psp === 'spreedly')
@@ -59,7 +61,7 @@ export function validPreparationEnvironment(psp, environment) {
59
61
  if (psp === 'wix_payments')
60
62
  return environment === 'production';
61
63
  return ['square', 'braintree', 'worldpay', 'adyen', 'checkout_com', 'paysafe', 'fiserv', 'cybersource_flex', 'aci', 'creditguard', 'worldpay_eprotect', 'amadeus_checkout', 'verifone',
62
- 'cybersource_secure_acceptance', 'paddle_vgs', 'hipay'].includes(psp) && ['production', 'sandbox'].includes(environment);
64
+ 'cybersource_secure_acceptance', 'paddle_vgs', 'paygent', 'hipay'].includes(psp) && ['production', 'sandbox'].includes(environment);
63
65
  }
64
66
  /**
65
67
  * ACI's prepared endpoint, the literal the API names (backend checkout-prepared-processor.ts): its
@@ -107,6 +109,9 @@ export function preparationEndpoint(psp, environment) {
107
109
  // Wix Payments: the tokenize URL, the only URL the claim takes for it.
108
110
  if (psp === 'wix_payments')
109
111
  return WIX_PAYMENTS_TOKENIZE_URL;
112
+ // Paygent: the token URL on the environment's host, the only URL the claim takes for it.
113
+ if (psp === 'paygent')
114
+ return paygentPreparationUrl(environment);
110
115
  // HiPay: the token create on the environment's vault, the only URL the claim takes for it.
111
116
  if (psp === 'hipay')
112
117
  return HIPAY_TOKEN_URLS[environment];
@@ -267,6 +272,15 @@ export function matchesPreparedRequest(psp, environment, requestUrl, method, bod
267
272
  // site's app instance and the card frame's body), the rule the API and the Vault bind with too.
268
273
  if (psp === 'wix_payments')
269
274
  return isPreparedWixPaymentsRequest(requestUrl, method.toUpperCase(), body ?? null, environment, headers ?? {});
275
+ // Paygent: the environment's own token URL and payment-core's whole request rule (the script's text/plain
276
+ // and createToken's body byte for byte), the rule the API and the Vault bind with too. The method as the page
277
+ // sent it: the device sends only an uppercase POST. Which merchant_id and token key a live request may name
278
+ // is the API's to judge at the bind and the Vault's before it writes the card, against the reviewed pins
279
+ // each of them holds, so a merchant a later release reviews needs no new build of this library.
280
+ if (psp === 'paygent') {
281
+ return paygentEnvironment(requestUrl) === environment
282
+ && paygentRequestRefusal({ url: requestUrl, method, headers: headers ?? {}, body: body ?? null }) === null;
283
+ }
270
284
  // HiPay: the environment's own vault and payment-core's whole request rule (a JSON content type, a public username of
271
285
  // that environment and a complete create, never the hosted fields' number-only post), the rule the API and the Vault
272
286
  // bind with too.