Skip to content

Commit

Permalink
feat(router): add connector_transaction_id in payments response (#1542
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sai-harsha-vardhan authored Jun 27, 2023
1 parent 772fc84 commit 1a8f5ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,10 @@ pub struct PaymentsResponse {
/// Any user defined fields can be passed here.
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]
pub udf: Option<pii::SecretSerdeValue>,

/// A unique identifier for a payment provided by the connector
#[schema(value_type = Option<String>, example = "993672945374576J")]
pub connector_transaction_id: Option<String>,
}

#[derive(Clone, Debug, serde::Deserialize, ToSchema)]
Expand Down
2 changes: 2 additions & 0 deletions crates/router/src/core/payments/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ where
)
.set_ephemeral_key(ephemeral_key_option.map(ForeignFrom::foreign_from))
.set_udf(payment_intent.udf)
.set_connector_transaction_id(payment_attempt.connector_transaction_id)
.to_owned(),
)
}
Expand Down Expand Up @@ -509,6 +510,7 @@ where
metadata: payment_intent.metadata,
order_details: payment_intent.order_details,
udf: payment_intent.udf,
connector_transaction_id: payment_attempt.connector_transaction_id,
..Default::default()
}),
});
Expand Down

0 comments on commit 1a8f5ff

Please sign in to comment.