fix: move platform fee fields to body level in batchPay endpoint#185
Conversation
Fixes RequestNetwork#182 - Move feePercentage and feeAddress from requests array to body level - Ensures platform fees are collected for both batch payouts and batch invoice payments - Matches the pattern used in the single pay endpoint - Prevents revenue loss on batch transactions
WalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-10-13T19:12:34.359ZApplied to files:
📚 Learning: 2025-06-04T12:02:39.411ZApplied to files:
📚 Learning: 2025-02-12T12:40:14.742ZApplied to files:
🧬 Code graph analysis (1)src/server/routers/payment.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
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 |
Greptile SummaryThis PR fixes a critical revenue loss bug where batch payments ( Key changes:
Impact:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant batchPay as batchPay Endpoint
participant Env as Environment Variables
participant API as v2/payouts/batch API
Client->>batchPay: Request batch payment
Note over Client,batchPay: input: { payouts/requestIds, payer }
batchPay->>batchPay: Check user authorization
batchPay->>Env: Read FEE_PERCENTAGE_FOR_PAYMENT
Env-->>batchPay: feePercentage value
batchPay->>Env: Read FEE_ADDRESS_FOR_PAYMENT
Env-->>batchPay: feeAddress value
alt Both fee values present
batchPay->>API: POST with fee fields at body level
Note over batchPay,API: { requests/requestIds, payer,<br/>feePercentage, feeAddress }
else Missing fee values
batchPay->>API: POST without fee fields
Note over batchPay,API: { requests/requestIds, payer }
end
API-->>batchPay: Payment response
batchPay-->>Client: Return response.data
|
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
|
Approved, great work @mayur1377 |
|
Congratulations, your pull request has been merged! Thank you for your valuable contribution to Request Network. As a reminder, every merged PR is automatically entered into our Best PR Initiative, offering a quarterly prize of $500. Your work significantly supports our project's growth, and we encourage you to continue engaging with our community. Additionally, if you want to build or add crypto payments and invoicing features, explore how our API can reduce deployment time from months to hours while offering advanced features. Book a call with our expert to learn more and fast-track your development. |
Fixes #182
Moved
feePercentageandfeeAddressfrom inside therequests.map()callback to the body level where the API expects them. This matches the pattern used in the singlepayendpoint.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.