mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(order_details): Adding order_details both inside and outside of metadata, in payments request, for backward compatibility (#1344)
Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
This commit is contained in:
@ -186,6 +186,14 @@ pub struct PaymentsRequest {
|
||||
/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
|
||||
pub metadata: Option<Metadata>,
|
||||
|
||||
/// Information about the product , quantity and amount for connectors. (e.g. Klarna)
|
||||
#[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#"[{
|
||||
"product_name": "gillete creme",
|
||||
"quantity": 15,
|
||||
"amount" : 900
|
||||
}]"#)]
|
||||
pub order_details: Option<Vec<OrderDetailsWithAmount>>,
|
||||
|
||||
/// It's a token used for client side verification.
|
||||
#[schema(example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")]
|
||||
pub client_secret: Option<String>,
|
||||
@ -1275,6 +1283,14 @@ pub struct PaymentsResponse {
|
||||
#[schema(value_type = Option<Object>)]
|
||||
pub metadata: Option<pii::SecretSerdeValue>,
|
||||
|
||||
/// Information about the product , quantity and amount for connectors. (e.g. Klarna)
|
||||
#[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#"[{
|
||||
"product_name": "gillete creme",
|
||||
"quantity": 15,
|
||||
"amount" : 900
|
||||
}]"#)]
|
||||
pub order_details: Option<Vec<pii::SecretSerdeValue>>,
|
||||
|
||||
/// description: The customer's email address
|
||||
#[schema(max_length = 255, value_type = Option<String>, example = "johntest@test.com")]
|
||||
pub email: crypto::OptionalEncryptableEmail,
|
||||
@ -1573,6 +1589,18 @@ pub struct PaymentsRetrieveRequest {
|
||||
pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct OrderDetailsWithAmount {
|
||||
/// Name of the product that is being purchased
|
||||
#[schema(max_length = 255, example = "shirt")]
|
||||
pub product_name: String,
|
||||
/// The quantity of the product to be purchased
|
||||
#[schema(example = 1)]
|
||||
pub quantity: u16,
|
||||
/// the amount per quantity of product
|
||||
pub amount: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct OrderDetails {
|
||||
/// Name of the product that is being purchased
|
||||
|
||||
Reference in New Issue
Block a user