Flutter SDK

Critères #

Si vous ne savez pas comment obtenir vos informations d’identification API dans le tableau de bord, veuillez consulter le site suivant Obtenir votre clé API la documentation.

Pour commencer à utiliser ce SDK, assurez-vous d’avoir une application Flutter prête. Assurez-vous également de vous abonneraux différents fournisseurs de paiement que vous voulez

Installation #

dependencies:
pay_unit_sdk: ^2.0.18

Mettez a jour tous vos dependences en utilisant :

flutter pub get

Utilisation du SDK #

Importez PayUnit dans le widget requis

import 'package:pay_unit_sdk/payunitpackage.dart';

Utilisez le bouton de paiement comme un widget.

PayUnitButton(
              apiUser:"<Your apiuser>",
              apiPassword:  "<Your apiPassword>",
              apiKey: "<Your apiKey>",
              transactionId: "<The id of your transaction and should be less less than 20 character>",
              mode: 'sandbox' // sandbox or live,
              transactionCallBackUrl:"<Your transactionCallBackUrl url>",
              notiFyUrl: "<Your notification url>",
              transactionAmount:  "<Your transaction amount>",
              currency:"XAF", //// The currency of your transaction : XAF for FCFA or USD for $ ect ...
              buttonTextColor:  "<Custom the color of the text PayUnit button>",
              productName:"<The name of the product>",
              color: "<Custom the color of PayUnit button>",///the colors Button text DEFAULT WHITE,
              actionAfterProccess: (transactionId, transactionStatus) {
               //here is the action who start after the end of the paiement , you can perform 	
               //some operation here , like display a alertDialog after the end of the payment.
              },
            ),

Ensuite, dans votre vue, un bouton PayUnit apparaîtra. Lorsqu’on clique dessus, le paiement est effectué.

Demo #

Regardez la vidéo de démonstration ici https://youtu.be/QrcgV2g8LzE

#

Updated on 9 September 2021