paystack_payment 0.0.3 copy "paystack_payment: ^0.0.3" to clipboard
paystack_payment: ^0.0.3 copied to clipboard

A Flutter package for integrating Paystack payments with support for channels, metadata, and split payments.

Paystack Payment for Flutter #

A Flutter package to integrate Paystack payments into your app with support for multiple payment channels, custom metadata, and split payments. This package uses Paystack’s Checkout API to provide a seamless payment experience via a WebView.

Features #

  • Simple Payment Integration: Initialize and process payments with minimal setup.
  • Payment Channels: Restrict payments to specific channels (e.g., card, bank, ussd).
  • Custom Metadata: Attach additional data to transactions (e.g., order IDs).
  • Split Payments: Split transaction amounts between your account and subaccounts.
  • Consistent Responses: Handle success, error.ConcurrentModificationException, and cancel outcomes with a unified PaystackResponse model.
  • WebView-Based Checkout: Displays Paystack’s payment UI securely within your app.

Installation #

Add to Your Project #

Add to pubspec.yaml: #

paystack_payment: ^0.0.1

Run flutter pub get

Import in Dart File: #

import 'package:paystack_payment/paystack_payment.dart';

Example Usage #

    final paystack = PaystackPayment(secretKey: 'sk_test_key');
    paystack.pay(
              context: context,
              email: 'user@example.com',
              amount: 1000.00,
              currency: 'NGN',
              onSuccess: (response) {
                ScaffoldMessenger.of(context).showSnackBar(
                  SnackBar(
                    content: Text(
                      'Success: ${response.code} - ${response.message} (Ref: ${response.reference})',
                    ),
                  ),
                );
              },
              onError: (response) {
                ScaffoldMessenger.of(context).showSnackBar(
                  SnackBar(content: Text('Error: ${response.message}')),
                );
              },
              onCancel: (response) {
                ScaffoldMessenger.of(context).showSnackBar(
                  SnackBar(content: Text('Cancelled: ${response.message}')),
                );
              },
            );
4
likes
0
points
49
downloads

Publisher

verified publisherbolxtine.com

Weekly Downloads

A Flutter package for integrating Paystack payments with support for channels, metadata, and split payments.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, webview_flutter

More

Packages that depend on paystack_payment