feat(core): Add TLID through Adyen payment flows and API response#12278
Open
ayush22667 wants to merge 21 commits into
Open
feat(core): Add TLID through Adyen payment flows and API response#12278ayush22667 wants to merge 21 commits into
ayush22667 wants to merge 21 commits into
Conversation
…card TLID Adds structural scaffolding for Mastercard Transaction Link Identifier (TLID) support. TLID is mandatory for all Mastercard recurring/MIT transactions from Oct 23, 2026. Missing TLID risks issuer declines (no static fallback unlike Trace ID which has a static fallback). Changes: - DB migrations: add network_transaction_link_id to payment_attempt and payment_methods - Diesel schema (schema.rs, schema_v2.rs) updated with new column - Domain models and storage impl structs extended with new field - PaymentsResponseData::TransactionResponse extended with network_txn_link_id - MandateReferenceId::NetworkMandateId converted from String to NetworkMandateIdRef struct (carries NTID + TLID together) - NetworkTokenWithNTIRef extended with transaction_link_id field - RecurringDetails API input structs extended with optional transaction_link_id field - create_payment_method trait/impl updated with new parameter - All connector TransactionResponse constructions include network_txn_link_id: None - All values default to None in this PR; Adyen extraction and forwarding in follow-up Tracking: juspay/hyperswitch-cloud#15941 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…tAttempt and PaymentMethod structs
…erswitch into feat/add-tlid-support
… in payment methods and attempts
…erswitch into feat/add-tlid-support
Picks up from PR #12260 (structural plumbing). This commit wires actual TLID values through the payment flows: - Adyen CIT: extract transactionLinkId from additionalData response and store on payment_attempt and payment_methods - Adyen MIT: read TLID from MandateReferenceId in get_additional_data() and send as additionalData.transactionLinkId to Adyen - NTWithNTIRef and CardWithNTIRef structs carry transaction_link_id - ActionType::CardWithNetworkTransactionId now uses CardWithNTIRef struct - IsNtWithNtiFlow::NtWithNtiSupported now carries CardWithNTIRef - TLID populated in is_network_token_with_network_transaction_id_flow via match tuple (same pattern as network_transaction_id) - PaymentsResponse exposes network_transaction_link_id field - PaymentMethodTokenizationDetails exposes network_transaction_link_id - ConfirmUpdate passes network_transaction_link_id from payment attempt Mandatory for Mastercard recurring/MIT from Oct 23, 2026. No fallback — missing TLID risks issuer declines. Tracking: juspay/hyperswitch-cloud#15984 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Changed Files
|
…juspay/hyperswitch into feat/add-tlid-support-for-adyen
Sakilmostak
reviewed
May 14, 2026
Sakilmostak
approved these changes
May 14, 2026
swangi-kumari
previously approved these changes
May 14, 2026
Sakilmostak
previously approved these changes
May 14, 2026
hrithikesh026
previously approved these changes
May 15, 2026
The base branch was changed.
swangi-kumari
approved these changes
May 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR wires Mastercard TLID (Transaction Link Identifier) end-to-end for Adyen recurring flows: extracting TLID from Adyen CIT responses, persisting it through internal recurring/MIT routing structures, and exposing it via the Payments API response surface (including tokenization details).
Changes:
- Adyen: extract
additionalData.transactionLinkIdinto connectorTransactionResponse, and forward TLID on MIT asadditionalData.transactionLinkIdwhen present inMandateReferenceId. - Core routing: propagate TLID alongside NTID through MIT action/routing types (
CardWithNTIRef,NTWithNTIRef) and mandate reference construction. - API & docs: expose
network_transaction_link_idonPaymentsResponseandPaymentMethodTokenizationDetails, and update OpenAPI v1 spec.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/router/tests/payments2.rs | Updates expected test structs to include network_transaction_link_id field. |
| crates/router/tests/payments.rs | Updates expected test structs to include network_transaction_link_id field. |
| crates/router/src/db/events.rs | Updates event DB test struct to include network_transaction_link_id. |
| crates/router/src/core/payments/transformers.rs | Maps TLID into API responses and tokenization details (also includes a list-response conversion path). |
| crates/router/src/core/payments/operations/payment_update.rs | Preserves TLID when updating payment attempts (avoids unintentionally clearing it). |
| crates/router/src/core/payments.rs | Carries TLID through MIT routing/action types and mandate reference construction. |
| crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs | Extracts TLID from Adyen responses and forwards TLID in Adyen MIT requests via additionalData. |
| crates/api_models/src/payments.rs | Adds network_transaction_link_id to API response models with documentation. |
| api-reference/v1/openapi_spec_v1.json | Documents/exposes network_transaction_link_id in OpenAPI v1 schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
4515
to
+4516
| network_transaction_id: None, | ||
| network_transaction_link_id: None, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Builds on top of PR #12260.Use actual TLID values through the payment flows for Adyen.
Changes
Adyen connector
additionalData.transactionLinkIdfrom Adyen and store onpayment_attemptandpayment_methodsMandateReferenceIdinsideget_additional_data()and send asadditionalData.transactionLinkIdto AdyenMIT routing
NTWithNTIRefand newCardWithNTIRefstructs carrytransaction_link_idalongside NTIDActionType::CardWithNetworkTransactionIdusesCardWithNTIRefstructIsNtWithNtiFlow::NtWithNtiSupportedcarriesCardWithNTIRefis_network_token_with_network_transaction_id_flow: TLID added to match tuple — same pattern asnetwork_transaction_idAPI surface
PaymentsResponseexposesnetwork_transaction_link_idPaymentMethodTokenizationDetailsexposesnetwork_transaction_link_idConfirmUpdatepassesnetwork_transaction_link_idfrom payment attemptAdditional Changes
Motivation and Context
Mastercard mandates TLID for all recurring/MIT transactions from Oct 23, 2026. Unlike Trace ID, TLID has no static fallback — missing it risks issuer declines and scheme fines.
Tracking: https://github.com/juspay/hyperswitch-cloud/issues/15984
1. 2. CIT - Create Payment with setup_future_usage (saves card + TLID)
Request
Response
2. 4. MIT - External Vault (merchant supplies NTID + TLID directly)
Request
Response
Testing
cargo checkpassesnetwork_transaction_link_idreturned in payments API responseadditionalData.transactionLinkIdpresent in connector request