Skip to content

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

fix(connector): [Cryptopay]Remove default case handling for Cryptopay (#2699)

Prasunna Soppa255a4f89a8e0
diff --git a/crates/router/src/connector/cryptopay/transformers.rs b/crates/router/src/connector/cryptopay/transformers.rs
index 8d9f277dd0..0bc4ff3b3a 100644
--- a/crates/router/src/connector/cryptopay/transformers.rs
+++ b/crates/router/src/connector/cryptopay/transformers.rs
@@ -111,10 +111,9 @@ impl TryFrom<&types::ConnectorAuthType> for CryptopayAuthType {
}
}
// PaymentsResponse
-#[derive(Debug, Clone, Default, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum CryptopayPaymentStatus {
- #[default]
New,
Completed,
Unresolved,
@@ -128,13 +127,14 @@ impl From<CryptopayPaymentStatus> for enums::AttemptStatus {
CryptopayPaymentStatus::New => Self::AuthenticationPending,
CryptopayPaymentStatus::Completed => Self::Charged,
CryptopayPaymentStatus::Cancelled => Self::Failure,
- CryptopayPaymentStatus::Unresolved => Self::Unresolved,
- _ => Self::Voided,
+ CryptopayPaymentStatus::Unresolved | CryptopayPaymentStatus::Refunded => {
+ Self::Unresolved
+ } //mapped refunded to Unresolved because refund api is not available, also merchant has done the action on the connector dashboard.
}
}
}
-#[derive(Default, Debug, Serialize, Deserialize)]
+#[derive(Debug, Serialize, Deserialize)]
pub struct CryptopayPaymentsResponse {
data: CryptopayPaymentResponseData,
}
@@ -190,7 +190,7 @@ pub struct CryptopayErrorResponse {
pub error: CryptopayErrorData,
}
-#[derive(Debug, Default, Serialize, Deserialize)]
+#[derive(Debug, Serialize, Deserialize)]
pub struct CryptopayPaymentResponseData {
pub id: String,
pub custom_id: Option<String>,