SDK
Flutter

Requirements  (opens in a new tab)

If you don't know how to get your API credentials in the Dashboard, please consult Getting your API Key(opens in a new tab) (opens in a new tab) documentation.

To Get Started with this SDK, Make sure you have a Flutter application ready. Also make sure you have subscribed to the various payment providers you want.

Dependencies. See the current version on pub(opens in a new tab) (opens in a new tab)

flutter_payunit: ^0.0.4

Get package using:

terminal

flutter pub get flutter_payunit

Using the SDK (opens in a new tab)

Import PayUnit in the required widget

import 'package:flutter_payunit/flutter_payunit.dart';

Use the pay button as a widget.

PayUnitButton(

	apiUsername: "<Your apiuser>",

	apiPassword: "<Your apiPassword>",

	apiKey: "<Your apiKey>",

	mode: 'live', // live or test

	paymentCountry: '<Transaction country>'

	notifyUrl: "<Your notification url>",

	returnUrl: "<Your return url>",

	totalAmount: "<Your transaction amount>",

	currency:"XAF",

	buttonTextColor: Colors.white,

	buttonText: "Pay now",

	width: double.infinity

	color: Colors.orange

	actionAfterProccess: (transactionId, transactionStatus) {

	 // a callback that has both transaction id and transaction status

	},

), 

Then in your app a PayUnit button will appear. When clicked, performs the actual payment. Note, the transactionId is automatically generated. You can access it in the actionAfterProcess callback of the PayUnitButton.

Demo (opens in a new tab)

Watch demo video here https://youtu.be/QrcgV2g8LzE (opens in a new tab)

Last updated on November 18, 2024