mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +08:00
feat(core): Add support for updating metadata after payment has been authorized (#7776)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -32,7 +32,7 @@ use crate::{
|
||||
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
|
||||
PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
|
||||
PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
|
||||
RedirectionResponse,
|
||||
PaymentsUpdateMetadataRequest, PaymentsUpdateMetadataResponse, RedirectionResponse,
|
||||
},
|
||||
};
|
||||
|
||||
@ -93,6 +93,24 @@ impl ApiEventMetric for PaymentsPostSessionTokensRequest {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsUpdateMetadataRequest {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsUpdateMetadataResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
Some(ApiEventsType::Payment {
|
||||
payment_id: self.payment_id.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1")]
|
||||
impl ApiEventMetric for PaymentsPostSessionTokensResponse {
|
||||
fn get_api_event_type(&self) -> Option<ApiEventsType> {
|
||||
|
||||
@ -6442,6 +6442,28 @@ pub struct PaymentsSessionRequest {
|
||||
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PaymentsUpdateMetadataRequest {
|
||||
/// The unique identifier for the payment
|
||||
#[serde(skip_deserializing)]
|
||||
#[schema(value_type = String)]
|
||||
pub payment_id: id_type::PaymentId,
|
||||
/// Metadata is useful for storing additional, unstructured information on an object.
|
||||
#[schema(value_type = Object, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]
|
||||
pub metadata: pii::SecretSerdeValue,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct PaymentsUpdateMetadataResponse {
|
||||
/// The identifier for the payment
|
||||
#[schema(value_type = String)]
|
||||
pub payment_id: id_type::PaymentId,
|
||||
/// Metadata is useful for storing additional, unstructured information on an object.
|
||||
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]
|
||||
pub metadata: Option<pii::SecretSerdeValue>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct PaymentsPostSessionTokensRequest {
|
||||
/// The unique identifier for the payment
|
||||
|
||||
Reference in New Issue
Block a user