mind_paystack 0.1.1 copy "mind_paystack: ^0.1.1" to clipboard
mind_paystack: ^0.1.1 copied to clipboard

My new Dart package

Mind Paystack #

style: very good analysis Powered by Mason License: MIT

A Dart-first Paystack SDK focused on transaction management with type-safe operations.

Features ✨ #

  • Transaction Management: Initialize, verify, and list Paystack transactions
  • Type-Safe Money Handling: Built-in Money and Currency value objects
  • Structured Error Handling: Comprehensive MindException system
  • Dependency Injection: Injectable support for testing and modularity
  • Pure Dart: Works with CLI tools, servers, and Dart web applications

Installation πŸ’» #

❗ In order to start using Mind Paystack you must have the Dart SDK installed on your machine.

Install via dart pub add:

dart pub add mind_paystack

Quick Start πŸš€ #

import 'package:mind_paystack/mind_paystack.dart';

Future<void> main() async {
  // Initialize the SDK
  await MindPaystack.initialize(
    PaystackConfig(
      publicKey: 'pk_test_your_public_key',
      secretKey: 'sk_test_your_secret_key',
      environment: Environment.test,
    ),
  );

  // Create a transaction
  final sdk = MindPaystack.instance;
  final transaction = await sdk.transaction.initialize(
    InitializeTransactionOptions(
      email: 'customer@example.com',
      amount: Money.fromCents(50000, Currency.ngn), // ₦500.00
    ),
  );

  print('Payment URL: ${transaction.data.authorizationUrl}');
}

Coming Soon 🚧 #

  • Charge Operations: Direct card charging and authorization
  • Payment Channels: Available payment methods
  • Flutter Integration: UI widgets and platform-specific features

Documentation πŸ“š #

For complete documentation and examples, visit the main repository.


Running Tests πŸ§ͺ #

To run all unit tests:

dart pub global activate coverage 1.2.0
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info