mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(core): [Payment Link] add dynamic merchant fields (#5512)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -30,6 +30,7 @@ routing_v2 = []
|
||||
[dependencies]
|
||||
actix-web = { version = "4.5.1", optional = true }
|
||||
error-stack = "0.4.1"
|
||||
indexmap = "2.3.0"
|
||||
mime = "0.3.17"
|
||||
reqwest = { version = "0.11.27", optional = true }
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
|
||||
@ -12,6 +12,7 @@ use common_utils::{
|
||||
not(feature = "merchant_account_v2")
|
||||
))]
|
||||
use common_utils::{crypto::OptionalEncryptableName, ext_traits::ValueExt};
|
||||
use indexmap::IndexMap;
|
||||
#[cfg(all(feature = "v2", feature = "merchant_account_v2"))]
|
||||
use masking::ExposeInterface;
|
||||
use masking::Secret;
|
||||
@ -2235,6 +2236,9 @@ pub struct PaymentLinkConfigRequest {
|
||||
/// Enable saved payment method option for payment link
|
||||
#[schema(default = false, example = true)]
|
||||
pub enabled_saved_payment_method: Option<bool>,
|
||||
/// Dynamic details related to merchant to be rendered in payment link
|
||||
#[schema(value_type = Option<Object>, example = r#"{ "value1": "some-value", "value2": "some-value" }"#)]
|
||||
pub transaction_details: Option<IndexMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, ToSchema)]
|
||||
@ -2253,6 +2257,8 @@ pub struct PaymentLinkConfig {
|
||||
pub enabled_saved_payment_method: bool,
|
||||
/// A list of allowed domains (glob patterns) where this link can be embedded / opened from
|
||||
pub allowed_domains: Option<HashSet<String>>,
|
||||
/// Dynamic details related to merchant to be rendered in payment link
|
||||
pub transaction_details: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
|
||||
|
||||
@ -5385,8 +5385,8 @@ pub struct PaymentLinkInitiateRequest {
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum PaymentLinkData {
|
||||
PaymentLinkDetails(PaymentLinkDetails),
|
||||
PaymentLinkStatusDetails(PaymentLinkStatusDetails),
|
||||
PaymentLinkDetails(Box<PaymentLinkDetails>),
|
||||
PaymentLinkStatusDetails(Box<PaymentLinkStatusDetails>),
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, Clone)]
|
||||
@ -5408,6 +5408,7 @@ pub struct PaymentLinkDetails {
|
||||
pub sdk_layout: String,
|
||||
pub display_sdk_only: bool,
|
||||
pub locale: Option<String>,
|
||||
pub transaction_details: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, Clone)]
|
||||
@ -5433,6 +5434,7 @@ pub struct PaymentLinkStatusDetails {
|
||||
pub theme: String,
|
||||
pub return_url: String,
|
||||
pub locale: Option<String>,
|
||||
pub transaction_details: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user