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
When processing payments, network issues or slow responses can cause timeouts. The Rave Java Library provides polling functionality to handle these scenarios gracefully and retrieve transaction status after a timeout occurs.Understanding Polling
Polling allows you to retry a charge request or validation when the initial request times out. Instead of failing immediately, the library can automatically poll the Flutterwave API to check if the transaction completed successfully.Polling is particularly useful in environments with unstable network connections or when processing high-value transactions where reliability is critical.
How Polling Works
The library provides polling support through thePolling class, which includes three key methods:
handleTimeoutCharge()- Retries a charge request after timeoutvalidateCardChargeTimeout()- Validates card charges with pollingvalidateAccountChargeTimeout()- Validates account charges with polling
Using Polling with Card Charges
Enable polling with boolean parameter
Pass See CardCharge.java:87-96 for implementation details.
true as a boolean parameter to enable polling on charge methods:Using Polling with Account Charges
Account charges support the same polling pattern:Using Polling with Visa and International Cards
Visa and international cards that require 3D Secure authentication also support polling:When to Use Polling
Regular vs Polling Approach
Here’s how the two approaches compare: Without Polling:Best Practices
- Use selectively - Enable polling only for critical transactions
- Monitor responses - Always check the response status even with polling
- Implement timeouts - Set reasonable timeout limits in your application
- Log polling attempts - Track how often polling is triggered to identify network issues
- Handle all outcomes - Plan for success, timeout, and failure scenarios
Response Handling
Whether using polling or not, always check the response:Next Steps
- Learn about Error Handling strategies
- Set up Testing with staging environment
- Review Card Charges documentation