payments package added to hipay transactions

This commit is contained in:
2026-02-12 16:01:57 +01:00
parent d96985bf54
commit 5803286a3f
44 changed files with 4592 additions and 3 deletions

1
.idea/modules.xml generated
View File

@@ -11,6 +11,7 @@
<module fileurl="file://$PROJECT_DIR$/modules/home/melos_home.iml" filepath="$PROJECT_DIR$/modules/home/melos_home.iml" />
<module fileurl="file://$PROJECT_DIR$/packages/navigation/melos_navigation.iml" filepath="$PROJECT_DIR$/packages/navigation/melos_navigation.iml" />
<module fileurl="file://$PROJECT_DIR$/modules/notifications/melos_notifications.iml" filepath="$PROJECT_DIR$/modules/notifications/melos_notifications.iml" />
<module fileurl="file://$PROJECT_DIR$/packages/payments/melos_payments.iml" filepath="$PROJECT_DIR$/packages/payments/melos_payments.iml" />
<module fileurl="file://$PROJECT_DIR$/modules/profile/melos_profile.iml" filepath="$PROJECT_DIR$/modules/profile/melos_profile.iml" />
<module fileurl="file://$PROJECT_DIR$/packages/sca_treezor/melos_sca_treezor.iml" filepath="$PROJECT_DIR$/packages/sca_treezor/melos_sca_treezor.iml" />
<module fileurl="file://$PROJECT_DIR$/apps/mobile_app/melos_sf_app_platform.iml" filepath="$PROJECT_DIR$/apps/mobile_app/melos_sf_app_platform.iml" />

View File

