Last updated:
0 purchases
phonepe payment sdk
Flutter PhonePe Payment SDK #
Use this Plugin as a library #
Add the dependency in flutter project from the command line
flutter pub add phonepe_payment_sdk
copied to clipboard
Install the dependency from the command line
flutter pub get
copied to clipboard
Import the package in your dart code :
import 'package:phonepe_payment_sdk/phonepe_payment_sdk.dart';
copied to clipboard
Start Transaction #
Initialise the init method before starting the transaction.
PhonePePaymentSdk.init(environmentValue, appId, merchantId, enableLogging)
.then((val) => {
setState(() {
result = 'PhonePe SDK Initialized - $val';
})
})
.catchError((error) {
handleError(error);
return <dynamic>{};
});
copied to clipboard
Start the PG Transaction
try {
var response = PhonePePaymentSdk.startTransaction(
body, callback, checksum, packageName);
response
.then((val) => {
setState(() {
result = val;
})
})
.catchError((error) {
handleError(error);
return <dynamic>{};
});
} catch (error) {
handleError(error);
}
copied to clipboard
For more updates, Please check the PhonePe Docs:
https://developer.phonepe.com/v1/docs/flutter-sdk-integration
Demo App Link :
https://github.com/PhonePe/phonepe-pg-sdk-flutter
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.