Open geekelo opened 2 months ago
The Api::V1::P2pTrades::FeesController
is a straightforward controller responsible for handling requests related to fees in P2P trades. Here’s a breakdown:
The FeesController
calculates and returns the trading fees based on the given gross amount.
index
:
gross_amount
: The gross amount for which the fee is calculated. Defaults to 0.00
if not provided.FeeService
object with the given gross_amount
, the type of fee ('p2p'), a placeholder value (0
), and the fee provider ('bananacrystal').bananacrystal_trading_fee
method on the FeeService
instance to compute the fees.FeeService
based on the gross_amount
provided, defaulting to 0.00
if not specified, and returns these fees as JSON.This controller is designed to interact with the FeeService
for calculating fees, keeping the controller's logic focused on handling requests and delegating the fee calculation to a service object.