Refactor(router): router_parameters field inclusion (#1251)

This commit is contained in:
Prajjwal Kumar
2023-05-24 15:09:53 +05:30
committed by GitHub
parent a359b76d09
commit 16cd32513b
3 changed files with 5 additions and 1 deletions

View File

@ -655,6 +655,7 @@ impl Connector {
Copy, Copy,
Debug, Debug,
Eq, Eq,
Hash,
PartialEq, PartialEq,
serde::Serialize, serde::Serialize,
serde::Deserialize, serde::Deserialize,

View File

@ -1,4 +1,4 @@
use std::num::NonZeroI64; use std::{collections::HashMap, num::NonZeroI64};
use cards::CardNumber; use cards::CardNumber;
use common_utils::{pii, pii::Email}; use common_utils::{pii, pii::Email};
@ -1570,6 +1570,8 @@ pub struct OrderDetails {
pub struct Metadata { pub struct Metadata {
/// Information about the product and quantity for specific connectors. (e.g. Klarna) /// Information about the product and quantity for specific connectors. (e.g. Klarna)
pub order_details: Option<Vec<OrderDetails>>, pub order_details: Option<Vec<OrderDetails>>,
/// Information used for routing
pub routing_parameters: Option<HashMap<String, String>>,
/// Any other metadata that is to be provided /// Any other metadata that is to be provided
#[schema(value_type = Object, example = r#"{ "city": "NY", "unit": "245" }"#)] #[schema(value_type = Object, example = r#"{ "city": "NY", "unit": "245" }"#)]
#[serde(flatten)] #[serde(flatten)]

View File

@ -344,6 +344,7 @@ impl PaymentRedirectFlow for PaymentRedirectCompleteAuthorize {
payment_id: Some(req.resource_id.clone()), payment_id: Some(req.resource_id.clone()),
merchant_id: req.merchant_id.clone(), merchant_id: req.merchant_id.clone(),
metadata: Some(Metadata { metadata: Some(Metadata {
routing_parameters: None,
order_details: None, order_details: None,
data: masking::Secret::new("{}".into()), data: masking::Secret::new("{}".into()),
payload: Some(req.json_payload.unwrap_or(serde_json::json!({})).into()), payload: Some(req.json_payload.unwrap_or(serde_json::json!({})).into()),