buzapay_sdk library
Buzapay Flutter SDK
A Flutter SDK for integrating Buzapay Payment Gateway. Supports Card, Bank Transfer, and Stablecoins (USDT/USDC).
Quick Start
import 'package:buzapay_sdk/buzapay_sdk.dart';
void main() {
Buzapay.initialize(
config: BuzapayConfig(
merchantId: 'YOUR_MERCHANT_ID',
environment: BuzapayEnvironment.sandbox,
),
);
runApp(MyApp());
}
Accept Payments
final result = await Buzapay.instance.checkout(
context: context,
amount: 5000,
currency: 'NGN',
email: 'customer@example.com',
phoneNumber: '08012345678',
redirectUrl: 'https://myapp.com/callback',
onComplete: (reference) {
// Always verify the transaction server-side
print('Checkout done. Reference: $reference');
},
);
Classes
- Buzapay
- Main entry point for the Buzapay SDK
- BuzapayCheckoutButton
- A pre-built checkout button that handles the entire payment flow
- BuzapayConfig
- Configuration for the Buzapay SDK
- BuzapayEndpoints
- API endpoint paths
- BuzapayUrls
- Base URLs for different environments
- BuzapayWebView
- WebView widget for displaying Buzapay checkout
- PaymentLinkRequest
- Request model for generating a payment link
- PaymentLinkResponse
- Response model from payment link generation
- ReferenceGenerator
- Generates unique references for API requests
Enums
- BuzapayEnvironment
- SDK environment
- PaymentResult
- Result of the checkout flow
Exceptions / Errors
- BuzapayAuthException
- Authentication-related errors (invalid credentials, expired token)
- BuzapayConfigException
- SDK configuration errors
- BuzapayException
- Base exception for all Buzapay errors
- BuzapayNetworkException
- Network-related errors (timeout, no connection)
- BuzapayPaymentException
- Payment processing errors
- BuzapayValidationException
- Validation errors (invalid input, missing required fields)