mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
feat(payment_request): add field amount to OrderDetails and make order_details a Vec in payments_create request (#964)
This commit is contained in:
@ -36,6 +36,7 @@ pub struct PaymentIntent {
|
||||
pub active_attempt_id: String,
|
||||
pub business_country: storage_enums::CountryAlpha2,
|
||||
pub business_label: String,
|
||||
pub meta_data: Option<pii::SecretSerdeValue>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -78,6 +79,7 @@ pub struct PaymentIntentNew {
|
||||
pub active_attempt_id: String,
|
||||
pub business_country: storage_enums::CountryAlpha2,
|
||||
pub business_label: String,
|
||||
pub meta_data: Option<pii::SecretSerdeValue>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@ -89,6 +91,7 @@ pub enum PaymentIntentUpdate {
|
||||
},
|
||||
MetadataUpdate {
|
||||
metadata: pii::SecretSerdeValue,
|
||||
meta_data: pii::SecretSerdeValue,
|
||||
},
|
||||
ReturnUrlUpdate {
|
||||
return_url: Option<String>,
|
||||
@ -142,6 +145,7 @@ pub struct PaymentIntentUpdateInternal {
|
||||
pub active_attempt_id: Option<String>,
|
||||
pub business_country: Option<storage_enums::CountryAlpha2>,
|
||||
pub business_label: Option<String>,
|
||||
pub meta_data: Option<pii::SecretSerdeValue>,
|
||||
}
|
||||
|
||||
impl PaymentIntentUpdate {
|
||||
@ -169,6 +173,7 @@ impl PaymentIntentUpdate {
|
||||
.shipping_address_id
|
||||
.or(source.shipping_address_id),
|
||||
modified_at: common_utils::date_time::now(),
|
||||
meta_data: internal_update.meta_data.or(source.meta_data),
|
||||
..source
|
||||
}
|
||||
}
|
||||
@ -203,8 +208,12 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
|
||||
business_label,
|
||||
..Default::default()
|
||||
},
|
||||
PaymentIntentUpdate::MetadataUpdate { metadata } => Self {
|
||||
PaymentIntentUpdate::MetadataUpdate {
|
||||
metadata,
|
||||
meta_data,
|
||||
} => Self {
|
||||
metadata: Some(metadata),
|
||||
meta_data: Some(meta_data),
|
||||
modified_at: Some(common_utils::date_time::now()),
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@ -353,6 +353,7 @@ diesel::table! {
|
||||
active_attempt_id -> Varchar,
|
||||
business_country -> CountryAlpha2,
|
||||
business_label -> Varchar,
|
||||
meta_data -> Nullable<Jsonb>,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user