Charge each payout its tier's fee
Merchant payouts are charged a processing fee that depends on how large the payout is. Each payout falls into exactly one tier, and the fee is a percentage of the amount plus a flat component.
For each payout return payout_id, amount, the fee charged, and net_amount — what the merchant actually receives. Round the fee to 2 decimal places, and subtract that rounded fee to get net_amount, so the two figures agree on a statement.
Order by payout_id.
Schema
| tier | TEXT |
| min_amount | NUMERIC |
| max_amount | NUMERIC |
| fee_pct | NUMERIC |
| flat_fee | NUMERIC |
| payout_id | INT |
| merchant | TEXT |
| amount | NUMERIC |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime