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

Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com>
This commit is contained in:
Prasunna Soppa
2023-11-03 17:14:58 +05:30
committed by GitHub
parent 603215db05
commit 255a4f89a8

View File

@ -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>,