mind_paystack 0.1.1
mind_paystack: ^0.1.1 copied to clipboard
My new Dart package
Mind Paystack #
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