mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(currency_conversion): add currency conversion feature (#2948)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -25,7 +25,7 @@ mime = "0.3.17"
|
||||
reqwest = { version = "0.11.18", optional = true }
|
||||
serde = { version = "1.0.163", features = ["derive"] }
|
||||
serde_json = "1.0.96"
|
||||
strum = { version = "0.24.1", features = ["derive"] }
|
||||
strum = { version = "0.25", features = ["derive"] }
|
||||
time = { version = "0.3.21", features = ["serde", "serde-well-known", "std"] }
|
||||
url = { version = "2.4.0", features = ["serde"] }
|
||||
utoipa = { version = "3.3.0", features = ["preserve_order"] }
|
||||
|
||||
21
crates/api_models/src/currency.rs
Normal file
21
crates/api_models/src/currency.rs
Normal file
@ -0,0 +1,21 @@
|
||||
use common_utils::events::ApiEventMetric;
|
||||
|
||||
/// QueryParams to be send to convert the amount -> from_currency -> to_currency
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct CurrencyConversionParams {
|
||||
pub amount: i64,
|
||||
pub to_currency: String,
|
||||
pub from_currency: String,
|
||||
}
|
||||
|
||||
/// Response to be send for convert currency route
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct CurrencyConversionResponse {
|
||||
pub converted_amount: String,
|
||||
pub currency: String,
|
||||
}
|
||||
|
||||
impl ApiEventMetric for CurrencyConversionResponse {}
|
||||
impl ApiEventMetric for CurrencyConversionParams {}
|
||||
@ -5,6 +5,7 @@ pub mod api_keys;
|
||||
pub mod bank_accounts;
|
||||
pub mod cards_info;
|
||||
pub mod conditional_configs;
|
||||
pub mod currency;
|
||||
pub mod customers;
|
||||
pub mod disputes;
|
||||
pub mod enums;
|
||||
|
||||
Reference in New Issue
Block a user