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
chore(api_models)!: remove PaymentIdType::PreprocessingId variant (#14419)
Hrithikesh1445cf0a21bb
diff --git a/.gitignore b/.gitignoreindex 1f31c3c152..59b4cc3cf0 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,9 @@# Created by https://www.toptal.com/developers/gitignore/api/rust,visualstudiocode,clion,dotenv,direnv,linux,macos,windows# Edit at https://www.toptal.com/developers/gitignore?templates=rust,visualstudiocode,clion,dotenv,direnv,linux,macos,windows+### Claude Code ###+.claude/settings.local.json+### CLion #### Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 52cb9480af..d01d506e41 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -6513,8 +6513,6 @@ pub enum PaymentIdType {ConnectorTransactionId(String),/// The identifier for payment attemptPaymentAttemptId(String),- /// The identifier for preprocessing step- PreprocessingId(String),}#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, ToSchema)]@@ -6526,8 +6524,6 @@ pub enum PaymentIdType {ConnectorTransactionId(String),/// The identifier for payment attemptPaymentAttemptId(String),- /// The identifier for preprocessing step- PreprocessingId(String),}#[cfg(feature = "v1")]@@ -6548,9 +6544,6 @@ impl fmt::Display for PaymentIdType {Self::PaymentAttemptId(payment_attempt_id) => {write!(f, "payment_attempt_id = \"{payment_attempt_id}\"")}- Self::PreprocessingId(preprocessing_id) => {- write!(f, "preprocessing_id = \"{preprocessing_id}\"")- }}}}diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rsindex 77963eed72..c0cbd0ae3b 100644--- a/crates/router/src/core/payments/operations/payment_status.rs+++ b/crates/router/src/core/payments/operations/payment_status.rs@@ -718,12 +718,6 @@ pub async fn get_payment_intent_payment_attempt().await?;}- api_models::payments::PaymentIdType::PreprocessingId(_) => {- return Err(errors::StorageError::ValueNotFound(- "no payment found for the given preprocessing_id".to_string(),- )- .into());- }}error_stack::Result::<_, errors::StorageError>::Ok((pi, pa))};diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rsindex e9d2c4d1e3..0941fdfe2d 100644--- a/crates/router/src/core/webhooks/incoming.rs+++ b/crates/router/src/core/webhooks/incoming.rs@@ -1796,9 +1796,6 @@ pub async fn get_payment_attempt_from_object_reference_id().await.to_not_found_response(errors::ApiErrorResponse::WebhookResourceNotFound),- api::ObjectReferenceId::PaymentId(api::PaymentIdType::PreprocessingId(_)) => {- Err(errors::ApiErrorResponse::WebhookResourceNotFound)?- }_ => Err(errors::ApiErrorResponse::WebhookProcessingFailure).attach_printable("received a non-payment id for retrieving payment")?,}diff --git a/crates/router/src/core/webhooks/incoming_v2.rs b/crates/router/src/core/webhooks/incoming_v2.rsindex a773450bc5..ad4210ffd0 100644--- a/crates/router/src/core/webhooks/incoming_v2.rs+++ b/crates/router/src/core/webhooks/incoming_v2.rs@@ -641,7 +641,6 @@ where.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?;(payment_intent, payment_attempt)}- api_models::payments::PaymentIdType::PreprocessingId(ref _id) => todo!(),};// We need the address here to send it in the responsediff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rsindex 7fca4056a0..a5ac0b5360 100644--- a/crates/router/src/types/api/payments.rs+++ b/crates/router/src/types/api/payments.rs@@ -89,12 +89,12 @@ impl PaymentIdTypeExt for PaymentIdType {) -> errors::CustomResult<common_utils::id_type::PaymentId, errors::ValidationError> {match self {Self::PaymentIntentId(id) => Ok(id.clone()),- Self::ConnectorTransactionId(_)- | Self::PaymentAttemptId(_)- | Self::PreprocessingId(_) => Err(errors::ValidationError::IncorrectValueProvided {- field_name: "payment_id".into(),- })- .attach_printable("Expected payment intent ID but got connector transaction ID"),+ Self::ConnectorTransactionId(_) | Self::PaymentAttemptId(_) => {+ Err(errors::ValidationError::IncorrectValueProvided {+ field_name: "payment_id".into(),+ })+ .attach_printable("Expected payment intent ID but got connector transaction ID")+ }}}@@ -104,12 +104,12 @@ impl PaymentIdTypeExt for PaymentIdType {) -> errors::CustomResult<common_utils::id_type::GlobalPaymentId, errors::ValidationError> {match self {Self::PaymentIntentId(id) => Ok(id.clone()),- Self::ConnectorTransactionId(_)- | Self::PaymentAttemptId(_)- | Self::PreprocessingId(_) => Err(errors::ValidationError::IncorrectValueProvided {- field_name: "payment_id".into(),- })- .attach_printable("Expected payment intent ID but got connector transaction ID"),+ Self::ConnectorTransactionId(_) | Self::PaymentAttemptId(_) => {+ Err(errors::ValidationError::IncorrectValueProvided {+ field_name: "payment_id".into(),+ })+ .attach_printable("Expected payment intent ID but got connector transaction ID")+ }}}}diff --git a/crates/router/src/utils.rs b/crates/router/src/utils.rsindex 36f5e0ec65..e8169a88ed 100644--- a/crates/router/src/utils.rs+++ b/crates/router/src/utils.rs@@ -232,9 +232,6 @@ pub async fn find_payment_intent_from_payment_id_type(.await.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)}- payments::PaymentIdType::PreprocessingId(_) => {- Err(errors::ApiErrorResponse::PaymentNotFound)?- }}}