0 purchases
unofficial mazzuma plugin
unofficial_mazzuma_plugin #
This is an unofficial implementation of Mazzuma's payment Api in flutter
Getting Started #
Installation #
Add this to your pubspec.yaml (or create it):
dependencies:
unofficial_mazzuma_plugin: x.x.x #latest version
copied to clipboard
Then run the flutter tooling:
flutter packages get
copied to clipboard
Or upgrade the packages with:
flutter packages upgrade
copied to clipboard
import library
import 'package:unofficial_mazzuma_plugin/unofficial_mazzuma_plugin.dart';
copied to clipboard
Example #
UnofficialMazzumaPlugin mazzumaPlugin = new UnofficialMazzumaPlugin();
void makePayment() {
int price = 5000; //GHS 1.00 = 100peswes
String network = "mtn";
String recipientNumber = "vodafone";
String recipientNetwork = '233503169330';
String sender = "233245436757";
String apiKey = "XXXXXXXXXXXXXXXXXXXXXX";
/** This denotes the direction of cash flow. For example, rmta can be understood as an acronym of the phrase
‘receive mtn to airtel’, which means you would be receiving money to your Airtel account (the recipient number)
from an MTN number(the sender). This format would hold for all transaction requests sent to the API.
Do not forget to append the r at beginning. **/
if (userNetwork == "AIRTELTIGO") {
paymentOption = "ratm";
} else if (userNetwork == "MTN") {
paymentOption = "rmtm";
} else {
paymentOption = "unknown";
}
final response = mazzumaPlugin.processPayment(
price: price,
network: network,
recipientNumber: recipientNumber,
sender: sender,
option: paymentOption,
apiKey: apiKey,
recipientNetwork: recipientNetwork);
print(response.toMap());
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.