Skip to content

feat(connector): [Datatrans] Accept connector_intent_metadata in authorize and capture flow and pass it to the connector - #2093

Open
Vani-1107 wants to merge 6 commits into
mainfrom
datatrans-mcp-metadata
Open

feat(connector): [Datatrans] Accept connector_intent_metadata in authorize and capture flow and pass it to the connector#2093
Vani-1107 wants to merge 6 commits into
mainfrom
datatrans-mcp-metadata

Conversation

@Vani-1107

@Vani-1107 Vani-1107 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds support for accepting and propagating connector_intent_metadata for the Datatrans connector across the payment authorize and capture flows.

Motivation and Context

Additional Changes

  • This PR modifies the API contract
  • This PR modifies application configuration/environment variables

How did you test it?

Refer to juspay/hyperswitch#13638 for test case

@Vani-1107
Vani-1107 requested review from a team as code owners August 11, 2026 15:45
@Vani-1107 Vani-1107 self-assigned this Aug 11, 2026
@XyneSpaces

Copy link
Copy Markdown

⚠️ Authorize/capture flows now forward MCP amount/currency from connector_intent_metadata to Datatrans. This money-movement change has no new test or spec coverage. Add a connector spec or harness scenario exercising the metadata passthrough.

💡 connector_intent_metadata: None is hardcoded in the composite-service PaymentsAuthorizeData conversion (line ~319) and again at line ~1119. If the source request carries the field, it is dropped before Datatrans receives it. Verify the source lacks it or propagate it through the conversion.

💡 connector_intent_metadata: None is also hardcoded in the composite-service PaymentsCaptureData conversion (line ~817). Verify the source lacks the field or propagate it so capture metadata reaches the connector.

💡 New proto field numbers (52, 15, 39) are fresh and not reused, but only the TypeScript generated-client update is visible in the diff. Ensure all generated Rust artifacts in grpc-api-types are regenerated.

authentication_data,
metadata: item.metadata.clone(),
connector_feature_data,
connector_intent_metadata: None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't keep this None, add the same field in composite proto and map the field.

/// The targeted currency.
pub currency: Currency,
/// The amount in the targeted currency.
pub amount: i64,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why i64?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it to MinorUnit

Comment on lines +768 to +774
pub struct ConnectorIntentMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub datatrans: Option<DatatransConnectorMetadataData>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DatatransConnectorMetadataData {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the type of ConnectorIntentMetadata in proto is generic and we are avoiding connector specific then we can do the same in domain as well, we can have this connector specific structs in their own connector file. Or is there any case where DatatransConnectorMetadataData can be used by other connector ?

optional SplitPaymentsDetails split_payments = 14;

// Connector-specific intent metadata for the transaction.
optional SecretString connector_intent_metadata = 15;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need intent metadata in capture request?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this information, which is provided by the merchant during the auth flow, to be sent to the connector in the capture flow as well.

@Vani-1107
Vani-1107 force-pushed the datatrans-mcp-metadata branch from 3bb4b57 to 1958908 Compare August 17, 2026 13:18
Vani-1107 and others added 3 commits August 17, 2026 18:50
Auto-applied by CI:
- cargo +nightly fmt --all
- make -C sdk generate (if applicable)
- make docs (if applicable)

This commit was automatically generated by GitHub Actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants