diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e4f396..6fc185c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,15 +90,14 @@ jobs: runs-on: macos-latest steps: # Flutter's Swift Package Manager integration derives the plugin's local package - # identity from the checkout directory's basename. Since this repo *is* the plugin - # (pubspec/Package.swift name `monext_payment`) but the repo is named `monext-flutter`, - # checking out under the default path makes Xcode compute a mismatched identity and - # fail with "unable to override package... doesn't match override's identity". Checking - # out into a `monext_payment` directory keeps the basename aligned with the plugin name. + # identity from the checkout directory's basename, which must match the pubspec/ + # Package.swift name (`monext_flutter_sdk`) or Xcode fails with "unable to override + # package... doesn't match override's identity". This repo is still named + # `monext-flutter` on GitHub, so force the checkout path until it's renamed to match. - name: Checkout repository uses: actions/checkout@v4 with: - path: monext_payment + path: monext_flutter_sdk - name: Setup Flutter Environment uses: subosito/flutter-action@v2.18.0 @@ -108,17 +107,17 @@ jobs: cache: true - name: Install example app dependencies - working-directory: monext_payment/example + working-directory: monext_flutter_sdk/example run: flutter pub get - name: Generate iOS project config (pods, xcconfig) without a full build - working-directory: monext_payment/example + working-directory: monext_flutter_sdk/example run: flutter build ios --config-only --no-codesign # xcodebuild test builds the app as part of running the tests, so this also # acts as the compile check - no need for a separate `flutter build ios` step. - name: Run iOS native unit tests - working-directory: monext_payment/example + working-directory: monext_flutter_sdk/example run: | xcodebuild test \ -workspace ios/Runner.xcworkspace \ diff --git a/README.md b/README.md index 26ac37c..46f58e0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# monext_payment +# monext_flutter_sdk Flutter plugin bridging Monext's native Android/iOS payment SDKs to a unified Dart API. @@ -13,7 +13,7 @@ needs to configure beyond adding this dependency. ## Dart API ```dart -import 'package:monext_payment/monext_payment.dart'; +import 'package:monext_flutter_sdk/monext.dart'; await MonextPayment.initialize(); diff --git a/docs/guides/project-setup-requirements.md b/docs/guides/project-setup-requirements.md index d7c5775..4b36c4b 100644 --- a/docs/guides/project-setup-requirements.md +++ b/docs/guides/project-setup-requirements.md @@ -4,7 +4,7 @@ title: Project Setup Requirements # Project Setup Requirements -Requirements a consuming app must satisfy beyond adding the `monext_payment` dependency, +Requirements a consuming app must satisfy beyond adding the `monext_flutter_sdk` dependency, calling `MonextPayment.initialize()` and `MonextPayment.startPayment(...)`. These come from the native Monext SDKs' own minimum requirements, not from this plugin. diff --git a/example/README.md b/example/README.md index 0026d62..5b076fc 100644 --- a/example/README.md +++ b/example/README.md @@ -1,13 +1,13 @@ -# monext_payment_example +# monext_example -Demonstrates how to use the `monext_payment` plugin: a single screen with a session token field, +Demonstrates how to use the `monext_flutter_sdk` plugin: a single screen with a session token field, an environment picker, and a **Buy** button that launches Monext's native payment UI and displays the resulting `MonextPaymentResult`. ## Prerequisites - A working Flutter setup (`flutter doctor`). -- This app depends on `monext_payment` via a local path dependency (`../`), so no extra setup is +- This app depends on `monext_flutter_sdk` via a local path dependency (`../`), so no extra setup is needed for the plugin itself. See the root [Project Setup Requirements](../docs/guides/project-setup-requirements.md) for native minimum versions if you fork this example into a standalone app. diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts index 7fd939a..67f32e3 100644 --- a/example/android/app/build.gradle.kts +++ b/example/android/app/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } android { - namespace = "io.lenra.monext_payment_example" + namespace = "io.lenra.monext_example" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -16,7 +16,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "io.lenra.monext_payment_example" + applicationId = "io.lenra.monext_example" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. // Must be >= the plugin's minSdk (26, required by Monext's Android SDK). diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 3223b70..4491e2a 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Monext Payment + Monext Example CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -15,7 +15,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - monext_payment_example + monext_example CFBundlePackageType APPL CFBundleShortVersionString diff --git a/example/ios/RunnerTests/RunnerTests.swift b/example/ios/RunnerTests/RunnerTests.swift index 9d6caf8..9b02726 100644 --- a/example/ios/RunnerTests/RunnerTests.swift +++ b/example/ios/RunnerTests/RunnerTests.swift @@ -6,7 +6,7 @@ import UIKit import XCTest -@testable import monext_payment +@testable import monext_flutter_sdk // This demonstrates a simple unit test of the Swift portion of this plugin's implementation. // diff --git a/example/lib/main.dart b/example/lib/main.dart index b3af09e..2eca1fe 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:monext_payment/monext_payment.dart'; +import 'package:monext_flutter_sdk/monext.dart'; void main() { runApp(const MyApp()); @@ -11,13 +11,13 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'monext_payment example', + title: 'monext_example', home: const PaymentDemoPage(), ); } } -/// Demo page showing the minimal integration of `monext_payment`: a form to +/// Demo page showing the minimal integration of `monext_flutter_sdk`: a form to /// fill in a session token/environment and a "Buy" button that starts the /// native payment flow and displays the resulting [MonextPaymentResult]. /// @@ -65,7 +65,7 @@ class _PaymentDemoPageState extends State { await MonextPayment.startPayment( sessionToken: sessionToken, environment: _environment, - appearance: const MonextAppearance(headerTitle: 'monext_payment example'), + appearance: const MonextAppearance(headerTitle: 'monext_example'), onPaymentResult: (result) { if (!mounted) return; setState(() { @@ -86,7 +86,7 @@ class _PaymentDemoPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('monext_payment example')), + appBar: AppBar(title: const Text('monext_example')), body: Padding( padding: const EdgeInsets.all(16), child: Column( diff --git a/example/pubspec.lock b/example/pubspec.lock index c746963..ec79855 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -162,7 +162,7 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" - monext_payment: + monext_flutter_sdk: dependency: "direct main" description: path: ".." diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 7493541..43c2a63 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,5 +1,5 @@ -name: monext_payment_example -description: "Demonstrates how to use the monext_payment plugin." +name: monext_example +description: "Demonstrates how to use the monext_flutter_sdk plugin." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -17,9 +17,9 @@ dependencies: flutter: sdk: flutter - monext_payment: + monext_flutter_sdk: # When depending on this package from a real application you should use: - # monext_payment: ^x.y.z + # monext_flutter_sdk: ^x.y.z # See https://dart.dev/tools/pub/dependencies#version-constraints # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index a9641c0..e6fb3bc 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:monext_payment_example/main.dart'; +import 'package:monext_example/main.dart'; void main() { testWidgets('Verify Platform version', (WidgetTester tester) async { diff --git a/ios/monext_payment.podspec b/ios/monext_flutter_sdk.podspec similarity index 74% rename from ios/monext_payment.podspec rename to ios/monext_flutter_sdk.podspec index f2a4682..2d72df1 100644 --- a/ios/monext_payment.podspec +++ b/ios/monext_flutter_sdk.podspec @@ -1,23 +1,23 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint monext_payment.podspec` to validate before publishing. +# Run `pod lib lint monext_flutter_sdk.podspec` to validate before publishing. # Pod::Spec.new do |s| - s.name = 'monext_payment' + s.name = 'monext_flutter_sdk' s.version = '0.0.1' s.summary = 'Flutter plugin for Monext payment flow integration.' s.description = <<-DESC Flutter plugin bridging Monext's native Android/iOS payment SDKs to a unified Dart API. DESC - s.homepage = 'https://github.com/lenra-io/monext-flutter' + s.homepage = 'https://github.com/lenra-io/monext_flutter_sdk' s.author = { 'Lenra' => 'contact@lenra.io' } s.source = { :path => '.' } - s.source_files = 'monext_payment/Sources/monext_payment/**/*' + s.source_files = 'monext_flutter_sdk/Sources/monext_flutter_sdk/**/*' s.dependency 'Flutter' # Monext's iOS SDK (distributed only via Swift Package Manager) requires iOS 16.0+. # Host apps that consume this plugin through CocoaPods must enable Flutter's # Swift Package Manager support to resolve the Monext dependency declared in - # monext_payment/Package.swift. + # monext_flutter_sdk/Package.swift. s.platform = :ios, '16.0' # Flutter.framework does not contain a i386 slice. @@ -28,5 +28,5 @@ Flutter plugin bridging Monext's native Android/iOS payment SDKs to a unified Da # required reason APIs, update the PrivacyInfo.xcprivacy file to describe your # plugin's privacy impact, and then uncomment this line. For more information, # see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files - # s.resource_bundles = {'monext_payment_privacy' => ['monext_payment/Sources/monext_payment/PrivacyInfo.xcprivacy']} + # s.resource_bundles = {'monext_flutter_sdk_privacy' => ['monext_flutter_sdk/Sources/monext_flutter_sdk/PrivacyInfo.xcprivacy']} end diff --git a/ios/monext_payment/Package.swift b/ios/monext_flutter_sdk/Package.swift similarity index 91% rename from ios/monext_payment/Package.swift rename to ios/monext_flutter_sdk/Package.swift index 9b0f6fe..91738ff 100644 --- a/ios/monext_payment/Package.swift +++ b/ios/monext_flutter_sdk/Package.swift @@ -4,13 +4,13 @@ import PackageDescription let package = Package( - name: "monext_payment", + name: "monext_flutter_sdk", platforms: [ // Monext's iOS SDK requires iOS 16.0 or later. .iOS("16.0") ], products: [ - .library(name: "monext-payment", targets: ["monext_payment"]) + .library(name: "monext-flutter-sdk", targets: ["monext_flutter_sdk"]) ], dependencies: [ .package(name: "FlutterFramework", path: "../FlutterFramework"), @@ -20,7 +20,7 @@ let package = Package( ], targets: [ .target( - name: "monext_payment", + name: "monext_flutter_sdk", dependencies: [ .product(name: "FlutterFramework", package: "FlutterFramework"), .product(name: "Monext", package: "monext-ios-sdk-spm") diff --git a/ios/monext_payment/Sources/monext_payment/MonextAppearanceMapper.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextAppearanceMapper.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/MonextAppearanceMapper.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextAppearanceMapper.swift diff --git a/ios/monext_payment/Sources/monext_payment/MonextApplePayConfigurationMapper.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextApplePayConfigurationMapper.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/MonextApplePayConfigurationMapper.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextApplePayConfigurationMapper.swift diff --git a/ios/monext_payment/Sources/monext_payment/MonextPaymentPlugin.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextPaymentPlugin.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/MonextPaymentPlugin.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextPaymentPlugin.swift diff --git a/ios/monext_payment/Sources/monext_payment/MonextPaymentResultMapper.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextPaymentResultMapper.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/MonextPaymentResultMapper.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextPaymentResultMapper.swift diff --git a/ios/monext_payment/Sources/monext_payment/MonextSdkClient.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextSdkClient.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/MonextSdkClient.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/MonextSdkClient.swift diff --git a/ios/monext_payment/Sources/monext_payment/PaymentHostingView.swift b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/PaymentHostingView.swift similarity index 100% rename from ios/monext_payment/Sources/monext_payment/PaymentHostingView.swift rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/PaymentHostingView.swift diff --git a/ios/monext_payment/Sources/monext_payment/PrivacyInfo.xcprivacy b/ios/monext_flutter_sdk/Sources/monext_flutter_sdk/PrivacyInfo.xcprivacy similarity index 100% rename from ios/monext_payment/Sources/monext_payment/PrivacyInfo.xcprivacy rename to ios/monext_flutter_sdk/Sources/monext_flutter_sdk/PrivacyInfo.xcprivacy diff --git a/lib/monext_payment.dart b/lib/monext.dart similarity index 92% rename from lib/monext_payment.dart rename to lib/monext.dart index 93c0152..bf2c068 100644 --- a/lib/monext_payment.dart +++ b/lib/monext.dart @@ -5,18 +5,18 @@ import 'monext_appearance.dart'; import 'monext_environment.dart'; import 'monext_google_pay_configuration.dart'; import 'monext_language.dart'; -import 'monext_payment_not_initialized_exception.dart'; -import 'monext_payment_platform_interface.dart'; +import 'monext_not_initialized_exception.dart'; +import 'monext_platform_interface.dart'; export 'monext_apple_pay_configuration.dart'; export 'monext_appearance.dart'; export 'monext_environment.dart'; export 'monext_google_pay_configuration.dart'; export 'monext_language.dart'; -export 'monext_payment_channel_unavailable_exception.dart'; -export 'monext_payment_native_exception.dart'; -export 'monext_payment_not_initialized_exception.dart'; -export 'monext_payment_result.dart'; +export 'monext_channel_unavailable_exception.dart'; +export 'monext_native_exception.dart'; +export 'monext_not_initialized_exception.dart'; +export 'monext_result.dart'; /// Dart entry point for the Monext payment plugin. class MonextPayment { diff --git a/lib/monext_payment_channel_unavailable_exception.dart b/lib/monext_channel_unavailable_exception.dart similarity index 100% rename from lib/monext_payment_channel_unavailable_exception.dart rename to lib/monext_channel_unavailable_exception.dart diff --git a/lib/monext_payment_method_channel.dart b/lib/monext_method_channel.dart similarity index 95% rename from lib/monext_payment_method_channel.dart rename to lib/monext_method_channel.dart index 6ce81bf..e0891e4 100644 --- a/lib/monext_payment_method_channel.dart +++ b/lib/monext_method_channel.dart @@ -6,9 +6,9 @@ import 'monext_appearance.dart'; import 'monext_environment.dart'; import 'monext_google_pay_configuration.dart'; import 'monext_language.dart'; -import 'monext_payment_channel_unavailable_exception.dart'; -import 'monext_payment_native_exception.dart'; -import 'monext_payment_platform_interface.dart'; +import 'monext_channel_unavailable_exception.dart'; +import 'monext_native_exception.dart'; +import 'monext_platform_interface.dart'; /// An implementation of [MonextPaymentPlatform] that uses method channels. class MethodChannelMonextPayment extends MonextPaymentPlatform { diff --git a/lib/monext_payment_native_exception.dart b/lib/monext_native_exception.dart similarity index 100% rename from lib/monext_payment_native_exception.dart rename to lib/monext_native_exception.dart diff --git a/lib/monext_payment_not_initialized_exception.dart b/lib/monext_not_initialized_exception.dart similarity index 100% rename from lib/monext_payment_not_initialized_exception.dart rename to lib/monext_not_initialized_exception.dart diff --git a/lib/monext_payment_platform_interface.dart b/lib/monext_platform_interface.dart similarity index 96% rename from lib/monext_payment_platform_interface.dart rename to lib/monext_platform_interface.dart index 4ea2508..9dc7413 100644 --- a/lib/monext_payment_platform_interface.dart +++ b/lib/monext_platform_interface.dart @@ -5,8 +5,8 @@ import 'monext_appearance.dart'; import 'monext_environment.dart'; import 'monext_google_pay_configuration.dart'; import 'monext_language.dart'; -import 'monext_payment_method_channel.dart'; -import 'monext_payment_result.dart'; +import 'monext_method_channel.dart'; +import 'monext_result.dart'; abstract class MonextPaymentPlatform extends PlatformInterface { /// Constructs a MonextPaymentPlatform. diff --git a/lib/monext_payment_result.dart b/lib/monext_result.dart similarity index 98% rename from lib/monext_payment_result.dart rename to lib/monext_result.dart index 19c3701..a04ebff 100644 --- a/lib/monext_payment_result.dart +++ b/lib/monext_result.dart @@ -1,6 +1,6 @@ import 'package:json_annotation/json_annotation.dart'; -part 'monext_payment_result.g.dart'; +part 'monext_result.g.dart'; /// Outcome of a payment handled through [MonextPayment.startPayment]. /// diff --git a/lib/monext_payment_result.g.dart b/lib/monext_result.g.dart similarity index 93% rename from lib/monext_payment_result.g.dart rename to lib/monext_result.g.dart index d9f5afd..6d4b04a 100644 --- a/lib/monext_payment_result.g.dart +++ b/lib/monext_result.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'monext_payment_result.dart'; +part of 'monext_result.dart'; // ************************************************************************** // JsonSerializableGenerator diff --git a/pubspec.yaml b/pubspec.yaml index 2039fc5..63eb616 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,9 +1,9 @@ -name: monext_payment +name: monext_flutter_sdk description: "Flutter plugin bridging Monext's native Android/iOS payment SDKs to a unified Dart API." version: 0.0.1 -homepage: "https://github.com/lenra-io/monext-flutter" -repository: "https://github.com/lenra-io/monext-flutter" -issue_tracker: "https://github.com/lenra-io/monext-flutter/issues" +homepage: "https://github.com/lenra-io/monext_flutter_sdk" +repository: "https://github.com/lenra-io/monext_flutter_sdk" +issue_tracker: "https://github.com/lenra-io/monext_flutter_sdk/issues" topics: - payments - checkout diff --git a/test/monext_appearance_test.dart b/test/monext_appearance_test.dart index a76ac42..42a6ad6 100644 --- a/test/monext_appearance_test.dart +++ b/test/monext_appearance_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:monext_payment/monext_payment.dart'; +import 'package:monext_flutter_sdk/monext.dart'; void main() { group('MonextAppearance', () { diff --git a/test/monext_payment_method_channel_test.dart b/test/monext_method_channel_test.dart similarity index 98% rename from test/monext_payment_method_channel_test.dart rename to test/monext_method_channel_test.dart index 397319b..a9d2996 100644 --- a/test/monext_payment_method_channel_test.dart +++ b/test/monext_method_channel_test.dart @@ -2,8 +2,8 @@ import 'dart:async'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:monext_payment/monext_payment.dart'; -import 'package:monext_payment/monext_payment_method_channel.dart'; +import 'package:monext_flutter_sdk/monext.dart'; +import 'package:monext_flutter_sdk/monext_method_channel.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); diff --git a/test/monext_payment_result_test.dart b/test/monext_result_test.dart similarity index 93% rename from test/monext_payment_result_test.dart rename to test/monext_result_test.dart index d5af044..c309af9 100644 --- a/test/monext_payment_result_test.dart +++ b/test/monext_result_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:monext_payment/monext_payment.dart'; +import 'package:monext_flutter_sdk/monext.dart'; void main() { group('MonextPaymentResult', () { diff --git a/test/monext_payment_test.dart b/test/monext_test.dart similarity index 97% rename from test/monext_payment_test.dart rename to test/monext_test.dart index 7a3122f..8a83e54 100644 --- a/test/monext_payment_test.dart +++ b/test/monext_test.dart @@ -1,7 +1,7 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:monext_payment/monext_payment.dart'; -import 'package:monext_payment/monext_payment_platform_interface.dart'; -import 'package:monext_payment/monext_payment_method_channel.dart'; +import 'package:monext_flutter_sdk/monext.dart'; +import 'package:monext_flutter_sdk/monext_platform_interface.dart'; +import 'package:monext_flutter_sdk/monext_method_channel.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; class MockMonextPaymentPlatform