fix(payment_link): added amount conversion to base unit based on currency (#3162)

This commit is contained in:
Sahkal Poddar
2023-12-18 21:32:31 +05:30
committed by GitHub
parent 30fe9d19e4
commit 0fa61a9dd1
5 changed files with 56 additions and 13 deletions

View File

@ -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>,
}