glomopay_sdk 2.0.0
glomopay_sdk: ^2.0.0 copied to clipboard
Official GlomoPay Flutter SDK for integrating LRS Checkout.
Changelog #
Deprecation Notice #
- Versions
1.0.3and below are deprecated, and1.0.4or later versions are available.
2.0.0 #
See MIGRATION.md for upgrade steps. Every integration needs one change - the new required onUserJourneyCompleted callback - and the compiler points at it.
- New required callback
onUserJourneyCompleted- the second happy path. Invoked when the user completes the bank transfer flow. This previously used to arrive asonPaymentSuccesswith a payload whosepaymentIdandsignaturewere both null - a payment reported as received, but nothing for your backend to verify it against. It now arrives asonUserJourneyCompletedwith aGlomoPayUserJourneyPayloadcarryingjourneyType,orderIdand the transfer details the page sent, and no longer reachesonPaymentSuccess- IfonPaymentSuccesscurrently special-cases a nullpaymentId, that branch should move to the new callback. - Previously, for security reasons, file uploads were restricted to prevent users from accidentally uploading files of the wrong type. Now this security optimization has been removed and the SDK relies on the bank for guidance - whatever the bank's pages ask for, can be selected, including formats the picker had previously greyed out.
- Removed some legacy integration options which were not suitable for production builds.
- Improved error tracking and SDK diagnostics.
CheckoutStatusnow also haserror, for a checkout that could not proceed with no payment attempted - the order or configuration being unusable, the backend unreachable, or the user exiting one of the SDK's error screens. These were previously reported aspaymentFailed. Appended likebankTransferSubmitted, so existing members keep their indices; only an exhaustiveswitchneeds a new arm.CheckoutStatusgainedbankTransferSubmitted. A submitted bank transfer used to leave the status atpaymentSuccessful. The new status has been appended to the enum, so the existing members keep the indices they shipped with; only an exhaustiveswitchoverCheckoutStatusneeds a new arm.- Improved diagnostics on the SDK; Merchants integrations can now freely use their own error tracking dependencies without any version restrictions.
- Fixed the SDK's default error screens that could not be dismissed. Their buttons no longer take their colours from the host app's theme, so an app theme wouldn't hide the exit. Applies to both the default checkout error and connection error dialogs.
- Dismissing a connection error now closes the checkout rather than keeping the user stuck in loading. On Android the system back button does the same, instead of closing the error and leaving the checkout stranded.
- Error callbacks now fire independently of the default dialog being dismissed, so host apps are always informed about what went wrong even if the dialog is never closed.
- Fixed a bug where errors were also triggering
onPaymentFailure- Only confirmed payment failures on the backend will trigger the payment failure callback. All other errors will correctly go toonSdkErrorandonConnectionError. - When the user exits from any of the SDK's default error screens, the checkout now ends through
onPaymentTerminate(sourceuserDismiss) instead ofonPaymentFailure.onPaymentFailureis reserved for a payment the backend confirms failed. SDK errors still reach the moment they are detected, throughonSdkErrororonConnectionError. Important: If closing the checkout or running cleanup was handled insideonPaymentFailurebefore, copy it toonPaymentTerminate- the SDK now closes itself on every one of these paths, so closure and cleanup should be replicated on every single path so that the user is not left stranded upon migration. - The SDK no longer draws its own default error screen when the checkout page reports a failure of its own, since the page already renders one. The page's events continue to reach
onEventexactly as before. - Internal event handling has been revamped, refactored and cleaned up. Recommended integrations are unaffected, as these events were never part of the SDK's API contract.
onEventis now marked deprecated and will be removed in a future major version. It carries internal events that are subject to change; the lifecycle callbacks the SDK ships remain the supported integration. If you consumeonEventor supply your ownGlomoPayControllerwithaddEventListener, please reach out to the Glomo mobile team and we will share the mapping before you upgrade.- Each failure now reports its actual semantic, and only once. Connectivity failures now arrive through
onConnectionErrorand order or SDK faults throughonSdkError. A single checkout loading failure also no longer fires both callbacks - it firesonConnectionErroralone. - The back button is now no longer locked while a payment is in progress. Previously a page that stopped responding mid-payment would lock the back button and users can potentially get stuck until payment confirmation was received.
onPaymentTerminateis now a notification rather than a handover. The SDK closes the checkout itself whether or not a callback is supplied, so supplying it will no longer leave the user without a working back button. If checkout is closed from that callback, the SDK will not close a second time.- The load-timeout on
onConnectionErroris now advisory: network may still become re-available, and the SDK does not close itself on it (shouldAutoCloseisfalse). - Fixed a bug where successful payments would be overridden if load-timeout errors had been reported. A payment completed on a slow checkout that recovered midway will correctly
onPaymentSuccess. - Every payment failure the checkout page reports now reaches
onPaymentFailure, including the thinner shape the page emits for its own setup failures. The page's own detail travels untouched in the payload'srawResponse. - Payment failures reported by the backend now reach
onPaymentFailure. They were being checked against the rule written for a payment success, which requires a signature that a failure payload has never carried - so every confirmed decline was discarded before reaching your app, in every release build. If you have been treatingonPaymentFailureas unreliable, it is now the callback for exactly this. - The checkout page's own close control now closes the checkout in every state. It stopped working once the page had reported a payment as pending, which every bank hand-off does.
- Your app is told about one ending per checkout. A backend-confirmed payment result is the ending, so a user closing what remains afterwards no longer also delivers
onPaymentTerminatefor the same journey. FlutterError.onError,PlatformDispatcher.instance.onErrorand the native crash handlers are no longer installed inside the host application. If your app inherited SDK-installed handlers, it loses them at this upgrade - install your own. In exchange, the SDK no longer constrains any versions for error trackers.path_provideris now a direct dependency (^2.0.0). It was already resolved transitively, so no new package enters the dependency graph, but the constraint is now the SDK's own and may affect resolution in a pinned host app.- SDK diagnostics are spooled to the app support directory and flushed on the next initialisation, so a checkout interrupted by process death is still reported. The SDK writes only its own diagnostics there and no payment data.
- Improved error tracking and diagnostics.
1.11.2 #
- A failed order fetch now ends the checkout with an SDK error instead of
opening the webview. Previously
start()fell back to standard checkout and loaded the page anyway; the order type is only knowable from a successful fetch, and guessing routed LRS orders to the wrong checkout host, where the page itself then errored. An integration that assumed a webview always opens afterstart()now sees its error path fire instead. - The order fetch is bounded at 30 seconds and surfaces as a
networkError. Previously it could hang indefinitely, leaving the checkout on a spinner with no outcome either way. - Added
package_info_plusas a direct dependency, and removedyaml. - Improved analytics and error reporting on the checkout-open path.
GlomoPayCheckoutgained an optionalcheckoutOpenTimeout, which tunes when a slow checkout-open is reported and changes nothing the user sees. - Squashed CHANGELOG entries for expired SDK versions (versions prior to
1.0.4are beyond their EOL and deprecated). - Fixed the flicker where a bank's 2FA page intermittently disappeared and the checkout screen showed through beneath it.
- Optimized rendering of bank pages with several performance enhancements for redirect chains.
- UI elements with educational content will no longer be created if there is nothing to render.
- Transient failure of native bridge is handled resiliently.
- Fixed the bank page showing as blank on Android the moment the paged loaded (zero width layout bug).
- Fixed the iOS software keyboard being dismissed the instant a bank 2FA card or OTP field was focused. The fixed-element sweep no longer hides the container holding the focused field, no longer runs when nothing is focused, and now runs once per keyboard open rather than on every viewport resize.
- On iOS,
-webkit-user-modify: read-writeis no longer forced onto input fields. It governs editability oncontenteditablehosts and can interfere with caret handling on native form controls. - On iOS, bank pages that block text selection in their own card or OTP fields are now honoured rather than overridden. Long-press paste into an empty field is unaffected.
1.11.1 #
- Added support for banks with breaking changes in remittance flows
- Nested
window.openredirects and back button navigations are now handled from within bank flows.
1.11.0 #
- Added camera/gallery/file picker for images and PDFs, fixing bank flows where uploads were unusable.
image_pickernow uses the system photo picker.- Added
onUserRefusedDevicePermissionscallback onGlomoPayCheckout- fires when the user denies camera permission during file upload. captureEnabled(HTML capture attribute) now falls back to the bottom sheet when accept types include non-image formats, and falls back on camera permission denial instead of silently returning empty.- Fixed
contextProviderto return null on disposed State instead of throwing.
1.10.4 #
- Bug fixes
1.10.0 #
- package version dependency fixed
1.0.9 #
- Fix auto scroll bottom to top issue for ios.
1.0.8 #
- Removed the aggressive auto-scroll handler from iOS WebView injection to reduce conflicts with bank pages such as Kotak.
1.0.7 #
- Updated
safe_deviceto^1.4.0so the AndroidcheckTestKeys()compile issue is avoided and cross-platform builds remain stable.
1.0.6 #
- safe device error fixed.
1.0.5 #
- Pinned
safe_deviceto the fixed 1.4.x line so the AndroidcheckTestKeys()compile issue is avoided and cross-platform builds remain stable.
1.0.4 #
- iOS host presentation updated to use a modal sheet style so the rendered webview back button remains clickable in partner integrations.