@@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
import 'package:home/home.dart';
import 'package:navigation/navigation.dart';
import 'package:notifications/notifications.dart';
import 'package:payments/payments.dart';
import 'package:profile/profile.dart';
import 'package:splash/splash.dart';
@@ -65,6 +66,11 @@ void configureAppRouter() {
name: 'device_setup',
pageBuilder: DeviceSetupBuilder().buildPage,
),
GoRoute(
path: AppRoutes.hipayWebView,
name: 'hipay_webview',
pageBuilder: const HiPayWebViewBuilder().buildPage,
),
StatefulShellRoute.indexedStack(
builder: (context, state, navShell) {
return DashboardBuilder().build(context, navShell);

View File

@@ -789,6 +789,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
payments:
dependency: "direct main"
description:
path: "../../packages/payments"
relative: true
source: path
version: "0.0.1"
permission_handler:
dependency: "direct main"
description:
@@ -1291,6 +1298,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.1"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
sha256: a3da219916aba44947d3a5478b1927876a09781174b5a2b67fa5be0555154bf9
url: "https://pub.dev"
source: hosted
version: "4.13.1"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: eeeb3fcd5f0ff9f8446c9f4bbc18a99b809e40297528a3395597d03aafb9f510
url: "https://pub.dev"
source: hosted
version: "4.10.11"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: "63d26ee3aca7256a83ccb576a50272edd7cfc80573a4305caa98985feb493ee0"
url: "https://pub.dev"
source: hosted
version: "2.14.0"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: "0412b657a2828fb301e73509909e6ec02b77cd2b441ae9f77125d482b3ddf0e7"
url: "https://pub.dev"
source: hosted
version: "3.23.6"
xdg_directories:
dependency: transitive
description:

View File

@@ -66,6 +66,8 @@ dependencies:
path: ../../packages/flutter_treezor_entrust_sdk_bridge
sca_treezor:
path: ../../packages/sca_treezor
payments:
path: ../../packages/payments
#dependencies go here
cupertino_icons: ^1.0.8
flutter_svg: ^2.2.1

View File

@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared,utils,sf_localizations,fonts,sf_infrastructure,flutter_treezor_entrust_sdk_bridge,splash,sca_treezor
# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared,utils,sf_localizations,fonts,sf_infrastructure,flutter_treezor_entrust_sdk_bridge,splash,sca_treezor,payments
dependency_overrides:
auth:
path: ../../modules/auth
@@ -16,6 +16,8 @@ dependency_overrides:
path: ../../packages/navigation
notifications:
path: ../../modules/notifications
payments:
path: ../../packages/payments
profile:
path: ../../modules/profile
sca_treezor:

View File

@@ -41,9 +41,9 @@ class _SplashScreenState extends State<SplashScreen> {
case InitialRoute.login:
widget.navigationContract.goTo(AppRoutes.login);
case InitialRoute.deviceSetup:
widget.navigationContract.goTo(AppRoutes.deviceSetup);
widget.navigationContract.goTo(AppRoutes.login);
case InitialRoute.home:
widget.navigationContract.goTo(AppRoutes.dashboardHome);
widget.navigationContract.goTo(AppRoutes.login);
}
}

View File

@@ -16,4 +16,6 @@ class AppRoutes {
static const dashboardNotifications = '$dashboard/notifications';
static const dashboardProfile = '$dashboard/profile';
static const dashboardProfileSettings = '$dashboardProfile/settings';
static const hipayWebView = '/hipay_webview';
}

View File

@@ -0,0 +1,2 @@
file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_daemon-4.1.1/lib/fake.dart
file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_runner-2.7.1/lib/fake.dart

View File

@@ -0,0 +1,69 @@
// @dart=3.6
// ignore_for_file: directives_ordering
// build_runner >=2.4.16
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:build_runner_core/build_runner_core.dart' as _i1;
import 'package:riverpod_generator/builder.dart' as _i2;
import 'package:freezed/builder.dart' as _i3;
import 'package:json_serializable/builder.dart' as _i4;
import 'package:source_gen/builder.dart' as _i5;
import 'package:mockito/src/builder.dart' as _i6;
import 'package:build_config/build_config.dart' as _i7;
import 'dart:isolate' as _i8;
import 'package:build_runner/src/build_script_generate/build_process_state.dart'
as _i9;
import 'package:build_runner/build_runner.dart' as _i10;
import 'dart:io' as _i11;
final _builders = <_i1.BuilderApplication>[
_i1.apply(
r'riverpod_generator:riverpod_generator',
[_i2.riverpodBuilder],
_i1.toDependentsOf(r'riverpod_generator'),
hideOutput: true,
appliesBuilders: const [r'source_gen:combining_builder'],
),
_i1.apply(
r'freezed:freezed',
[_i3.freezed],
_i1.toDependentsOf(r'freezed'),
hideOutput: false,
),
_i1.apply(
r'json_serializable:json_serializable',
[_i4.jsonSerializable],
_i1.toDependentsOf(r'json_serializable'),
hideOutput: true,
appliesBuilders: const [r'source_gen:combining_builder'],
),
_i1.apply(
r'source_gen:combining_builder',
[_i5.combiningBuilder],
_i1.toNoneByDefault(),
hideOutput: false,
appliesBuilders: const [r'source_gen:part_cleanup'],
),
_i1.apply(
r'mockito:mockBuilder',
[_i6.buildMocks],
_i1.toDependentsOf(r'mockito'),
hideOutput: false,
defaultGenerateFor: const _i7.InputSet(include: [r'test/**']),
),
_i1.applyPostProcess(
r'source_gen:part_cleanup',
_i5.partCleanup,
),
];
void main(
List<String> args, [
_i8.SendPort? sendPort,
]) async {
await _i9.buildProcessState.receive(sendPort);
_i9.buildProcessState.isolateExitCode = await _i10.run(
args,
_builders,
);
_i11.exitCode = _i9.buildProcessState.isolateExitCode!;
await _i9.buildProcessState.send(sendPort);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_TopupCardsResponseModel _$TopupCardsResponseModelFromJson(
Map<String, dynamic> json,
) => _TopupCardsResponseModel(
forwardUrl: json['forwardUrl'] as String,
orderId: json['orderId'] as String,
);
Map<String, dynamic> _$TopupCardsResponseModelToJson(
_TopupCardsResponseModel instance,
) => <String, dynamic>{
'forwardUrl': instance.forwardUrl,
'orderId': instance.orderId,
};

Binary file not shown.

View File

@@ -0,0 +1 @@
{"sdk":"3.9.2 (stable) (Wed Aug 27 03:49:40 2025 -0700) on \"macos_arm64\"","analyzer":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/analyzer-7.6.0","build_resolvers":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_resolvers-3.0.3"}

View File

@@ -0,0 +1,802 @@
{
"configVersion": 2,
"packages": [
{
"name": "_fe_analyzer_shared",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-85.0.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "analyzer",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/analyzer-7.6.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "analyzer_buffer",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/analyzer_buffer-0.1.10",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "analyzer_plugin",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/analyzer_plugin-0.13.4",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "args",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/args-2.7.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "async",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/async-2.13.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "boolean_selector",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "build",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build-3.1.0",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "build_config",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_config-1.2.0",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "build_daemon",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_daemon-4.1.1",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "build_resolvers",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_resolvers-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "build_runner",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_runner-2.7.1",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "build_runner_core",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/build_runner_core-9.3.1",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "built_collection",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/built_collection-5.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "built_value",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/built_value-8.12.3",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "characters",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/characters-1.4.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "checked_yaml",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/checked_yaml-2.0.4",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "ci",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/ci-0.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "cli_config",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/cli_config-0.2.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "cli_util",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/cli_util-0.4.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "clock",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/clock-1.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "code_builder",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/code_builder-4.11.1",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "collection",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/collection-1.19.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "convert",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/convert-3.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "cookie_jar",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/cookie_jar-4.0.8",
"packageUri": "lib/",
"languageVersion": "2.15"
},
{
"name": "country_code_picker",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/country_code_picker-3.4.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "coverage",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/coverage-1.15.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "crypto",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/crypto-3.0.7",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "custom_lint",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/custom_lint-0.8.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "custom_lint_builder",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/custom_lint_builder-0.8.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "custom_lint_core",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/custom_lint_core-0.8.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "custom_lint_visitor",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/custom_lint_visitor-1.0.0+7.7.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "dart_style",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/dart_style-3.1.1",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "design_system",
"rootUri": "../../design_system",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "diacritic",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/diacritic-0.1.6",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "dio",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/dio-5.9.1",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "dio_cookie_manager",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/dio_cookie_manager-3.3.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "dio_web_adapter",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/dio_web_adapter-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "fake_async",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/fake_async-1.3.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "ffi",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/ffi-2.2.0",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "file",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/file-7.0.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "fixnum",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/fixnum-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "flutter",
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "flutter_lints",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_lints-5.0.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "flutter_riverpod",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_riverpod-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "flutter_test",
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "flutter_web_plugins",
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter_web_plugins",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "fonts",
"rootUri": "../../fonts",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "freezed",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/freezed-3.2.3",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "freezed_annotation",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/freezed_annotation-3.1.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "frontend_server_client",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/frontend_server_client-4.0.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "get_it",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/get_it-9.2.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "glob",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/glob-2.1.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "go_router",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/go_router-17.1.0",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "graphs",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/graphs-2.3.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "hotreloader",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/hotreloader-4.3.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "http_multi_server",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "http_parser",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/http_parser-4.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "io",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/io-1.0.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "js",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/js-0.7.2",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "json_annotation",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/json_annotation-4.9.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "json_serializable",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/json_serializable-6.11.2",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "leak_tracker",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "leak_tracker_flutter_testing",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "leak_tracker_testing",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "lints",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/lints-5.1.1",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "logging",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/logging-1.3.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "matcher",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/matcher-0.12.17",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "material_color_utilities",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "meta",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/meta-1.16.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "mime",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/mime-2.0.0",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "mockito",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/mockito-5.5.0",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "navigation",
"rootUri": "../../navigation",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "node_preamble",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/node_preamble-2.0.2",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "package_config",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/package_config-2.2.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "path",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path-1.9.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "path_provider",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider-2.1.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "path_provider_android",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "path_provider_foundation",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "path_provider_linux",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1",
"packageUri": "lib/",
"languageVersion": "2.19"
},
{
"name": "path_provider_platform_interface",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_platform_interface-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "path_provider_windows",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "platform",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/platform-3.1.6",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "plugin_platform_interface",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "pool",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pool-1.5.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "pub_semver",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pub_semver-2.2.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "pubspec_parse",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "riverpod",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/riverpod-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "riverpod_analyzer_utils",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/riverpod_analyzer_utils-1.0.0-dev.7",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "riverpod_annotation",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/riverpod_annotation-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "riverpod_generator",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/riverpod_generator-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "riverpod_lint",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/riverpod_lint-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "rxdart",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/rxdart-0.28.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "sf_infrastructure",
"rootUri": "../../sf_infrastructure",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "shelf",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/shelf-1.4.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "shelf_packages_handler",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.2",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "shelf_static",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/shelf_static-1.1.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "shelf_web_socket",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/shelf_web_socket-3.0.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "source_gen",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_gen-3.1.0",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "source_helper",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_helper-1.3.8",
"packageUri": "lib/",
"languageVersion": "3.7"
},
{
"name": "source_map_stack_trace",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_maps",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_maps-0.10.13",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_span",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_span-1.10.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "stack_trace",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "state_notifier",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/state_notifier-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "stream_channel",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "stream_transform",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/stream_transform-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "string_scanner",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "term_glyph",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "test",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/test-1.26.2",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "test_api",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/test_api-0.7.6",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "test_core",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/test_core-0.6.11",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "timing",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/timing-1.0.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "typed_data",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/typed_data-1.4.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "universal_io",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/universal_io-2.3.1",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "utils",
"rootUri": "../../utils",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "uuid",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/uuid-4.5.2",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "vector_math",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/vector_math-2.2.0",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "vm_service",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/vm_service-15.0.2",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "watcher",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/watcher-1.2.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "web",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/web-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "web_socket",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/web_socket-1.0.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "web_socket_channel",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/web_socket_channel-3.0.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "webkit_inspection_protocol",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "webview_flutter",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter-4.13.1",
"packageUri": "lib/",
"languageVersion": "3.8"
},
{
"name": "webview_flutter_android",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_android-4.10.11",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "webview_flutter_platform_interface",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_platform_interface-2.14.0",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "webview_flutter_wkwebview",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.23.6",
"packageUri": "lib/",
"languageVersion": "3.9"
},
{
"name": "xdg_directories",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/xdg_directories-1.1.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "yaml",
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/yaml-3.1.3",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "payments",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "3.9"
}
],
"generator": "pub",
"generatorVersion": "3.9.2",
"flutterRoot": "file:///Users/juliandalcalaf/Development/flutter",
"flutterVersion": "3.35.7",
"pubCache": "file:///Users/juliandalcalaf/.pub-cache"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
3.35.7

View File

@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"webview_flutter_wkwebview","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.23.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"webview_flutter_android","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_android-4.10.11/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"path_provider_foundation","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"webview_flutter_wkwebview","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-3.23.6/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2026-02-12 15:07:32.166699","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}}

View File

@@ -0,0 +1,2 @@
export 'src/features/topup_cards/presentation/hipay_webview_builder.dart';
export 'src/core/domain/entities/hipay_result.dart';

View File

@@ -0,0 +1,5 @@
import 'package:payments/src/core/data/models/topup_cards_response_model.dart';
abstract class HiPayRemoteDatasource {
Future<TopupCardsResponseModel> topupCards();
}

View File

@@ -0,0 +1,30 @@
import 'package:dio/dio.dart';
import 'package:payments/src/core/data/models/topup_cards_response_model.dart';
import 'package:sf_infrastructure/sf_infrastructure.dart';
import 'hipay_remote_datasource.dart';
class HiPayRemoteDatasourceImpl implements HiPayRemoteDatasource {
HiPayRemoteDatasourceImpl(this._repository);
final QuestiaRepository _repository;
@override
Future<TopupCardsResponseModel> topupCards() async {
try {
final response = await _repository.post<Map<String, dynamic>>(
'/payments/topup-cards',
);
final data = response.data;
if (data == null || data.isEmpty) {
throw Exception('Empty response from /payments/topup-cards');
}
return TopupCardsResponseModel.fromJson(data);
} on DioException catch (error) {
final msg = error.message ?? 'Error in topupCards';
throw Exception(msg);
}
}
}

View File

@@ -0,0 +1,22 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:payments/src/core/domain/entities/topup_cards_entity.dart';
part 'topup_cards_response_model.freezed.dart';
part 'topup_cards_response_model.g.dart';
@freezed
abstract class TopupCardsResponseModel with _$TopupCardsResponseModel {
const factory TopupCardsResponseModel({
required String forwardUrl,
required String orderId,
}) = _TopupCardsResponseModel;
factory TopupCardsResponseModel.fromJson(Map<String, dynamic> json) =>
_$TopupCardsResponseModelFromJson(json);
}
extension TopupCardsResponseModelMapper on TopupCardsResponseModel {
TopupCardsEntity toEntity() {
return TopupCardsEntity(forwardUrl: forwardUrl, orderId: orderId);
}
}

View File

@@ -0,0 +1,280 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'topup_cards_response_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$TopupCardsResponseModel {
String get forwardUrl; String get orderId;
/// Create a copy of TopupCardsResponseModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$TopupCardsResponseModelCopyWith<TopupCardsResponseModel> get copyWith => _$TopupCardsResponseModelCopyWithImpl<TopupCardsResponseModel>(this as TopupCardsResponseModel, _$identity);
/// Serializes this TopupCardsResponseModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is TopupCardsResponseModel&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,forwardUrl,orderId);
@override
String toString() {
return 'TopupCardsResponseModel(forwardUrl: $forwardUrl, orderId: $orderId)';
}
}
/// @nodoc
abstract mixin class $TopupCardsResponseModelCopyWith<$Res> {
factory $TopupCardsResponseModelCopyWith(TopupCardsResponseModel value, $Res Function(TopupCardsResponseModel) _then) = _$TopupCardsResponseModelCopyWithImpl;
@useResult
$Res call({
String forwardUrl, String orderId
});
}
/// @nodoc
class _$TopupCardsResponseModelCopyWithImpl<$Res>
implements $TopupCardsResponseModelCopyWith<$Res> {
_$TopupCardsResponseModelCopyWithImpl(this._self, this._then);
final TopupCardsResponseModel _self;
final $Res Function(TopupCardsResponseModel) _then;
/// Create a copy of TopupCardsResponseModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? forwardUrl = null,Object? orderId = null,}) {
return _then(_self.copyWith(
forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [TopupCardsResponseModel].
extension TopupCardsResponseModelPatterns on TopupCardsResponseModel {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _TopupCardsResponseModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _TopupCardsResponseModel() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _TopupCardsResponseModel value) $default,){
final _that = this;
switch (_that) {
case _TopupCardsResponseModel():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _TopupCardsResponseModel value)? $default,){
final _that = this;
switch (_that) {
case _TopupCardsResponseModel() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String forwardUrl, String orderId)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _TopupCardsResponseModel() when $default != null:
return $default(_that.forwardUrl,_that.orderId);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String forwardUrl, String orderId) $default,) {final _that = this;
switch (_that) {
case _TopupCardsResponseModel():
return $default(_that.forwardUrl,_that.orderId);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String forwardUrl, String orderId)? $default,) {final _that = this;
switch (_that) {
case _TopupCardsResponseModel() when $default != null:
return $default(_that.forwardUrl,_that.orderId);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _TopupCardsResponseModel implements TopupCardsResponseModel {
const _TopupCardsResponseModel({required this.forwardUrl, required this.orderId});
factory _TopupCardsResponseModel.fromJson(Map<String, dynamic> json) => _$TopupCardsResponseModelFromJson(json);
@override final String forwardUrl;
@override final String orderId;
/// Create a copy of TopupCardsResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$TopupCardsResponseModelCopyWith<_TopupCardsResponseModel> get copyWith => __$TopupCardsResponseModelCopyWithImpl<_TopupCardsResponseModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$TopupCardsResponseModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TopupCardsResponseModel&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,forwardUrl,orderId);
@override
String toString() {
return 'TopupCardsResponseModel(forwardUrl: $forwardUrl, orderId: $orderId)';
}
}
/// @nodoc
abstract mixin class _$TopupCardsResponseModelCopyWith<$Res> implements $TopupCardsResponseModelCopyWith<$Res> {
factory _$TopupCardsResponseModelCopyWith(_TopupCardsResponseModel value, $Res Function(_TopupCardsResponseModel) _then) = __$TopupCardsResponseModelCopyWithImpl;
@override @useResult
$Res call({
String forwardUrl, String orderId
});
}
/// @nodoc
class __$TopupCardsResponseModelCopyWithImpl<$Res>
implements _$TopupCardsResponseModelCopyWith<$Res> {
__$TopupCardsResponseModelCopyWithImpl(this._self, this._then);
final _TopupCardsResponseModel _self;
final $Res Function(_TopupCardsResponseModel) _then;
/// Create a copy of TopupCardsResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? forwardUrl = null,Object? orderId = null,}) {
return _then(_TopupCardsResponseModel(
forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on

View File

@@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'topup_cards_response_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_TopupCardsResponseModel _$TopupCardsResponseModelFromJson(
Map<String, dynamic> json,
) => _TopupCardsResponseModel(
forwardUrl: json['forwardUrl'] as String,
orderId: json['orderId'] as String,
);
Map<String, dynamic> _$TopupCardsResponseModelToJson(
_TopupCardsResponseModel instance,
) => <String, dynamic>{
'forwardUrl': instance.forwardUrl,
'orderId': instance.orderId,
};

View File

@@ -0,0 +1,16 @@
import 'package:payments/src/core/data/datasource/hipay_remote_datasource.dart';
import 'package:payments/src/core/data/models/topup_cards_response_model.dart';
import 'package:payments/src/core/domain/entities/topup_cards_entity.dart';
import 'package:payments/src/core/domain/repositories/hipay_repository.dart';
class HiPayRepositoryImpl implements HiPayRepository {
const HiPayRepositoryImpl(this._remote);
final HiPayRemoteDatasource _remote;
@override
Future<TopupCardsEntity> topupCards() async {
final model = await _remote.topupCards();
return model.toEntity();
}
}

View File

@@ -0,0 +1 @@
enum HiPayResult { success, cancelled }

View File

@@ -0,0 +1,11 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'topup_cards_entity.freezed.dart';
@freezed
abstract class TopupCardsEntity with _$TopupCardsEntity {
const factory TopupCardsEntity({
required String forwardUrl,
required String orderId,
}) = _TopupCardsEntity;
}

View File

@@ -0,0 +1,274 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'topup_cards_entity.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$TopupCardsEntity {
String get forwardUrl; String get orderId;
/// Create a copy of TopupCardsEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$TopupCardsEntityCopyWith<TopupCardsEntity> get copyWith => _$TopupCardsEntityCopyWithImpl<TopupCardsEntity>(this as TopupCardsEntity, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is TopupCardsEntity&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId));
}
@override
int get hashCode => Object.hash(runtimeType,forwardUrl,orderId);
@override
String toString() {
return 'TopupCardsEntity(forwardUrl: $forwardUrl, orderId: $orderId)';
}
}
/// @nodoc
abstract mixin class $TopupCardsEntityCopyWith<$Res> {
factory $TopupCardsEntityCopyWith(TopupCardsEntity value, $Res Function(TopupCardsEntity) _then) = _$TopupCardsEntityCopyWithImpl;
@useResult
$Res call({
String forwardUrl, String orderId
});
}
/// @nodoc
class _$TopupCardsEntityCopyWithImpl<$Res>
implements $TopupCardsEntityCopyWith<$Res> {
_$TopupCardsEntityCopyWithImpl(this._self, this._then);
final TopupCardsEntity _self;
final $Res Function(TopupCardsEntity) _then;
/// Create a copy of TopupCardsEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? forwardUrl = null,Object? orderId = null,}) {
return _then(_self.copyWith(
forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [TopupCardsEntity].
extension TopupCardsEntityPatterns on TopupCardsEntity {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _TopupCardsEntity value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _TopupCardsEntity() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _TopupCardsEntity value) $default,){
final _that = this;
switch (_that) {
case _TopupCardsEntity():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _TopupCardsEntity value)? $default,){
final _that = this;
switch (_that) {
case _TopupCardsEntity() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String forwardUrl, String orderId)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _TopupCardsEntity() when $default != null:
return $default(_that.forwardUrl,_that.orderId);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String forwardUrl, String orderId) $default,) {final _that = this;
switch (_that) {
case _TopupCardsEntity():
return $default(_that.forwardUrl,_that.orderId);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String forwardUrl, String orderId)? $default,) {final _that = this;
switch (_that) {
case _TopupCardsEntity() when $default != null:
return $default(_that.forwardUrl,_that.orderId);case _:
return null;
}
}
}
/// @nodoc
class _TopupCardsEntity implements TopupCardsEntity {
const _TopupCardsEntity({required this.forwardUrl, required this.orderId});
@override final String forwardUrl;
@override final String orderId;
/// Create a copy of TopupCardsEntity
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$TopupCardsEntityCopyWith<_TopupCardsEntity> get copyWith => __$TopupCardsEntityCopyWithImpl<_TopupCardsEntity>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TopupCardsEntity&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId));
}
@override
int get hashCode => Object.hash(runtimeType,forwardUrl,orderId);
@override
String toString() {
return 'TopupCardsEntity(forwardUrl: $forwardUrl, orderId: $orderId)';
}
}
/// @nodoc
abstract mixin class _$TopupCardsEntityCopyWith<$Res> implements $TopupCardsEntityCopyWith<$Res> {
factory _$TopupCardsEntityCopyWith(_TopupCardsEntity value, $Res Function(_TopupCardsEntity) _then) = __$TopupCardsEntityCopyWithImpl;
@override @useResult
$Res call({
String forwardUrl, String orderId
});
}
/// @nodoc
class __$TopupCardsEntityCopyWithImpl<$Res>
implements _$TopupCardsEntityCopyWith<$Res> {
__$TopupCardsEntityCopyWithImpl(this._self, this._then);
final _TopupCardsEntity _self;
final $Res Function(_TopupCardsEntity) _then;
/// Create a copy of TopupCardsEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? forwardUrl = null,Object? orderId = null,}) {
return _then(_TopupCardsEntity(
forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on

View File

@@ -0,0 +1,5 @@
import 'package:payments/src/core/domain/entities/topup_cards_entity.dart';
abstract class HiPayRepository {
Future<TopupCardsEntity> topupCards();
}

View File

@@ -0,0 +1,9 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:payments/src/core/data/datasource/hipay_remote_datasource.dart';
import 'package:payments/src/core/data/datasource/hipay_remote_datasource_impl.dart';
import 'package:sf_infrastructure/sf_infrastructure.dart';
final hipayRemoteDatasourceProvider = Provider<HiPayRemoteDatasource>((ref) {
final questiaRepository = getIt<QuestiaRepository>();
return HiPayRemoteDatasourceImpl(questiaRepository);
});

View File

@@ -0,0 +1,9 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:payments/src/core/data/repositories/hipay_repository_impl.dart';
import 'package:payments/src/core/domain/repositories/hipay_repository.dart';
import 'package:payments/src/core/providers/hipay_remote_datasource_provider.dart';
final hipayRepositoryProvider = Provider<HiPayRepository>((ref) {
final remote = ref.read(hipayRemoteDatasourceProvider);
return HiPayRepositoryImpl(remote);
});

View File

@@ -0,0 +1,5 @@
import 'package:payments/src/core/domain/entities/topup_cards_entity.dart';
abstract class TopupCardsUseCase {
Future<TopupCardsEntity> topupCards();
}

View File

@@ -0,0 +1,14 @@
import 'package:payments/src/core/domain/entities/topup_cards_entity.dart';
import 'package:payments/src/core/domain/repositories/hipay_repository.dart';
import 'package:payments/src/features/topup_cards/domain/use_cases/topup_cards_use_case.dart';
class TopupCardsUseCaseImpl implements TopupCardsUseCase {
TopupCardsUseCaseImpl(this._repository);
final HiPayRepository _repository;
@override
Future<TopupCardsEntity> topupCards() {
return _repository.topupCards();
}
}

View File

@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:go_router/go_router.dart';
import 'package:navigation/navigation.dart';
import 'package:payments/src/features/topup_cards/presentation/hipay_webview_screen.dart';
class HiPayWebViewBuilder {
const HiPayWebViewBuilder();
Page<void> buildPage(BuildContext context, GoRouterState state) {
final NavigationContract navigationContract = GetIt.I<NavigationContract>();
return MaterialPage<void>(
key: state.pageKey,
child: HiPayWebViewScreen(navigationContract: navigationContract),
);
}
}

View File

@@ -0,0 +1,112 @@
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:navigation/navigation.dart';
import 'package:payments/src/core/domain/entities/hipay_result.dart';
import 'package:payments/src/features/topup_cards/presentation/hipay_webview_view_model.dart';
import 'package:webview_flutter/webview_flutter.dart';
class HiPayWebViewScreen extends ConsumerStatefulWidget {
final NavigationContract navigationContract;
const HiPayWebViewScreen({super.key, required this.navigationContract});
@override
ConsumerState<HiPayWebViewScreen> createState() => _HiPayWebViewScreenState();
}
class _HiPayWebViewScreenState extends ConsumerState<HiPayWebViewScreen> {
WebViewController? _webViewController;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
ref.read(hipayWebViewViewModelProvider.notifier).loadTopupCards();
});
}
void _initWebView(String url, String orderId) {
_webViewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(
onNavigationRequest: (request) {
if (request.url.contains('/payments/topup-cards/webhook') &&
request.url.contains('orderid=$orderId')) {
Navigator.of(context).pop(HiPayResult.success);
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
)
..loadRequest(Uri.parse(url));
}
@override
Widget build(BuildContext context) {
final theme = ref.watch(themePortProvider);
final state = ref.watch(hipayWebViewViewModelProvider);
if (state.isWebViewReady &&
state.forwardUrl.isNotEmpty &&
_webViewController == null) {
_initWebView(state.forwardUrl, state.orderId);
}
return Scaffold(
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
appBar: AppBar(
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
leading: IconButton(
icon: const Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(HiPayResult.cancelled),
),
),
body: _buildBody(state, theme),
);
}
Widget _buildBody(dynamic state, ThemePort theme) {
if (state.isLoading) {
return const Center(child: CircularProgressIndicator());
}
if (state.errorMessage.isNotEmpty) {
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
state.errorMessage,
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).colorScheme.error,
fontSize: 14,
),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
ref
.read(hipayWebViewViewModelProvider.notifier)
.loadTopupCards();
},
child: const Text('Retry'),
),
],
),
),
);
}
if (_webViewController != null) {
return WebViewWidget(controller: _webViewController!);
}
return const SizedBox.shrink();
}
}

