Skip to content

Commit

Permalink
fix(router): [Iatapay] add CLEARED refund status (#5244)
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>
Co-authored-by: Gnanasundari24 <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent bb436f3 commit 6263c85
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 @@ -464,6 +464,7 @@ pub enum RefundStatus {
Initiated,
Authorized,
Settled,
Cleared,
Failed,
}

Expand All @@ -476,6 +477,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 @@ -642,9 +644,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 @@ -680,6 +682,7 @@ pub enum IatapayRefundWebhookStatus {
Authorized,
Settled,
Failed,
Cleared,
Locked,
#[serde(other)]
Unknown,
Expand Down

0 comments on commit 6263c85

Please sign in to comment.