Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# monext_payment
# monext_flutter_sdk

Flutter plugin bridging Monext's native Android/iOS payment SDKs to a unified Dart API.

Expand All @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/project-setup-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

android {
namespace = "io.lenra.monext_payment_example"
namespace = "io.lenra.monext_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="monext_payment_example"
android:label="monext_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.lenra.monext_payment_example
package io.lenra.monext_example

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion example/integration_test/plugin_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'package:monext_payment/monext_payment.dart';
import 'package:monext_flutter_sdk/monext.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Monext Payment</string>
<string>Monext Example</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>monext_payment_example</string>
<string>monext_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
2 changes: 1 addition & 1 deletion example/ios/RunnerTests/RunnerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
10 changes: 5 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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());
Expand All @@ -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].
///
Expand Down Expand Up @@ -65,7 +65,7 @@ class _PaymentDemoPageState extends State<PaymentDemoPage> {
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(() {
Expand All @@ -86,7 +86,7 @@ class _PaymentDemoPageState extends State<PaymentDemoPage> {
@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(
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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: ".."
Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions ios/monext_payment.podspec → ios/monext_flutter_sdk.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions lib/monext_payment.dart → lib/monext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/monext_payment_result.dart → lib/monext_result.dart
Original file line number Diff line number Diff line change
@@ -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].
///
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/monext_appearance_test.dart
Original file line number Diff line number Diff line change
@@ -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', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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', () {
Expand Down
Loading
Loading