Skip to content

Commit 239e550

Browse files
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 <150862015+samfrench27@users.noreply.github.com>
1 parent d8bef2a commit 239e550

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

.gitignore

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# APK output directory
8+
APK/
9+
10+
# Files for the ART/Dalvik VM
11+
*.dex
12+
13+
# Java class files
14+
*.class
15+
16+
# Generated files
17+
bin/
18+
gen/
19+
out/
20+
# Uncomment the following line in case you need and you don't have the release build type files in your app
21+
# release/
22+
23+
# Gradle files
24+
.gradle/
25+
build/
26+
27+
# Local configuration file (sdk path, etc)
28+
local.properties
29+
30+
# Proguard folder generated by Eclipse
31+
proguard/
32+
33+
# Log Files
34+
*.log
35+
36+
# Android Studio Navigation editor temp files
37+
.navigation/
38+
39+
# Android Studio captures folder
40+
captures/
41+
42+
# IntelliJ
43+
*.iml
44+
.idea/workspace.xml
45+
.idea/tasks.xml
46+
.idea/gradle.xml
47+
.idea/assetWizardSettings.xml
48+
.idea/dictionaries
49+
.idea/libraries
50+
.idea/jarRepositories.xml
51+
# Android Studio 3 in .gitignore file.
52+
.idea/caches
53+
.idea/modules.xml
54+
# Comment next line if keeping position of elements in Navigation Editor is desired
55+
.idea/navEditor.xml
56+
.idea/misc.xml
57+
.idea/studiobot.xml
58+
59+
# Keystore files
60+
# Uncomment the following lines if you do not want to check your keystore files in.
61+
#*.jks
62+
#*.keystore
63+
64+
# External native build folder generated in Android Studio 2.2 and later
65+
.externalNativeBuild
66+
.cxx/
67+
68+
# Google Services (e.g. APIs or Firebase)
69+
# google-services.json
70+
71+
# Freeline
72+
freeline.py
73+
freeline/
74+
freeline_project_description.json
75+
76+
# fastlane
77+
fastlane/report.xml
78+
fastlane/Preview.html
79+
fastlane/screenshots
80+
fastlane/test_output
81+
fastlane/readme.md
82+
83+
# Version control
84+
vcs.xml
85+
86+
# lint
87+
lint/intermediates/
88+
lint/generated/
89+
lint/outputs/
90+
lint/tmp/
91+
# lint/reports/
92+
93+
# Android Profiling
94+
*.hprof
95+
96+
# macOS
97+
.DS_Store
98+
99+
# Sensitive information
100+
# gradle.properties - committed with placeholder values

0 commit comments

Comments
 (0)