sbiepay_flutter_sdk Integration Guide

This guide outlines the different methods to integrate the sbiepay_flutter_sdk package into your Flutter project.

Requirements

  1. SDK Download: Download the latest Flutter SDK from pub.dev.
  2. Development Environment: Use dart SDK version >=3.5.3 up to <4.0.0 and Flutter version >=3.3.0
  3. Network Requirements: Ensure the device can access the internet for API communication.
  4. Android Support: API level from 28 (Android 9) to 36
  5. iOS Support: Minimum iOS 13.0+
  6. Supported Payment Methods: Ensure the payment methods offered by the aggregator (credit card, debit card, UPI, etc.) match your requirements.

Installation

Add the dependency to your pubspec.yaml:

dependencies:
  sbiepay_flutter_sdk: ^1.0.0

Then run:

flutter pub get

Only For IOS: Install Pods.

For the SDK to work in Flutter iOS, navigate to the ios/ directory via terminal using cd ios command.

Then run:

pod install

Ensure that your Info.plist includes the necessary permissions for internet and networking.

Usage example:

  1. Import the SDK in your Dart file:
import 'package:sbiepay_flutter_sdk/sbiepay_flutter_sdk.dart';	 
  1. Call your APIs to generate final url for payment.

  2. Create transactionCheckout instance:

final transactionCheckout = TransactionCheckout();
  1. Call below method which is override from SDK.
    transactionCheckout.initiateTransaction( 
        context: context, 
        paymentUrl: paymentUrl, 
        referrer: referrer, 
        transactionResultListener: TransactionResultListener( 
          onSuccess: (response) => handleTransactionSuccess(response), 
          onPending: (response) => handleTransactionPending(response), 
          onError: (response) => handleTransactionError(response), 
          onFailed: (response) => handleTransactionFailed(response), 
          onCancelled: (response) => 
              handleTransactionCancelled(response), 
          onTimeOut: (response) => handleTransactionTimeOut(response), 
       )); 
  1. Handle Transaction Responses Implement appropriate handlers for each transaction status:
void handleTransactionSuccess(dynamic response) {
// Handle successful transaction
}

void handleTransactionPending(dynamic response) {
// Handle pending transaction
}

void handleTransactionError(dynamic response) {
// Handle transaction error
}

void handleTransactionFailed(dynamic response) {
// Handle failed transaction
}

void handleTransactionCancelled(dynamic response) {
// Handle cancelled transaction
}

void handleTransactionTimeOut(dynamic response) {
// Handle transaction timeout
}

Libraries

plugin/epay_method_channel
plugin/epay_platform
plugin/epay_platform_interface
sbiepay_flutter_sdk
Encapsulates the plugin classes within the ePay library and controls their visibility. Allowed files exports specific classes and models that are accessible to the merchant app, allowing them to interact with the ePay SDK and handle transactions, results, and responses.