azampaytanzania 0.0.2 copy "azampaytanzania: ^0.0.2" to clipboard
azampaytanzania: ^0.0.2 copied to clipboard

Flutter SDK for AzamPesa Tanzania mobile money integration.

example/example.dart

import 'package:azampaytanzania/azampaytanzania.dart';
import 'package:flutter/material.dart';

/// Example of how to initiate a payment with AzamPesaTanzania SDK.
void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  //The Currency is set to TZS.
  final azamPesa = AzamPayTanzania(
    clientId: 'your_client_id',
    clientSecret: 'your_client_secret',
    apiKey: 'your_api_key',
    appName: 'your_app_name',
    isProduction: false, // Set to true for production environment
  );

  try {
    final response = await azamPesa.collectPayment(
      accountNumber: '2557xxxxxxx',
      amount: '1000',
      externalId: 'TXN123456', // Unique transaction reference from your system
      provider: "Airtel", // Other valid values: Airtel, Tigo, Halopesa, Mpesa
    );

    debugPrint('Payment response: $response');
  } catch (e) {
    debugPrint('Error: $e');
  }
}
2
likes
0
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for AzamPesa Tanzania mobile money integration.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http

More

Packages that depend on azampaytanzania