paylink_payment 1.0.3 paylink_payment: ^1.0.3 copied to clipboard
A Flutter Package designed to simplify the integration of Paylink's payment gateway into Flutter applications. It provides a streamlined way to handle payments within your app.
Paylink Payment Package #
Overview #
paylink_payment
is a Flutter Package designed to simplify the integration of Paylink's payment gateway into Flutter applications. It provides a streamlined way to handle payments within your Flutter app.
Features #
- Easy integration with Paylink payment gateway.
- Simplified payment process with minimal code.
- Secure handling of payment transactions.
Usage #
To integrate Paylink's payment gateway into your Flutter application using the paylink_payment
package, follow these steps:
-
Install the Package:
Add
paylink_payment
to yourpubspec.yaml
file under dependencies:dependencies: paylink_payment: ^1.0.3 # Use the latest version
-
Import the Package:
Import the
paylink_payment
package in your Dart file:import 'package:paylink_payment/paylink_payment.dart';
-
Open Payment Form:
Use the
PaylinkPayment
class to open the payment form when a button or action is triggered. Here's an example of how to do this:void openPayment(BuildContext context) { PaylinkPayment( context: context, isTestMode: true, apiId: null, // required for production environment secretKey: null, // required for production environment webViewTitle: 'Payment Screen', // optional textColor: Colors.white, // optional themeColor: Colors.blue, // optional ).openPaymentForm( transactionNo: '1713690519134', onPaymentComplete: (Map<String, dynamic> orderDetails) { /// Handle payment completion }, onError: (Object error) { /// Handle payment error }, ); }
Replace the placeholders (
apiId
,secretKey
, etc.) with actual values required for the production environment. -
Handle Payment Completion and Errors:
Implement the
onPaymentComplete
andonError
callbacks to handle the payment completion and any errors that occur during the payment process.onPaymentComplete: (Map<String, dynamic> orderDetails) { /// Handle payment completion }, onError: (Object error) { /// Handle payment error },
Customize these callbacks based on your app's requirements.
By following these steps, you can easily integrate Paylink's payment gateway into your Flutter application using the paylink_payment
package.