GrootPay SDK
A Flutter SDK for integrating GrootPay β a seamless digital payment solution for online and in-app transactions.
This SDK provides an easy way to initialize and handle secure payment flows directly from your Flutter application.
β¨ Features
- Simple integration process
- Supports multiple environments (Development, Production)
- Secure payment initialization using client credentials
- Callback on payment success
- Easy-to-use API with Flutter context integration
Installation
Add the dependency in your pubspec.yaml:
dependencies:
grootpay_sdk: latest
Then run:
flutter pub get
π Usage
Hereβs a quick example of how to use GrootPay SDK in your Flutter app:
import 'package:grootpay_sdk/grootpay_sdk.dart';
GrootpaySdk().initPayment(
context: context,
paymentConfig: PaymentConfig(
environment: Environment.development,
clientId: "first-epg1", // replace with your client id
clientSecret:
"test-secret", // replace with your client secret
),
paymentCheckout: PaymentCheckout(
totalAmount: 100,
serviceType: "Online Payment",
),
onPayment: (PaymentResponse success) {
// Handle payment response
debugPrint("Payment completed: ${success.toString()}");
},
);
βοΈ Configuration
PaymentConfig
Used to configure the payment environment and credentials.
Property | Type | Description |
---|---|---|
environment |
Environment |
Set to Environment.development or Environment.production |
clientId |
String |
Unique client ID provided by GrootPay |
clientSecret |
String |
Secret key provided by GrootPay |
PaymentCheckout
Defines the payment details for the transaction.
Property | Type | Description |
---|---|---|
totalAmount |
double |
Amount to be charged |
serviceType |
String |
Description of the payment purpose |
onPayment
Callback function triggered after payment is completed.
Receives a PaymentResponse
object containing transaction details.
π§ͺ Environments
- Development β Use sandbox credentials for testing
- Production β Use live credentials for real payments
π¦ Example Project
A working example is available in the /example
directory of this package.
Run it with:
flutter run example/lib/main.dart
π License
This project is licensed under the MIT License.
See the LICENSE file for details.
π¬ Support
For integration support or technical queries, contact:
π§ support@grootpay.com
π https://grootpay.com
Libraries
- core/constants/api_constants
- core/constants/app_colors
- core/constants/assets_path
- core/constants/environment_config
- core/extensions/app_extensions
- core/models/device_info_model
- core/models/failure_model
- core/services/device_info/device_info_service
- core/services/hmac_signature_helper
- core/services/network_service/api_interceptor
- core/services/network_service/network_service
- core/services/network_service/type_defs
- core/services/sdk_session_manager
- core/state/normal_state
- core/utils/custom_color_swatch
- core/utils/theme/dark_theme
- core/utils/theme/global_theme
- core/utils/theme/light_theme
- core/widgets/app_constant
- core/widgets/card_row_widget
- core/widgets/custom_container_widget
- core/widgets/custom_text_field
- core/widgets/dismiss_keyboard_widget
- core/widgets/mandatory_title_widget
- core/widgets/screen_padding
- core/widgets/svg_widget
- core/widgets/text_widgets
- domain/api_repo
- domain/model/payment_checkout_response_model
- domain/model/sdk_model/payment_checkout_model
- domain/model/sdk_model/payment_config_model
- domain/model/sdk_model/payment_response_model
- domain/model/token_model
- grootpay_sdk
- grootpay_sdk_method_channel
- grootpay_sdk_platform_interface
- presentation/bloc/login_bloc/login_bloc
- presentation/screens/wallet_checkout_screen
- presentation/screens/wallet_login_screen
- presentation/screens/wallet_otp_screen
- presentation/widget/auth_message_widget