azampay

Creator: coderz1093

Last updated:

0 purchases

azampay Image
azampay Images

Languages

Categories

Add to Cart

Description:

azampay

AzamPay #

This is a Dart-Flutter SDK that helps users integrate AzamPay in their projects. You can view AzamPay documentation here
Use Case #
SDK SetUp

Import azampay in your.dart file

import 'package:azampay/azampay.dart';
copied to clipboard

Initiate your Credentials

// get these credentials from the azampay developers account
var azampay = AzamPay(
sandbox: true, // set to false on production
appName: "<app-name>",
clientId: "<client-id>",
clientSecret:"<client-secret>"
);
copied to clipboard
CHECKOUTS
MOBILE PUSH CHECKOUT #
void main() async {

var mobileResponse = await azampay.mobileCheckout(
merchantMobileNumber: "<merchant-mobile-number>",
amount: "<amount>",
currency: "<currency>", // ["TZS"]
provider: "<provider>", // ["Airtel" "Tigo" "Halopesa" "Azampesa"]
externalId: "<external-id>",
additionalProperties: {}
);

print(json.decode(mobileResponse.body));

// successful mobile checkout response (you can now see a push USSD on your phone)
chekout_response: {
success: true, transactionId: e06a98b0267a4196913e4c5b4c8b69e3,
message: Your request has been received and is being processed.
}
}

copied to clipboard
BANK CHECKOUT #

var bankResponse = await azampay.bankCheckout(
merchantAccountNumber: "<merchant-account-number>",
merchantName:"<merchant-name>",
merchantMobileNumber: "<merchant-mobile-number>",
amount: "<amount>",
currency: "<currency>", // ["TZS"]
provider: "<bank>", // ["NMB","CRDB"]
otp: "<otp>",
referenceId: '<external-id>',
additionalProperties: {
});

// status code
print(bankResponse.statusCode);

// body
print(json.decode(bankResponse.body));


// MOBILE CHECKOUT WEBHOOK RESPONSE ON SANDBOX MODE
webhookResponse: {'message': 'This is emulated Message', 'user': None,
'password': None, 'clientId': None, 'transactionstatus': 'success',
'operator': '<provider>', 'reference': '<uuid>', 'externalreference': '<uuid>',
'utilityref': 'Gr5HI85KbbR790', 'amount': '<amount>', 'transid': '<uuid>', 'msisdn': '255xxxxx', 'submerchantAcc': None, 'additionalProperties': {}
}
}
copied to clipboard
Credits and Inspiration #

Thanks much to AzamPay for this wonderful payment system
Tanzanian Devs using AzamPay

Issues #
Please open an issue here GITHUB

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.