Skip to content

docs: Add a session-token/buy test screen to the example app - #33

Merged
taorepoara merged 8 commits into
mainfrom
claude/test-app-documentation-ncd1db
Aug 6, 2026
Merged

docs: Add a session-token/buy test screen to the example app#33
taorepoara merged 8 commits into
mainfrom
claude/test-app-documentation-ncd1db

Conversation

@taorepoara

@taorepoara taorepoara commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the boilerplate platform-version screen in the example app with a minimal test screen: a session token field, an environment picker (sandbox/production), and a Buy button wired to MonextPayment.startPayment, displaying the resulting MonextPaymentResult or error.
  • Document how to use the test screen in example/README.md (prerequisites, running the app, getting a test session token, walkthrough of the Buy flow).
  • Link the example app from the root README.md under a new "Try it" section.

Test plan

  • flutter pub get && flutter run in example/ and confirm the app builds and shows the session token/environment/Buy UI.
  • Paste a sandbox session token and tap Buy; confirm the native payment UI opens and the result is displayed after completing/cancelling.
  • flutter analyze in example/ with no new warnings.

Generated by Claude Code

Replace the boilerplate platform-version screen with a minimal form
(session token, environment picker, Buy button) that exercises
MonextPayment.startPayment and shows the resulting MonextPaymentResult,
so the example app doubles as a manual test harness. Document how to
use it in example/README.md and link it from the root README.
@taorepoara taorepoara changed the title Add a session-token/buy test screen to the example app docs: Add a session-token/buy test screen to the example app Aug 5, 2026
claude added 7 commits August 5, 2026 15:33
Flutter is dropping support for plugins that apply KGP themselves,
now that AGP 9+ ships built-in Kotlin support (see Flutter's
migrate-to-built-in-kotlin guide for plugin authors). Only fall back
to applying org.jetbrains.kotlin.android for AGP < 9, which has no
built-in Kotlin support of its own.
Add an MIT LICENSE (the plugin wraps Monext's native SDKs via
method channel rather than embedding their source, so MIT applies
regardless of how those SDKs are themselves licensed) and fill in
the pubspec.yaml fields pub.dev scores/displays: repository,
issue_tracker and topics. No CHANGELOG.md: changelogs for this repo
are generated from GitHub releases via convco, not maintained by hand.
detachFromActivity() only dropped the local paymentLauncher reference
without unregistering it from the Activity's ActivityResultRegistry,
which owns the registration by a fixed key. A later
onAttachedToActivity() call on the same Activity (e.g. after a hot
restart) then re-registered that same key, which throws and leaves
the new plugin instance's paymentLauncher null - so every
startPayment() call failed with "activity_unavailable" from then on.
FlutterActivity (the Activity subclass used by the vast majority of
Flutter apps, including this plugin's own example app) extends plain
android.app.Activity, not AndroidX's ComponentActivity. The plugin's
onAttachedToActivity() cast the bound Activity to ComponentActivity
and silently returned on failure, so paymentLauncher was never set
and every startPayment() call failed with "activity_unavailable" -
deterministically, not just on hot restart.

Replace the ActivityResultRegistry-based launcher with the
PluginRegistry.ActivityResultListener + Activity.startActivityForResult
APIs, which work against any Activity subclass and are the mechanism
Flutter itself documents for this use case. Drop the now-unused
PaymentActivity.LaunchArgs/ActivityResultContract plumbing, and update
the unit tests accordingly (the onActivityResult tests drive the
listener directly with a mocked Intent, since constructing a real one
throws in this project's Robolectric-less unit tests).
Both PaymentBox (Android) and presentPaymentSheet (iOS) render as a
bottom sheet, not a full page, but their host Activity/ViewController
was styled/presented as opaque fullscreen - showing as an empty black
backdrop behind the sheet instead of the app underneath.

- Android: give PaymentActivity a transparent theme (windowIsTranslucent
  + transparent windowBackground) instead of Theme.NoTitleBar.Fullscreen.
- iOS: present the hosting controller with .overFullScreen instead of
  .fullScreen, and clear its view's background, so the presenting app
  stays visible/live behind the transparent SwiftUI content.
Consuming apps failed full-mode R8 minification with "Missing
classes detected" for com.android.extensions.xr.*/
com.google.androidxr.splitengine.* - Compose UI's optional Android XR
(SceneCore) support references OEM-only classes that aren't on the
classpath for a normal (non-XR) device. Ship a consumer-rules.pro with
-dontwarn for those packages so apps depending on this plugin don't
each have to work this out themselves.
@taorepoara
taorepoara merged commit 7bbf89e into main Aug 6, 2026
5 checks passed
@taorepoara
taorepoara deleted the claude/test-app-documentation-ncd1db branch August 6, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants