refactor(router): Remove refunds_v2 feature flag (#8310)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prasunna Soppa
2025-06-25 15:50:42 +05:30
committed by GitHub
parent ecd05d53c9
commit c5c0e677f2
24 changed files with 362 additions and 482 deletions

View File

@ -1,3 +1,4 @@
use diesel_models::refund as diesel_refund;
use error_stack::report;
use router_env::{instrument, tracing};
use time::PrimitiveDateTime;
@ -45,7 +46,7 @@ pub fn validate_success_transaction(
#[instrument(skip_all)]
pub fn validate_refund_amount(
amount_captured: i64,
all_refunds: &[storage::Refund],
all_refunds: &[diesel_refund::Refund],
refund_amount: i64,
) -> CustomResult<(), RefundValidationError> {
let total_refunded_amount: i64 = all_refunds
@ -86,7 +87,7 @@ pub fn validate_payment_order_age(
#[instrument(skip_all)]
pub fn validate_maximum_refund_against_payment_attempt(
all_refunds: &[storage::Refund],
all_refunds: &[diesel_refund::Refund],
refund_max_attempts: usize,
) -> CustomResult<(), RefundValidationError> {
utils::when(all_refunds.len() > refund_max_attempts, || {