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(connector): [CashToCode] Transform minor units to major units (#1964)
BallaNiteshff2efe88357a
diff --git a/crates/router/src/connector/cashtocode/transformers.rs b/crates/router/src/connector/cashtocode/transformers.rsindex 4c9582deaf..69c5c98339 100644--- a/crates/router/src/connector/cashtocode/transformers.rs+++ b/crates/router/src/connector/cashtocode/transformers.rs@@ -3,7 +3,7 @@ use masking::Secret;use serde::{Deserialize, Serialize};use crate::{- connector::utils::RouterData,+ connector::utils::{self, PaymentsAuthorizeRequestData, RouterData},core::errors,services,types::{self, api, storage::enums},@@ -12,7 +12,7 @@ use crate::{#[derive(Default, Debug, Serialize)]#[serde(rename_all = "camelCase")]pub struct CashtocodePaymentsRequest {- amount: i64,+ amount: f64,transaction_id: String,user_id: Secret<String>,currency: enums::Currency,@@ -49,7 +49,7 @@ fn get_mandatory_params(item: &types::PaymentsAuthorizeRouterData,) -> Result<CashToCodeMandatoryParams, error_stack::Report<errors::ConnectorError>> {let customer_id = item.get_customer_id()?;- let url = item.get_return_url()?;+ let url = item.request.get_router_return_url()?;Ok(CashToCodeMandatoryParams {user_id: Secret::new(customer_id.to_owned()),user_alias: Secret::new(customer_id),@@ -65,7 +65,10 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for CashtocodePaymentsRequestlet mid = get_mid(&item.request.payment_method_data)?;match item.payment_method {diesel_models::enums::PaymentMethod::Reward => Ok(Self {- amount: item.request.amount,+ amount: utils::to_currency_base_unit_asf64(+ item.request.amount,+ item.request.currency,+ )?,transaction_id: item.attempt_id.clone(),currency: item.request.currency,user_id: params.user_id,