mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(connector): [Nexixpay] update status mapping nexixpay (#7612)
Co-authored-by: Mrudul Vajpayee <mrudul.vajpayee@mrudulvajpayee-XJWXCWP7HF.local>
This commit is contained in:
@ -632,7 +632,7 @@ impl TryFrom<&ConnectorAuthType> for NexixpayAuthType {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
|
||||
pub enum NexixpayPaymentStatus {
|
||||
Authorized,
|
||||
@ -968,8 +968,15 @@ impl<F>
|
||||
meta_data,
|
||||
is_auto_capture,
|
||||
})?);
|
||||
let status = if item.data.request.amount == 0
|
||||
&& item.response.operation.operation_result == NexixpayPaymentStatus::Authorized
|
||||
{
|
||||
AttemptStatus::Charged
|
||||
} else {
|
||||
AttemptStatus::from(item.response.operation.operation_result.clone())
|
||||
};
|
||||
Ok(Self {
|
||||
status: AttemptStatus::from(item.response.operation.operation_result),
|
||||
status,
|
||||
response: Ok(PaymentsResponseData::TransactionResponse {
|
||||
resource_id: ResponseId::ConnectorTransactionId(
|
||||
item.response.operation.order_id.clone(),
|
||||
|
||||
@ -5972,7 +5972,7 @@ pub(crate) fn convert_setup_mandate_router_data_to_authorize_router_data(
|
||||
order_tax_amount: Some(MinorUnit::zero()),
|
||||
minor_amount: MinorUnit::new(0),
|
||||
statement_descriptor: None,
|
||||
capture_method: None,
|
||||
capture_method: data.request.capture_method,
|
||||
webhook_url: None,
|
||||
complete_authorize_url: None,
|
||||
browser_info: data.request.browser_info.clone(),
|
||||
|
||||
Reference in New Issue
Block a user