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