payaza 0.0.1 payaza: ^0.0.1 copied to clipboard
Payaza’s SDK makes it easy for you to start accepting payments from your customers when they visit your applications.
FLutter SDK #
Payaza’s SDK makes it easy for you to start accepting payments from your customers when they visit your applications. The checkout SDK can be integrated in very easy steps, making it the easiest way to start accepting payments.
Getting started #
To start collecting payment with Payaza install payaza
widget by adding as a in pubspec.yaml
dependency
dependencies:
payaza: ^0.0.1
Usage #
Initialize SDK anywhere before use
//...
Payaza.init('<public key>');
runApp(const MyApp());
//...
// ...
import 'package:payaza/payaza.dart';
// ...
void handleSuccess(PayazaSuccessResponse response) async {
await showAlert(
message: response.data.payazaReference ?? '',
title: 'Payment Successful');
if (context.mounted) {
Navigator.of(context).pop();
}
}
void handleError(PayazaErrorResponse response) async {
await showAlert(message: response.data.message, title: 'Error');
if (context.mounted) {
Navigator.of(context).pop();
}
}
void handleClose() {
print('Payaza widget was closed');
}
void onSubmit() {
Payaza.createTransaction(
context,
config: PayazaConfig(
amount: 110,
connectionMode: PayazaConnectionMode.LIVE_CONNECTION_MODE,
email: "example@example.com",
firstName: "<first name>",
lastName: "<last name>",
phoneNumber: "<+12345678900>",
transactionReference: "transaction_reference",
),
onSuccess: handleSuccess,
onError: handleError,
onClose: handleClose,
);
}