← 返回 stripe 的题目列表Transaction Fee Calculation
类型:online_judge
Given a set of transaction records, where each record includes transaction id, transaction type, payment provider, and amount. You need to calculate the transaction fee according to specific rules and output the result in the required format. Details are as follows:
Input: CSV format, with each line representing a transaction record in the format: id,transaction_type,payment_provider,status,amount.
Output: CSV format, with each line representing a transaction and its fee in the format: id,transaction_type,payment_provider,fee.
Rules: The fee may vary for different payment providers and transaction types, calculate the fee based on the rules provided during the interview.
Example Input:
py_1,payment,card,completed,100
py_2,payment,card,pending,50
py_3,payment,klarna,completed,200
Example Output:
py_1,payment,card,51
py_2,payment,card,0
py_3,payment,klarna,101
Example
Input
py_1,payment,card,completed,100
py_2,payment,card,pending,50
py_3,payment,klarna,completed,200