Skip to content

Conversation

embashgit
Copy link
Collaborator

Token.io Android WebView SDK Demo Application

📋 Overview

This PR introduces a comprehensive Android demo application showcasing the Token.io WebView SDK
integration for secure payment processing. The application demonstrates best practices for payment
flow handling with robust WebView implementation and multi-regional support.

✨ Key Features

🌐 WebView Payment Integration

  • Secure WebView Implementation: Custom UnifiedWebViewClient for handling payment redirects
  • Dual Callback Support: Handles payment callbacks from both in-app WebView and external
    browsers
  • Payment Flow Activities:
    • PaymentWebViewActivity - Main payment interface
    • PaymentResultActivity - Payment outcome display
    • WebViewActivity - General web content handling

🇫🇷 France Market Support

  • Locale-aware Amount Formatting: Prevents locale-specific decimal separator issues (e.g.,
    French comma vs English decimal point)
  • Multi-currency Support: EUR and GBP payment processing
  • Localized Payment Experience: Proper handling of French banking redirects and callbacks

🛡️ Security & Configuration

  • API Key Management: Secure BuildConfig integration with placeholder system
  • Environment Configuration: Beta environment setup with configurable endpoints
  • Deep Link Security: Proper intent filter configuration for payment callbacks

🏗️ Technical Implementation

Core Components

  • PaymentSdk: Main SDK interface with simplified integration API
  • PaymentRepository: Network layer for payment operations using Retrofit + Moshi
  • Constants: Environment and configuration management
  • Data Models: Type-safe payment request/response handling

WebView Architecture

Unified callback handling for all payment scenarios:
UnifiedWebViewClient -> PaymentWebViewActivity -> PaymentResultActivity

External Browser Redirect -> MainActivity (Deep Link) -> PaymentResultActivity

Payment Flow

  1. Initiation: Create PaymentRequest with creditor details and amount
  2. WebView Launch: Secure payment interface with bank redirect handling
  3. Callback Processing: Unified handling regardless of redirect method
  4. Result Display: Clear payment outcome with appropriate messaging

🔧 Configuration

Manifest Setup

  • Deep link configuration for paymentdemoapp://payment-complete
  • Activity declarations with proper launch modes
  • Intent filter on MainActivity for external callback handling

Build Configuration

  • KSP for Moshi code generation
  • Firebase integration for analytics and user onboarding
  • Comprehensive dependency management

📱 User Experience

  • Intuitive Interface: Clean material design with form validation
  • Error Handling: Comprehensive error states and user feedback
  • Loading States: Progress indicators during payment processing
  • Accessibility: Proper content descriptions and navigation

🔄 Git Repository Cleanup

  • Comprehensive .gitignore: Excludes build artifacts, IDE files, and APK outputs
  • Security: API keys replaced with placeholders for safe version control
  • Clean History: Removed accidentally committed build files and IDE configurations

🌍 Market Readiness

This implementation is production-ready for:

  • UK Market: Faster Payments integration
  • French Market: SEPA payment support with proper locale handling
  • Multi-currency: GBP and EUR support with accurate formatting

🔗 Related Issues: APE-4296
📊 Testing: Manual testing completed for both WebView and browser redirect scenarios
🎯 Target: UK and EU including France market deployment with WebView payment integration

embashgit and others added 9 commits September 11, 2025 16:45
- Implemented payment flow with UK (GBP/Faster Payments) and EU (EUR/SEPA) support
- Added scrollable UI with payee name input field
- Removed default/prepopulated account details for clean user experience
- Fixed IBAN input to trim whitespace before validation
- Configured for BETA environment with proper API key integration
@embashgit embashgit requested a review from a team September 12, 2025 07:23
@embashgit embashgit merged commit 239e550 into master Sep 15, 2025
1 check passed
@embashgit embashgit deleted the APE-4296/android-test-app branch September 15, 2025 14:51
AamirMaan pushed a commit that referenced this pull request Sep 18, 2025
#  Token.io Android WebView SDK Demo Application

  ## 📋 Overview

This PR introduces a comprehensive Android demo application showcasing
the Token.io WebView SDK
integration for secure payment processing. The application demonstrates
best practices for payment
flow handling with robust WebView implementation and multi-regional
support.

  ## ✨ Key Features

  ### 🌐 WebView Payment Integration
- **Secure WebView Implementation**: Custom `UnifiedWebViewClient` for
handling payment redirects
- **Dual Callback Support**: Handles payment callbacks from both in-app
WebView and external
  browsers
  - **Payment Flow Activities**:
    - `PaymentWebViewActivity` - Main payment interface
    - `PaymentResultActivity` - Payment outcome display
    - `WebViewActivity` - General web content handling

  ### 🇫🇷 France Market Support
- **Locale-aware Amount Formatting**: Prevents locale-specific decimal
separator issues (e.g.,
  French comma vs English decimal point)
  - **Multi-currency Support**: EUR and GBP payment processing
- **Localized Payment Experience**: Proper handling of French banking
redirects and callbacks

  ### 🛡️ Security & Configuration
- **API Key Management**: Secure BuildConfig integration with
placeholder system
- **Environment Configuration**: Beta environment setup with
configurable endpoints
- **Deep Link Security**: Proper intent filter configuration for payment
callbacks

  ## 🏗️ Technical Implementation

  ### Core Components
  - **PaymentSdk**: Main SDK interface with simplified integration API
- **PaymentRepository**: Network layer for payment operations using
Retrofit + Moshi
  - **Constants**: Environment and configuration management
  - **Data Models**: Type-safe payment request/response handling

  ### WebView Architecture
  Unified callback handling for all payment scenarios:
UnifiedWebViewClient -> PaymentWebViewActivity -> PaymentResultActivity
                    ↓
External Browser Redirect -> MainActivity (Deep Link) ->
PaymentResultActivity

  ### Payment Flow
1. **Initiation**: Create PaymentRequest with creditor details and
amount
2. **WebView Launch**: Secure payment interface with bank redirect
handling
3. **Callback Processing**: Unified handling regardless of redirect
method
4. **Result Display**: Clear payment outcome with appropriate messaging

  ## 🔧 Configuration

  ### Manifest Setup
  - Deep link configuration for `paymentdemoapp://payment-complete`
  - Activity declarations with proper launch modes
  - Intent filter on MainActivity for external callback handling

  ### Build Configuration
  - KSP for Moshi code generation
  - Firebase integration for analytics and user onboarding
  - Comprehensive dependency management

  ## 📱 User Experience

  - **Intuitive Interface**: Clean material design with form validation
  - **Error Handling**: Comprehensive error states and user feedback
  - **Loading States**: Progress indicators during payment processing
  - **Accessibility**: Proper content descriptions and navigation

  ## 🔄 Git Repository Cleanup

- **Comprehensive .gitignore**: Excludes build artifacts, IDE files, and
APK outputs
- **Security**: API keys replaced with placeholders for safe version
control
- **Clean History**: Removed accidentally committed build files and IDE
configurations

  ## 🌍 Market Readiness

  This implementation is production-ready for:
  - **UK Market**: Faster Payments integration
  - **French Market**: SEPA payment support with proper locale handling
  - **Multi-currency**: GBP and EUR support with accurate formatting
  ---

  **🔗 Related Issues**: APE-4296
**📊 Testing**: Manual testing completed for both WebView and browser
redirect scenarios
**🎯 Target**: UK and EU including France market deployment with WebView
payment integration

---------

Co-authored-by: Sam French <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants