Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix(router): aggregate critical hotfixes for v0.5.10 (#1162)
ItsMeShashanked22b2af7634
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex fa44ab63ab..86fa2c9686 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -1523,7 +1523,7 @@ pub struct GpayTransactionInfo {/// The total price status (ex: 'FINAL')pub total_price_status: String,/// The total price- pub total_price: i64,+ pub total_price: String,}#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]diff --git a/crates/router/src/connector/bluesnap.rs b/crates/router/src/connector/bluesnap.rsindex abe5fe734e..061619de99 100644--- a/crates/router/src/connector/bluesnap.rs+++ b/crates/router/src/connector/bluesnap.rs@@ -10,7 +10,9 @@ use common_utils::{use error_stack::{IntoReport, ResultExt};use transformers as bluesnap;-use super::utils::{self as connector_utils, RefundsRequestData, RouterData};+use super::utils::{+ self as connector_utils, PaymentsAuthorizeRequestData, RefundsRequestData, RouterData,+};use crate::{configs::settings,consts,@@ -517,7 +519,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::Preq: &types::PaymentsAuthorizeRouterData,connectors: &settings::Connectors,) -> CustomResult<String, errors::ConnectorError> {- match req.is_three_ds() {+ match req.is_three_ds() && !req.request.is_wallet() {true => Ok(format!("{}{}{}",self.base_url(connectors),@@ -570,7 +572,7 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::Pdata: &types::PaymentsAuthorizeRouterData,res: Response,) -> CustomResult<types::PaymentsAuthorizeRouterData, errors::ConnectorError> {- match (data.is_three_ds(), res.headers) {+ match (data.is_three_ds() && !data.request.is_wallet(), res.headers) {(true, Some(headers)) => {let location = connector_utils::get_http_header("Location", &headers)?;let payment_fields_token = locationdiff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rsindex 461c9d6e33..f68e54ef9f 100644--- a/crates/router/src/connector/utils.rs+++ b/crates/router/src/connector/utils.rs@@ -170,6 +170,7 @@ pub trait PaymentsAuthorizeRequestData {fn is_mandate_payment(&self) -> bool;fn get_webhook_url(&self) -> Result<String, Error>;fn get_router_return_url(&self) -> Result<String, Error>;+ fn is_wallet(&self) -> bool;fn get_payment_method_type(&self) -> Result<storage_models::enums::PaymentMethodType, Error>;}@@ -234,6 +235,10 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData {.clone().ok_or_else(missing_field_err("webhook_url"))}+ fn is_wallet(&self) -> bool {+ matches!(self.payment_method_data, api::PaymentMethodData::Wallet(_))+ }+fn get_payment_method_type(&self) -> Result<storage_models::enums::PaymentMethodType, Error> {self.payment_method_type.to_owned()diff --git a/crates/router/src/core/payment_methods/cards.rs b/crates/router/src/core/payment_methods/cards.rsindex 8e12da732b..cde48cc4a9 100644--- a/crates/router/src/core/payment_methods/cards.rs+++ b/crates/router/src/core/payment_methods/cards.rs@@ -1098,7 +1098,7 @@ pub async fn list_payment_methods(}#[allow(clippy::too_many_arguments)]-async fn filter_payment_methods(+pub async fn filter_payment_methods(payment_methods: Vec<serde_json::Value>,req: &mut api::PaymentMethodListRequest,resp: &mut Vec<ResponsePaymentMethodIntermediate>,diff --git a/crates/router/src/core/payments/flows/session_flow.rs b/crates/router/src/core/payments/flows/session_flow.rsindex e95f0c5af4..20d820a520 100644--- a/crates/router/src/core/payments/flows/session_flow.rs+++ b/crates/router/src/core/payments/flows/session_flow.rs@@ -251,7 +251,14 @@ fn create_gpay_session_token(country_code: session_data.country.unwrap_or_default(),currency_code: router_data.request.currency.to_string(),total_price_status: "Final".to_string(),- total_price: router_data.request.amount,+ total_price: utils::to_currency_base_unit(+ router_data.request.amount,+ router_data.request.currency,+ )+ .attach_printable("Cannot convert given amount to base currency denomination".to_string())+ .change_context(errors::ApiErrorResponse::InvalidDataValue {+ field_name: "amount",+ })?,};let response_router_data = types::PaymentsSessionRouterData {diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rsindex ed5afe925d..477c39b69d 100644--- a/crates/router/src/core/payments/helpers.rs+++ b/crates/router/src/core/payments/helpers.rs@@ -1282,7 +1282,7 @@ pub(crate) fn validate_pm_or_token_given(}// A function to perform database lookup and then verify the client secret-pub(crate) async fn verify_payment_intent_time_and_client_secret(+pub async fn verify_payment_intent_time_and_client_secret(db: &dyn StorageInterface,merchant_account: &merchant_account::MerchantAccount,client_secret: Option<String>,