https://github.com/juspay/flutter_hyperswitch.git
Flutter Hyperswitch is a package designed to facilitate payment operations within Flutter applications, providing seamless integration with payment gateways and offering a variety of customization options.
To use this package in your Flutter project, follow these steps:
Add flutter_hyperswitch to your pubspec.yaml file:
yamldependencies: flutterhyperswitch: ^versionnumber
Then, run:
dartflutter pub get
Import the Package
dartimport 'package:flutterhyperswitch/flutterhyperswitch.dart';final _hyper = FlutterHyperswitch();
Initialize the payment sheet with required parameters:
dart//Set up HyperConfig parameters hyper.init(HyperConfig(publishableKey: 'yourpublishable_key'));// Set up the payment parameters PaymentSheetParams params = PaymentSheetParams( clientSecret: 'yourclientsecret', // Add other required parameters );
// Initialize the payment sheet Map<String, dynamic>? result = await _hyper.initPaymentSession(params);
Present the payment sheet within your app:
dartMap<String, dynamic>? result = await _hyper.presentPaymentSheet();
You'll need to configure your backend and obtain necessary keys/secrets for successful payment processing. Please refer to our documentation Node SDK Reference for detailed setup instructions.
In the example project, you can also create a simple mock server using the following commands:
bashcd server npm i npm start
For detailed usage instructions, examples, and API reference, visit the documentation.
If you encounter any issues or would like to contribute, feel free to reach out us here.