phonepe_payment_sdk 2.0.1 copy "phonepe_payment_sdk: ^2.0.1" to clipboard
phonepe_payment_sdk: ^2.0.1 copied to clipboard

A flutter Plugin for PhonePe Payment SDK

Flutter PhonePe Payment SDK #

Use this Plugin as a library #

  1. Add the dependency in flutter project from the command line

     flutter pub add phonepe_payment_sdk
    
  2. Install the dependency from the command line

     flutter pub get
    
  3. Import the package in your dart code :

     import 'package:phonepe_payment_sdk/phonepe_payment_sdk.dart';
    

Start Transaction #

  1. 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>{};
         });
    
  2. 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);
         }
    
For more updates, Please check the PhonePe Docs:

https://developer.phonepe.com/v1/docs/flutter-sdk-integration

https://github.com/PhonePe/phonepe-pg-sdk-flutter

19
likes
130
pub points
97%
popularity

Publisher

verified publisherphonepe.com

A flutter Plugin for PhonePe Payment SDK

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on phonepe_payment_sdk