View File

@@ -0,0 +1,44 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:payments/src/features/topup_cards/domain/use_cases/topup_cards_use_case.dart';
import 'package:payments/src/features/topup_cards/presentation/hipay_webview_view_state.dart';
import 'package:payments/src/features/topup_cards/providers/topup_cards_use_case_provider.dart';
final hipayWebViewViewModelProvider =
NotifierProvider.autoDispose<HiPayWebViewViewModel, HiPayWebViewViewState>(
HiPayWebViewViewModel.new,
);
class HiPayWebViewViewModel extends Notifier<HiPayWebViewViewState> {
late final TopupCardsUseCase _topupCardsUseCase;
@override
HiPayWebViewViewState build() {
_topupCardsUseCase = ref.read(topupCardsUseCaseProvider);
return const HiPayWebViewViewState();
}
Future<void> loadTopupCards() async {
state = state.copyWith(isLoading: true, errorMessage: '');
try {
final result = await _topupCardsUseCase.topupCards();
if (!ref.mounted) return;
state = state.copyWith(
isLoading: false,
forwardUrl: result.forwardUrl,
orderId: result.orderId,
isWebViewReady: true,
);
} catch (e) {
if (!ref.mounted) return;
state = state.copyWith(isLoading: false, errorMessage: e.toString());
}
}
void setWebViewReady(bool ready) {
state = state.copyWith(isWebViewReady: ready);
}
}

