@@ -9,7 +9,6 @@ use common_utils::{
9
9
} ;
10
10
#[ cfg( feature = "v1" ) ]
11
11
use common_utils:: { crypto:: OptionalEncryptableName , ext_traits:: ValueExt } ;
12
- use indexmap:: IndexMap ;
13
12
#[ cfg( feature = "v2" ) ]
14
13
use masking:: ExposeInterface ;
15
14
use masking:: Secret ;
@@ -2584,8 +2583,32 @@ pub struct PaymentLinkConfigRequest {
2584
2583
#[ schema( default = false , example = true ) ]
2585
2584
pub enabled_saved_payment_method : Option < bool > ,
2586
2585
/// Dynamic details related to merchant to be rendered in payment link
2587
- #[ schema( value_type = Option <Object >, example = r#"{ "value1": "some-value", "value2": "some-value" }"# ) ]
2588
- pub transaction_details : Option < IndexMap < String , String > > ,
2586
+ pub transaction_details : Option < Vec < PaymentLinkTransactionDetails > > ,
2587
+ }
2588
+
2589
+ #[ derive( Clone , Debug , serde:: Deserialize , serde:: Serialize , PartialEq , ToSchema ) ]
2590
+ pub struct PaymentLinkTransactionDetails {
2591
+ /// Key for the transaction details
2592
+ #[ schema( value_type = String , max_length = 255 , example = "Policy-Number" ) ]
2593
+ pub key : String ,
2594
+ /// Value for the transaction details
2595
+ #[ schema( value_type = String , max_length = 255 , example = "297472368473924" ) ]
2596
+ pub value : String ,
2597
+ /// UI configuration for the transaction details
2598
+ pub ui_configuration : Option < TransactionDetailsUiConfiguration > ,
2599
+ }
2600
+
2601
+ #[ derive( Clone , Debug , serde:: Deserialize , serde:: Serialize , PartialEq , ToSchema ) ]
2602
+ pub struct TransactionDetailsUiConfiguration {
2603
+ /// Position of the key-value pair in the UI
2604
+ #[ schema( value_type = Option <i8 >, example = 5 ) ]
2605
+ pub position : Option < i8 > ,
2606
+ /// Whether the key should be bold
2607
+ #[ schema( default = false , example = true ) ]
2608
+ pub is_key_bold : Option < bool > ,
2609
+ /// Whether the value should be bold
2610
+ #[ schema( default = false , example = true ) ]
2611
+ pub is_value_bold : Option < bool > ,
2589
2612
}
2590
2613
2591
2614
#[ derive( Clone , Debug , serde:: Serialize , serde:: Deserialize , PartialEq , ToSchema ) ]
@@ -2605,7 +2628,7 @@ pub struct PaymentLinkConfig {
2605
2628
/// A list of allowed domains (glob patterns) where this link can be embedded / opened from
2606
2629
pub allowed_domains : Option < HashSet < String > > ,
2607
2630
/// Dynamic details related to merchant to be rendered in payment link
2608
- pub transaction_details : Option < String > ,
2631
+ pub transaction_details : Option < Vec < PaymentLinkTransactionDetails > > ,
2609
2632
}
2610
2633
2611
2634
#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize , PartialEq , Eq ) ]
0 commit comments