- Integrate flutter_stripe SDK for payment processing - Create StripeService with payment sheet flow - Add tip selection UI (0%, 15%, 18%, 20%, 25%) - Display fee breakdown (subtotal, tax, tip, service fee, card fee) - Update cart screen with "Pay $X.XX" button - Change MainActivity to FlutterFragmentActivity for Stripe compatibility - Update Android themes to AppCompat for payment sheet styling Fee structure: - 5% Payfrit service fee (customer pays) - 2.9% + $0.30 card processing fee (customer pays) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import "package:flutter/material.dart";
|
|
import "package:flutter_stripe/flutter_stripe.dart";
|
|
import "package:provider/provider.dart";
|
|
|
|
import "app/app_router.dart" show AppRoutes;
|
|
import "app/app_state.dart" show AppState;
|
|
|
|
/// Global key for showing snackbars from anywhere in the app
|
|
final GlobalKey<ScaffoldMessengerState> rootScaffoldMessengerKey =
|
|
GlobalKey<ScaffoldMessengerState>();
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Initialize Stripe with test publishable key
|
|
// This will be updated dynamically when processing payments if needed
|
|
Stripe.publishableKey = 'pk_test_sPBNzSyJ9HcEPJGC7dSo8NqN';
|
|
|
|
runApp(const PayfritApp());
|
|
}
|
|
|
|
class PayfritApp extends StatelessWidget {
|
|
const PayfritApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
|
|
],
|
|
child: MaterialApp(
|
|
scaffoldMessengerKey: rootScaffoldMessengerKey,
|
|
debugShowCheckedModeBanner: false,
|
|
title: "Payfrit",
|
|
initialRoute: AppRoutes.splash,
|
|
routes: AppRoutes.routes,
|
|
),
|
|
);
|
|
}
|
|
}
|