Documentation Index
Fetch the complete documentation index at: https://mintlify.com/theresasogunle/Fintech-flutterwave-Java-Library/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheFees class allows you to calculate transaction fees before processing a payment. This helps you display accurate fee information to your users and understand the costs associated with different transaction types.
Class: Fees
Methods
getFees()
Calculates the transaction fee for a given amount and currency.JSONObject - Fee calculation details including the fee amount and total
Description: This method calculates the standard transaction fee based on the amount and currency set in the class properties. The fee is calculated using Flutterwave’s standard fee structure.
Example
getFeesForCard6()
Calculates the transaction fee including international card fees based on the first 6 digits of the card number.JSONObject - Fee calculation details including international fees if applicable
Description: This method is used when the user has entered the first 6 digits of their card number. It helps determine international fees on the transaction if the card being used is an international card. The BIN (Bank Identification Number) is used to identify the card type and origin.
Parameters Required
Before calling this method, set the following properties:The transaction amount
The currency code (e.g., “NGN”, “USD”, “GHS”)
The first 6 digits of the card number (BIN)
Example
Setter Methods
TheFees class uses a fluent interface pattern, allowing you to chain setter methods.
setAmount()
Sets the transaction amount.The transaction amount as a string
Fees - Returns the instance for method chaining
setCurrency()
Sets the currency for the transaction.The currency code (e.g., “NGN”, “USD”, “GHS”, “KES”)
Fees - Returns the instance for method chaining
setCard6()
Sets the first 6 digits of the card number (BIN).The first 6 digits of the card number
Fees - Returns the instance for method chaining
Getter Methods
getAmount()
Retrieves the currently set amount.String - The transaction amount
getCurrency()
Retrieves the currently set currency.String - The currency code
getCard6()
Retrieves the currently set card BIN.String - The first 6 digits of the card number
All fee calculations require your public key to be configured in
RaveConstant.PUBLIC_KEY.