phonepe_payment_sdk 3.0.0
phonepe_payment_sdk: ^3.0.0 copied to clipboard
A flutter Plugin for 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
-
Install the dependency from the command line
flutter pub get
-
Import the package in your dart code :
import 'package:phonepe_payment_sdk/phonepe_payment_sdk.dart';
Start Transaction #
-
Initialise the init method before starting the transaction.
PhonePePaymentSdk.init(environmentValue, merchantId, flowId, enableLogs) .then((val) => { setState(() { result = 'PhonePe SDK Initialized - $val'; }) }) .catchError((error) { handleError(error); return <dynamic>{}; });
-
Start the PG Transaction
try { var response = PhonePePaymentSdk.startTransaction( request, appSchema); response .then((val) => { setState(() { result = val; }) }) .catchError((error) { handleError(error); return <dynamic>{}; }); } catch (error) { handleError(error); }