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
TheIntegrityChecksum class generates SHA-256 checksums for payment data to ensure data integrity and prevent tampering. This is particularly useful for inline payment implementations where you need to verify that payment parameters haven’t been modified.
Class: IntegrityChecksum
Methods
integrityChecksum()
Generates an integrity checksum for the payment data.String - A Base64-encoded SHA-256 hash of the payment parameters
Description: This method creates a secure checksum by:
- Collecting all payment parameters into a HashMap
- Sorting the parameter keys alphabetically
- Concatenating all values in sorted order
- Appending the secret key
- Generating a SHA-256 hash of the concatenated string
- Encoding the hash in Base64
Parameters Required
Before calling this method, set all required payment parameters:The transaction amount
The payment method (e.g., “card”, “account”)
Custom description for the transaction
URL to custom logo for payment page
Country code (e.g., “NG”, “GH”, “KE”)
Currency code (e.g., “NGN”, “USD”, “GHS”)
Customer’s email address
Customer’s first name
Customer’s last name
Customer’s phone number
Your unique transaction reference
Example
Setter Methods
All setter methods return theIntegrityChecksum instance for method chaining.
setAmount()
Sets the transaction amount.The transaction amount
IntegrityChecksum - Returns the instance for method chaining
setPayment_method()
Sets the payment method.The payment method (e.g., “card”, “account”, “ussd”)
IntegrityChecksum - Returns the instance for method chaining
setCustom_description()
Sets a custom description for the transaction.Custom transaction description
IntegrityChecksum - Returns the instance for method chaining
setCustom_logo()
Sets a custom logo URL for the payment page.URL to the custom logo image
IntegrityChecksum - Returns the instance for method chaining
setCountry()
Sets the country code.ISO country code (e.g., “NG”, “GH”, “KE”, “ZA”)
IntegrityChecksum - Returns the instance for method chaining
setCurrency()
Sets the transaction currency.Currency code (e.g., “NGN”, “USD”, “GHS”, “KES”)
IntegrityChecksum - Returns the instance for method chaining
setCustomer_email()
Sets the customer’s email address.Customer’s email address
IntegrityChecksum - Returns the instance for method chaining
setCustomer_firstname()
Sets the customer’s first name.Customer’s first name
IntegrityChecksum - Returns the instance for method chaining
setCustomer_lastname()
Sets the customer’s last name.Customer’s last name
IntegrityChecksum - Returns the instance for method chaining
setCustomer_phone()
Sets the customer’s phone number.Customer’s phone number with country code
IntegrityChecksum - Returns the instance for method chaining
setTxref()
Sets the unique transaction reference.Your unique transaction reference
IntegrityChecksum - Returns the instance for method chaining
Getter Methods
getAmount()
String - The transaction amount
getPayment_method()
String - The payment method
getCustom_description()
String - The custom description
getCustom_logo()
String - The custom logo URL
getCountry()
String - The country code
getCurrency()
String - The currency code
getCustomer_email()
String - The customer’s email
getCustomer_firstname()
String - The customer’s first name
getCustomer_lastname()
String - The customer’s last name
getCustomer_phone()
String - The customer’s phone number
getTxref()
String - The transaction reference
How It Works
The integrity checksum algorithm:- Collects Parameters: All payment parameters including PBFPubKey are added to a HashMap
- Sorts Keys: Parameter keys are sorted alphabetically
- Concatenates Values: Values are concatenated in the sorted key order
- Appends Secret: The secret key is appended to the concatenated string
- Hashes: SHA-256 hash is generated from the final string
- Encodes: The hash is Base64-encoded for transmission
The checksum includes your public key (PBFPubKey) and uses your secret key (SECKEY) in the hashing process. Ensure both are properly configured in
RaveConstant.Use Cases
- Inline Payments: Verify payment data integrity when using Flutterwave’s inline JavaScript
- Webhook Validation: Verify that webhook data hasn’t been tampered with
- Payment Form Security: Ensure payment form data remains unchanged during submission