sbiepay_flutter_sdk 1.0.0
sbiepay_flutter_sdk: ^1.0.0 copied to clipboard
SBIePay 2.0 Flutter SDK
sbiepay_flutter_sdk Integration Guide #
This guide outlines the different methods to integrate the sbiepay_flutter_sdk package into your Flutter project.
Requirements #
- SDK Download: Download the latest Flutter SDK from pub.dev.
- Development Environment: Use dart SDK version >=3.5.3 up to <4.0.0 and Flutter version >=3.3.0
- Network Requirements: Ensure the device can access the internet for API communication.
- Android Support: API level from 28 (Android 9) to 36
- iOS Support: Minimum iOS 13.0+
- 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: #
- Import the SDK in your Dart file:
import 'package:sbiepay_flutter_sdk/sbiepay_flutter_sdk.dart';
-
Call your APIs to generate final url for payment.
-
Create transactionCheckout instance:
final transactionCheckout = TransactionCheckout();
- 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),
));
- 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
}