guavasure_flutter 0.1.3
guavasure_flutter: ^0.1.3 copied to clipboard
Embed GuavaSure pet insurance in Flutter via WebView.
guavasure_flutter #
Flutter package that embeds the hosted GuavaSure insurance flow in a WebView and
implements GuavasureBridge for Razorpay payment links, native file pick, and
optional partner-collected payment.
Requirements: Dart >=3.6.0, Flutter >=3.24.0
Installation #
Add the package from pub.dev:
flutter pub add guavasure_flutter
Or add it to pubspec.yaml:
dependencies:
guavasure_flutter: ^0.1.3
The package pulls in webview_flutter, url_launcher, and file_selector transitively.
Platform setup #
Android #
For Razorpay payment links (Custom Tabs) on Android 11+, add to AndroidManifest.xml inside <queries>:
<queries>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
iOS #
LaunchMode.inAppBrowserView uses SFSafariViewController — no extra setup required.
Quick start #
import 'package:guavasure_flutter/guavasure_flutter.dart';
GuavaSureEmbed(
config: GuavaSureEmbedConfig(
partnerId: 'YOUR_PARTNER_ID',
environment: GuavaSureEnvironment.sandbox,
partnerAuthTokenProvider: () => myBackend.fetchCustomerAuthToken(),
),
partnerPaymentHandler: (request) async {
// Charge on your PSP, confirm via your backend, then:
return PartnerPaymentResult.confirmed;
},
)
partnerPaymentHandler is only needed when GuavaSure enables partner-collected
payment on your account. Omit it for the default Razorpay checkout flow.
Security #
- Bridge messages are only handled on the configured embed origin; external links open in the system browser.
- Razorpay payment URLs are allowlisted (
rzp.io,razorpay.me,*.razorpay.com). - Prefer
partnerAuthTokenProviderwith short-lived JWTs over a staticpartnerAuthToken. - In
partnerPaymentHandler, validate the intent server-side before charging your PSP.
License #
Licensed under GPL-3.0. This is an OSI-approved copyleft license: if you distribute a modified version, or combine it into an app you distribute, you must comply with GPL terms (including source disclosure for distributed binaries).
This package is intended for authorized GuavaSure integration partners. Your partner agreement with GuavaSure governs eligibility and commercial use separately from the GPL.