@agent-cards/sdk 0.23.22 → 0.23.24
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 +34 -0
- package/PREFLIGHT.md +2 -0
- package/README.md +34 -4
- package/dist/aci.generated.js +3 -3
- package/dist/agent-amount.generated.d.ts +7 -0
- package/dist/agent-amount.generated.js +3 -0
- package/dist/amadeus.d.ts +5 -2
- package/dist/amadeus.js +18 -3
- package/dist/amazon-payment-services.d.ts +25 -0
- package/dist/amazon-payment-services.generated.d.ts +76 -0
- package/dist/amazon-payment-services.generated.js +883 -0
- package/dist/amazon-payment-services.js +53 -0
- package/dist/capabilities.generated.d.ts +2 -0
- package/dist/capabilities.generated.js +3 -0
- package/dist/card-fields.generated.js +1127 -25
- package/dist/cdp.js +116 -15
- package/dist/client.d.ts +107 -8
- package/dist/client.js +277 -128
- package/dist/hosted-entry.js +2 -1
- package/dist/hosted-form.d.ts +5 -0
- package/dist/hosted-form.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/openpay.generated.d.ts +67 -0
- package/dist/openpay.generated.js +446 -0
- package/dist/paddle-checkout-watch.d.ts +70 -0
- package/dist/paddle-checkout-watch.js +239 -0
- package/dist/paddle-tokenex.generated.d.ts +29 -1
- package/dist/paddle-tokenex.generated.js +175 -26
- package/dist/paytrail.d.ts +58 -0
- package/dist/paytrail.js +98 -0
- package/dist/pre-claim.d.ts +4 -0
- package/dist/pre-claim.js +46 -2
- package/dist/prepared-processor.d.ts +12 -4
- package/dist/prepared-processor.js +31 -5
- package/dist/primer.generated.js +1155 -53
- package/dist/registry.d.ts +4 -3
- package/dist/registry.js +12 -4
- package/dist/sbps.d.ts +57 -0
- package/dist/sbps.generated.d.ts +96 -0
- package/dist/sbps.generated.js +427 -0
- package/dist/sbps.js +90 -0
- package/dist/stripe-checkout.generated.js +458 -8
- package/dist/tap-payments.d.ts +43 -0
- package/dist/tap-payments.generated.d.ts +59 -0
- package/dist/tap-payments.generated.js +990 -0
- package/dist/tap-payments.js +72 -0
- package/dist/transbank.d.ts +33 -0
- package/dist/transbank.js +62 -0
- package/dist/url-mask-parts.d.ts +24 -0
- package/dist/url-mask-parts.js +22 -0
- package/dist/url-masks.generated.d.ts +3 -0
- package/dist/url-masks.generated.js +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Amazon Payment Services (formerly PayFort; psp `amazon_payment_services`), its custom merchant page: the merchant's own
|
|
2
|
+
// card form posts top-level, as a document navigation, to /FortAPI/paymentPage on checkout.payfort.com (its sandbox,
|
|
3
|
+
// sbcheckout.payfort.com), form encoded, with service_command=TOKENIZATION and the merchant's signed fields beside the
|
|
4
|
+
// card. APS answers the post with a page whose script posts APS's fields to the form's return_url, or with a redirect
|
|
5
|
+
// to that return_url carrying them in its query, and the merchant charges the token in those fields later, from its own
|
|
6
|
+
// server. The rules are payment-core's (amazon-payment-services.generated.ts): the API applies them at create and at the
|
|
7
|
+
// approve, and the cardholder's phone again before it sends the form through the checkout relay.
|
|
8
|
+
//
|
|
9
|
+
// The processor ships dark. The API serves the amazon_payment_services recognizer only to a build that declares the
|
|
10
|
+
// `aps_custom_merchant_page` capability (client.ts SUPPORTED_CAPABILITIES), and only to an org Agentcard enabled for it,
|
|
11
|
+
// so an SDK the API never served it leaves every APS form alone. This module holds the last check before an approval's
|
|
12
|
+
// answer reaches the paused navigation.
|
|
13
|
+
import { APS_CAPABILITY as CORE_CAPABILITY, APS_PAGE_CONTENT_TYPE, APS_PSP as CORE_PSP, apsAnswerOutcome } from './amazon-payment-services.generated.js';
|
|
14
|
+
export const APS_PSP = CORE_PSP;
|
|
15
|
+
export const APS_CAPABILITY = CORE_CAPABILITY;
|
|
16
|
+
/**
|
|
17
|
+
* The answer the paused APS form navigation is fulfilled with, or null. The API stores APS's answer only once
|
|
18
|
+
* payment-core's judge reads it as a token for the paused form (apsAnswerOutcome), and this reads the stored answer
|
|
19
|
+
* again, against the paused request, before the agent's browser gets it:
|
|
20
|
+
* page status 200 under APS's HTML type alone, APS's page byte for byte, whose one form posts APS's fields to
|
|
21
|
+
* the paused form's own return_url;
|
|
22
|
+
* redirect status 302 or 303 with one Location alone: the paused form's return_url, then APS's fields in the query.
|
|
23
|
+
* Anything else is null: a refusal, an unknown answer, another merchant's or another return page's answer, a card
|
|
24
|
+
* number anywhere in it, or a header beside the one each shape carries. A navigation reads no CORS header, so none is
|
|
25
|
+
* added. Autopilot never sends an APS form (payment-core autopilot.js), so the caller refuses an unattended answer.
|
|
26
|
+
*/
|
|
27
|
+
export function apsNavigationAnswer(request, response) {
|
|
28
|
+
try {
|
|
29
|
+
const headers = {};
|
|
30
|
+
for (const [name, value] of Object.entries(response.headers ?? {})) {
|
|
31
|
+
const lower = name.toLowerCase();
|
|
32
|
+
if (typeof value !== 'string' || Object.prototype.hasOwnProperty.call(headers, lower))
|
|
33
|
+
return null;
|
|
34
|
+
headers[lower] = value;
|
|
35
|
+
}
|
|
36
|
+
const names = Object.keys(headers);
|
|
37
|
+
// No card is in hand here: the judge reads the answer for any card number, with no card of its own to search for.
|
|
38
|
+
const verdict = apsAnswerOutcome({ status: response.status, headers, bodyText: response.body }, { url: request.url, body: request.body ?? '' }, undefined, undefined);
|
|
39
|
+
if (verdict.outcome !== 'token' || typeof verdict.body !== 'string')
|
|
40
|
+
return null;
|
|
41
|
+
if (verdict.shape === 'page') {
|
|
42
|
+
if (names.length !== 1 || headers['content-type'] !== APS_PAGE_CONTENT_TYPE)
|
|
43
|
+
return null;
|
|
44
|
+
return { status: 200, headers: { 'content-type': APS_PAGE_CONTENT_TYPE }, body: verdict.body };
|
|
45
|
+
}
|
|
46
|
+
if (names.length !== 1 || typeof verdict.location !== 'string' || response.body !== '')
|
|
47
|
+
return null;
|
|
48
|
+
return { status: response.status, headers: { location: verdict.location }, body: '' };
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Written by scripts/generate-capabilities.mjs from capabilities.json. Do not edit; git ignores it.
|
|
2
|
+
/** capabilities.json's list, sorted; client.ts exports it as SUPPORTED_CAPABILITIES. */
|
|
3
|
+
export const DECLARED_CAPABILITIES = ["aci_split_card.v1", "amadeus_checkout_actions.v1", "aps_custom_merchant_page", "authorize_net_dpm_form", "capture_context", "clover_card_token", "comgate_hosted_payment_page", "converge_hpp_process", "creditguard_pps_process", "cybersource_sa_token_create", "datatrans_secure_fields_tokenize", "ekashu_hosted_payment_page", "eximbay_hosted_payment_page", "fastspring_card_payment", "fiserv_card_capture", "gmo_shared_pk", "gopay_card_form", "gravy_session_fields_put", "hipay_vault_token", "juspay_txns.v1", "lyra_krypton_payment", "makecommerce_card_frame", "midtrans_card_token", "moneris_hosted_tokenization", "omise_card_token", "openpay_tokenizer", "paddle_tokenex_pay", "paddle_vgs_cards", "pay_nl_card_token", "payfast_card_pay", "paygent_token", "paymongo_checkout_pay", "paypal_card_fields", "payrails_device_encrypt", "payrexx_card_frame", "paytrail_hosted_payment_page", "pelecard_transaction", "poynt_collect_nonce", "primer_payment_instruments", "przelewy24_hosted_payment_page", "quickpay_hosted_payment_page", "redsys_hosted_payment_page", "revolut_card_field", "sbps_token_jsonp", "shiji_sts_pinned_key", "sumup_checkout_process", "tap_card_sdk_token", "toast_pinned_key", "tokenex_iframe_tokenize", "transbank_webpay_hosted_payment_page", "twoc2p_secure_pay", "verifone_card_capture", "wix_payments_tokenize", "worldline_mycheckout_form", "worldpay_eprotect_jsonp", "wspay_confirm", "xendit_card_token"];
|