mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(payment_link): added amount conversion to base unit based on currency (#3162)
This commit is contained in:
@ -3355,7 +3355,7 @@ pub struct PaymentLinkInitiateRequest {
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct PaymentLinkDetails {
|
||||
pub amount: i64,
|
||||
pub amount: String,
|
||||
pub currency: api_enums::Currency,
|
||||
pub pub_key: String,
|
||||
pub client_secret: String,
|
||||
@ -3365,7 +3365,7 @@ pub struct PaymentLinkDetails {
|
||||
pub merchant_logo: String,
|
||||
pub return_url: String,
|
||||
pub merchant_name: String,
|
||||
pub order_details: Option<Vec<OrderDetailsWithAmount>>,
|
||||
pub order_details: Option<Vec<OrderDetailsWithStringAmount>>,
|
||||
pub max_items_visible_after_collapse: i8,
|
||||
pub sdk_theme: Option<String>,
|
||||
}
|
||||
@ -3423,3 +3423,17 @@ pub struct PaymentLinkListResponse {
|
||||
// The list of payment link response objects
|
||||
pub data: Vec<PaymentLinkResponse>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||
pub struct OrderDetailsWithStringAmount {
|
||||
/// 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: String,
|
||||
/// Product Image link
|
||||
pub product_img_link: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user