Commit 42a974e
APE-4296 | Android webview test app (#2)
# 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]>1 parent 6855b69 commit 42a974e
File tree
58 files changed
+3304
-2
lines changed- app
- release
- src
- main
- java/com/example/paymentdemoandroid
- model
- network
- repository
- res
- drawable
- layout
- mipmap-anydpi-v26
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- values
- xml
- test/java/com/example/paymentdemoandroid
- gradle/wrapper
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+3304
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
0 commit comments