Skip to content

Commit 5f2df0a

Browse files
feat: Support native prepared Adyen Sessions checkout
Stainless-Generated-From: 1c59aa3eefd9ebe82d2a948a4b96dfe9903207a1
1 parent 64805ae commit 5f2df0a

7 files changed

Lines changed: 19 additions & 15 deletions

‎src/kernel/resources/vaults/items.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def perform_operation(
517517
leave the outcome unknown; do not automatically retry.
518518
519519
Args:
520-
checkout: Required when preparing an unused AgentCard card for a supported tokenization
520+
checkout: Required when preparing an unused AgentCard card for a supported checkout
521521
processor. Consent is bound to this browser and declared merchant origin, not a
522522
tab. Wait for the item's ready_to_submit status before native Pay and submit
523523
within its readiness deadline. Unused preparations expire automatically; every
@@ -1290,7 +1290,7 @@ async def perform_operation(
12901290
leave the outcome unknown; do not automatically retry.
12911291
12921292
Args:
1293-
checkout: Required when preparing an unused AgentCard card for a supported tokenization
1293+
checkout: Required when preparing an unused AgentCard card for a supported checkout
12941294
processor. Consent is bound to this browser and declared merchant origin, not a
12951295
tab. Wait for the item's ready_to_submit status before native Pay and submit
12961296
within its readiness deadline. Unused preparations expire automatically; every

‎src/kernel/types/vaults/agentcard_checkout_preparation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class AgentcardCheckoutPreparation(BaseModel):
1414
"""One-use processor-bound checkout preparation.
1515
16-
Keep the approval page open through token handoff. The amount is display-only and does not constrain the merchant's eventual charge.
16+
Keep the approval page open through device handoff, including Adyen encryption. The amount is declared by the caller and does not constrain the merchant's eventual charge. Adyen device approval and browser Authorised responses are not capture or fulfillment evidence.
1717
"""
1818

1919
browser_id: str

‎src/kernel/types/vaults/agentcard_prepared_processor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["AgentcardPreparedProcessor"]
66

7-
AgentcardPreparedProcessor: TypeAlias = Literal["square", "braintree", "worldpay", "bambora", "mercado_pago"]
7+
AgentcardPreparedProcessor: TypeAlias = Literal["square", "braintree", "worldpay", "bambora", "mercado_pago", "adyen"]

‎src/kernel/types/vaults/card_vault_item_state.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ class AgentCardCardState(BaseModel):
117117
preparation: Optional[AgentcardCheckoutPreparation] = None
118118
"""One-use processor-bound checkout preparation.
119119
120-
Keep the approval page open through token handoff. The amount is display-only
121-
and does not constrain the merchant's eventual charge.
120+
Keep the approval page open through device handoff, including Adyen encryption.
121+
The amount is declared by the caller and does not constrain the merchant's
122+
eventual charge. Adyen device approval and browser Authorised responses are not
123+
capture or fulfillment evidence.
122124
"""
123125

124126
status_reason: Optional[str] = None

‎src/kernel/types/vaults/item_perform_operation_params.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PrepareCheckoutVaultItemOperationRequest(TypedDict, total=False):
3434

3535
checkout: Required[VaultCheckoutContextParam]
3636
"""
37-
Required when preparing an unused AgentCard card for a supported tokenization
37+
Required when preparing an unused AgentCard card for a supported checkout
3838
processor. Consent is bound to this browser and declared merchant origin, not a
3939
tab. Wait for the item's ready_to_submit status before native Pay and submit
4040
within its readiness deadline. Unused preparations expire automatically; every

‎src/kernel/types/vaults/prepare_checkout_vault_item_operation_request_param.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111

1212
class PrepareCheckoutVaultItemOperationRequestParam(TypedDict, total=False):
13-
"""Prepare an unused AgentCard card for a supported tokenization checkout.
13+
"""Prepare an unused AgentCard card for a supported checkout.
1414
1515
Deliver the returned approval URL and keep the approval page open. Poll the item until ready_to_submit, then submit native Pay before preparation.expires_at. Readiness lasts at most 30 seconds. Unused preparations expire automatically. Preparations are single-use even after failure or expiry; do not automatically retry and reconcile uncertain outcomes with the merchant.
1616
"""
1717

1818
checkout: Required[VaultCheckoutContextParam]
1919
"""
20-
Required when preparing an unused AgentCard card for a supported tokenization
20+
Required when preparing an unused AgentCard card for a supported checkout
2121
processor. Consent is bound to this browser and declared merchant origin, not a
2222
tab. Wait for the item's ready_to_submit status before native Pay and submit
2323
within its readiness deadline. Unused preparations expire automatically; every

‎src/kernel/types/vaults/vault_checkout_context_param.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111

1212
class VaultCheckoutContextParam(TypedDict, total=False):
1313
"""
14-
Required when preparing an unused AgentCard card for a supported tokenization processor. Consent is bound to this browser and declared merchant origin, not a tab. Wait for the item's ready_to_submit status before native Pay and submit within its readiness deadline. Unused preparations expire automatically; every preparation is single-use, including after failure or expiry.
14+
Required when preparing an unused AgentCard card for a supported checkout processor. Consent is bound to this browser and declared merchant origin, not a tab. Wait for the item's ready_to_submit status before native Pay and submit within its readiness deadline. Unused preparations expire automatically; every preparation is single-use, including after failure or expiry.
1515
"""
1616

1717
browser_id: Required[str]
1818
"""Active browser session with this vault bound to it."""
1919

2020
environment: Required[Literal["production", "sandbox", "shared"]]
2121
"""
22-
Use production or sandbox for Square, Braintree and Worldpay; shared for Bambora
23-
and Mercado Pago. Shared endpoints do not establish test mode. Merchant
22+
Use production or sandbox for Square, Braintree, Worldpay and Adyen; shared for
23+
Bambora and Mercado Pago. Shared endpoints do not establish test mode. Merchant
2424
credentials/configuration determine processor test mode, independently of the
2525
AgentCard credential mode.
2626
"""
@@ -32,8 +32,10 @@ class VaultCheckoutContextParam(TypedDict, total=False):
3232
"""
3333

3434
psp: AgentcardPreparedProcessor
35-
"""Tokenization processor.
35+
"""Checkout processor.
3636
37-
Omit for Square compatibility. Non-Square processors require multi-processor
38-
preparation enablement.
37+
Omit for Square compatibility. Adyen supports fresh-card Sessions requests on
38+
Adyen hosts only. Use public dummy card fields, not vault aliases. The unique
39+
armed preparation is associated with the subsequent eligible request from this
40+
browser and declared merchant origin; competing preparations are rejected.
3941
"""

0 commit comments

Comments
 (0)