Skip to content

Commit

Permalink
fix(analytics): sanitize sankey response data with correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maverox committed Nov 7, 2024
1 parent 6f56e4a commit 6ae2fb6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions crates/analytics/src/payment_intents/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,21 @@ pub async fn get_sankey(
i.refunds_status.unwrap_or_default().as_ref(),
i.attempt_count,
) {
(IntentStatus::Succeeded, SessionizerRefundStatus::FullRefunded, 1) => {
sankey_response.refunded += i.count;
sankey_response.normal_success += i.count
}
(IntentStatus::Succeeded, SessionizerRefundStatus::PartialRefunded, 1) => {
sankey_response.partial_refunded += i.count;
sankey_response.normal_success += i.count
}
(IntentStatus::Succeeded, SessionizerRefundStatus::FullRefunded, _) => {
sankey_response.refunded += i.count
sankey_response.refunded += i.count;
sankey_response.smart_retried_success += i.count
}
(IntentStatus::Succeeded, SessionizerRefundStatus::PartialRefunded, _) => {
sankey_response.partial_refunded += i.count
sankey_response.partial_refunded += i.count;
sankey_response.smart_retried_success += i.count
}
(
IntentStatus::Succeeded
Expand Down

0 comments on commit 6ae2fb6

Please sign in to comment.