Revert "backend/feat: Stripe payout dynamic transfer top-up for Fleet…#1325
Conversation
WalkthroughThis PR removes the Fleet VA balance checking and merchant account top-up logic from payout order creation across Stripe and Juspay providers. The ChangesPayout Order Top-Up Logic Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/mobility-core/src/Kernel/External/Payout/Interface/Types.hs (1)
75-92:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve backward compatibility for the
v1payout response.Removing
merchantTopUpAmounthere changes the JSON/OpenAPI shape returned by the existingCreatePayoutOrderAPIandPayoutOrderStatusAPIinlib/mobility-core/src/Kernel/External/Payout/Juspay/Flow.hs:36-52andlib/mobility-core/src/Kernel/External/Payout/Juspay/Flow.hs:60-80. Unless every caller was rolled back in lockstep, this is a breaking contract on av1API. Safer options are to keep the field as deprecated and returnNothing, or introduce a new versioned response type.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/mobility-core/src/Kernel/External/Payout/Interface/Types.hs` around lines 75 - 92, The CreatePayoutOrderResp type was changed and removed merchantTopUpAmount which breaks the v1 JSON contract used by CreatePayoutOrderAPI and PayoutOrderStatusAPI (see Juspay Flow handlers); restore backward compatibility by adding merchantTopUpAmount :: Maybe HighPrecMoney back into CreatePayoutOrderResp (marked deprecated in comments) and ensure serialization still emits null when unset, or alternatively introduce a new versioned response type (e.g., CreatePayoutOrderRespV2) and update the Juspay Flow handlers to return the appropriate version while leaving the v1 handlers unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@lib/mobility-core/src/Kernel/External/Payout/Interface/Types.hs`:
- Around line 75-92: The CreatePayoutOrderResp type was changed and removed
merchantTopUpAmount which breaks the v1 JSON contract used by
CreatePayoutOrderAPI and PayoutOrderStatusAPI (see Juspay Flow handlers);
restore backward compatibility by adding merchantTopUpAmount :: Maybe
HighPrecMoney back into CreatePayoutOrderResp (marked deprecated in comments)
and ensure serialization still emits null when unset, or alternatively introduce
a new versioned response type (e.g., CreatePayoutOrderRespV2) and update the
Juspay Flow handlers to return the appropriate version while leaving the v1
handlers unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9c53e215-5710-46d0-b2f0-f11d26fc71b9
📒 Files selected for processing (5)
lib/mobility-core/src/Kernel/External/Payout/Interface.hslib/mobility-core/src/Kernel/External/Payout/Interface/Juspay.hslib/mobility-core/src/Kernel/External/Payout/Interface/Stripe.hslib/mobility-core/src/Kernel/External/Payout/Interface/Types.hslib/mobility-core/src/Kernel/External/Payout/Stripe/Flow.hs
💤 Files with no reviewable changes (3)
- lib/mobility-core/src/Kernel/External/Payout/Interface/Juspay.hs
- lib/mobility-core/src/Kernel/External/Payout/Stripe/Flow.hs
- lib/mobility-core/src/Kernel/External/Payout/Interface/Stripe.hs
… VA insufficient balance (#1320)"
This reverts commit 1e3abfa.
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.shSummary by CodeRabbit
New Features
Refactor