You are given a CSV-like multi-line string representing transactions with columns:
id,reference,amount,currency,date,merchant_id,buyer_country,transaction_type,payment_provider,status
You must compute and print fee lines in the format:
id, transaction_type, payment_provider, fee
with one output line per input row (excluding header), preserving order.
You are given a map provider_fee_rules describing how to compute a fee for each payment_provider.
Rules:
status
is not a successful status (e.g.,
payment_failed
), fee is
0
.
Extend Part 1 so that fee may depend on both transaction_type and payment_provider.
You are given:
country_fee_rules[buyer_country] -> fee rule
(may override/extend provider rules).
T
(number of successful transactions) after which a merchant receives a discount.
d < 1
).
Requirements:
merchant_id
) based on that merchant’s cumulative successful transaction count (or volume) up to the current transaction.
amount
(integer smallest unit) and how you round fees.