Skip to content

Commit

Permalink
fix(router): [Iatapay] add CLEARED refund status (#5231)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
AkshayaFoiger and hyperswitch-bot[bot] authored Jul 8, 2024
1 parent 864d53c commit d4813b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/router/src/connector/iatapay/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ pub enum RefundStatus {
Initiated,
Authorized,
Settled,
Cleared,
Failed,
}

Expand All @@ -474,6 +475,7 @@ impl From<RefundStatus> for enums::RefundStatus {
RefundStatus::Initiated => Self::Pending,
RefundStatus::Authorized => Self::Pending,
RefundStatus::Settled => Self::Success,
RefundStatus::Cleared => Self::Success,
}
}
}
Expand Down Expand Up @@ -640,9 +642,9 @@ impl TryFrom<IatapayWebhookResponse> for api::IncomingWebhookEvent {
| IatapayWebhookStatus::Unknown => Ok(Self::EventNotSupported),
},
IatapayWebhookResponse::IatapayRefundWebhookBody(wh_body) => match wh_body.status {
IatapayRefundWebhookStatus::Authorized | IatapayRefundWebhookStatus::Settled => {
Ok(Self::RefundSuccess)
}
IatapayRefundWebhookStatus::Cleared
| IatapayRefundWebhookStatus::Authorized
| IatapayRefundWebhookStatus::Settled => Ok(Self::RefundSuccess),
IatapayRefundWebhookStatus::Failed => Ok(Self::RefundFailure),
IatapayRefundWebhookStatus::Created
| IatapayRefundWebhookStatus::Locked
Expand Down Expand Up @@ -678,6 +680,7 @@ pub enum IatapayRefundWebhookStatus {
Authorized,
Settled,
Failed,
Cleared,
Locked,
#[serde(other)]
Unknown,
Expand Down

0 comments on commit d4813b9

Please sign in to comment.