View File

@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'hipay_webview_view_state.freezed.dart';
@freezed
abstract class HiPayWebViewViewState with _$HiPayWebViewViewState {
const factory HiPayWebViewViewState({
@Default(false) bool isLoading,
@Default('') String forwardUrl,
@Default('') String orderId,
@Default('') String errorMessage,
@Default(false) bool isWebViewReady,
}) = _HiPayWebViewViewState;
}

View File

@@ -0,0 +1,283 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'hipay_webview_view_state.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$HiPayWebViewViewState {
bool get isLoading; String get forwardUrl; String get orderId; String get errorMessage; bool get isWebViewReady;
/// Create a copy of HiPayWebViewViewState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$HiPayWebViewViewStateCopyWith<HiPayWebViewViewState> get copyWith => _$HiPayWebViewViewStateCopyWithImpl<HiPayWebViewViewState>(this as HiPayWebViewViewState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is HiPayWebViewViewState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.isWebViewReady, isWebViewReady) || other.isWebViewReady == isWebViewReady));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,forwardUrl,orderId,errorMessage,isWebViewReady);
@override
String toString() {
return 'HiPayWebViewViewState(isLoading: $isLoading, forwardUrl: $forwardUrl, orderId: $orderId, errorMessage: $errorMessage, isWebViewReady: $isWebViewReady)';
}
}
/// @nodoc
abstract mixin class $HiPayWebViewViewStateCopyWith<$Res> {
factory $HiPayWebViewViewStateCopyWith(HiPayWebViewViewState value, $Res Function(HiPayWebViewViewState) _then) = _$HiPayWebViewViewStateCopyWithImpl;
@useResult
$Res call({
bool isLoading, String forwardUrl, String orderId, String errorMessage, bool isWebViewReady
});
}
/// @nodoc
class _$HiPayWebViewViewStateCopyWithImpl<$Res>
implements $HiPayWebViewViewStateCopyWith<$Res> {
_$HiPayWebViewViewStateCopyWithImpl(this._self, this._then);
final HiPayWebViewViewState _self;
final $Res Function(HiPayWebViewViewState) _then;
/// Create a copy of HiPayWebViewViewState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? forwardUrl = null,Object? orderId = null,Object? errorMessage = null,Object? isWebViewReady = null,}) {
return _then(_self.copyWith(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String,isWebViewReady: null == isWebViewReady ? _self.isWebViewReady : isWebViewReady // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// Adds pattern-matching-related methods to [HiPayWebViewViewState].
extension HiPayWebViewViewStatePatterns on HiPayWebViewViewState {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _HiPayWebViewViewState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _HiPayWebViewViewState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _HiPayWebViewViewState value) $default,){
final _that = this;
switch (_that) {
case _HiPayWebViewViewState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _HiPayWebViewViewState value)? $default,){
final _that = this;
switch (_that) {
case _HiPayWebViewViewState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, String forwardUrl, String orderId, String errorMessage, bool isWebViewReady)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _HiPayWebViewViewState() when $default != null:
return $default(_that.isLoading,_that.forwardUrl,_that.orderId,_that.errorMessage,_that.isWebViewReady);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, String forwardUrl, String orderId, String errorMessage, bool isWebViewReady) $default,) {final _that = this;
switch (_that) {
case _HiPayWebViewViewState():
return $default(_that.isLoading,_that.forwardUrl,_that.orderId,_that.errorMessage,_that.isWebViewReady);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, String forwardUrl, String orderId, String errorMessage, bool isWebViewReady)? $default,) {final _that = this;
switch (_that) {
case _HiPayWebViewViewState() when $default != null:
return $default(_that.isLoading,_that.forwardUrl,_that.orderId,_that.errorMessage,_that.isWebViewReady);case _:
return null;
}
}
}
/// @nodoc
class _HiPayWebViewViewState implements HiPayWebViewViewState {
const _HiPayWebViewViewState({this.isLoading = false, this.forwardUrl = '', this.orderId = '', this.errorMessage = '', this.isWebViewReady = false});
@override@JsonKey() final bool isLoading;
@override@JsonKey() final String forwardUrl;
@override@JsonKey() final String orderId;
@override@JsonKey() final String errorMessage;
@override@JsonKey() final bool isWebViewReady;
/// Create a copy of HiPayWebViewViewState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$HiPayWebViewViewStateCopyWith<_HiPayWebViewViewState> get copyWith => __$HiPayWebViewViewStateCopyWithImpl<_HiPayWebViewViewState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HiPayWebViewViewState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.forwardUrl, forwardUrl) || other.forwardUrl == forwardUrl)&&(identical(other.orderId, orderId) || other.orderId == orderId)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.isWebViewReady, isWebViewReady) || other.isWebViewReady == isWebViewReady));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,forwardUrl,orderId,errorMessage,isWebViewReady);
@override
String toString() {
return 'HiPayWebViewViewState(isLoading: $isLoading, forwardUrl: $forwardUrl, orderId: $orderId, errorMessage: $errorMessage, isWebViewReady: $isWebViewReady)';
}
}
/// @nodoc
abstract mixin class _$HiPayWebViewViewStateCopyWith<$Res> implements $HiPayWebViewViewStateCopyWith<$Res> {
factory _$HiPayWebViewViewStateCopyWith(_HiPayWebViewViewState value, $Res Function(_HiPayWebViewViewState) _then) = __$HiPayWebViewViewStateCopyWithImpl;
@override @useResult
$Res call({
bool isLoading, String forwardUrl, String orderId, String errorMessage, bool isWebViewReady
});
}
/// @nodoc
class __$HiPayWebViewViewStateCopyWithImpl<$Res>
implements _$HiPayWebViewViewStateCopyWith<$Res> {
__$HiPayWebViewViewStateCopyWithImpl(this._self, this._then);
final _HiPayWebViewViewState _self;
final $Res Function(_HiPayWebViewViewState) _then;
/// Create a copy of HiPayWebViewViewState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? forwardUrl = null,Object? orderId = null,Object? errorMessage = null,Object? isWebViewReady = null,}) {
return _then(_HiPayWebViewViewState(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,forwardUrl: null == forwardUrl ? _self.forwardUrl : forwardUrl // ignore: cast_nullable_to_non_nullable
as String,orderId: null == orderId ? _self.orderId : orderId // ignore: cast_nullable_to_non_nullable
as String,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
as String,isWebViewReady: null == isWebViewReady ? _self.isWebViewReady : isWebViewReady // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
// dart format on

View File

@@ -0,0 +1,9 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:payments/src/core/providers/hipay_repository_provider.dart';
import 'package:payments/src/features/topup_cards/domain/use_cases/topup_cards_use_case.dart';
import 'package:payments/src/features/topup_cards/domain/use_cases/topup_cards_use_case_impl.dart';
final topupCardsUseCaseProvider = Provider.autoDispose<TopupCardsUseCase>((ref) {
final repository = ref.read(hipayRepositoryProvider);
return TopupCardsUseCaseImpl(repository);
});

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/.idea" />
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.idea" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Pods" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks" />
<excludeFolder url="file://$MODULE_DIR$/example/macos/Flutter" />
<excludeFolder url="file://$MODULE_DIR$/example/macos/Pods" />
<excludeFolder url="file://$MODULE_DIR$/example/macos/.symlinks" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
name: payments
description: "HiPay payments integration package."
publish_to: 'none'
version: 0.0.1
homepage:
environment:
sdk: ^3.9.2
flutter: ">=1.17.0"
dependencies:
flutter:
sdk: flutter
#packages dependencies go here
design_system:
path: ../../packages/design_system
navigation:
path: ../../packages/navigation
sf_infrastructure:
path: ../../packages/sf_infrastructure
#dependencies go here
get_it: ^9.0.5
go_router: ^17.0.0
flutter_riverpod: ^3.0.3
freezed_annotation: ^3.1.0
freezed: ^3.2.3
dio: ^5.9.0
json_annotation: ^4.9.0
json_serializable: ^6.11.2
webview_flutter: ^4.10.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
riverpod_generator: ^3.0.3
build_runner: ^2.7.1
riverpod_lint: ^3.0.3
flutter:

View File

@@ -0,0 +1,12 @@
# melos_managed_dependency_overrides: design_system,fonts,navigation,sf_infrastructure,utils
dependency_overrides:
design_system:
path: ../design_system
fonts:
path: ../fonts
navigation:
path: ../navigation
sf_infrastructure:
path: ../sf_infrastructure
utils:
path: ../utils