Flutter

Digitalpaye Flutter SDK

SDK Description

The Digitalpaye Flutter SDK allows developers to easily integrate payments via Digitalpaye into their Flutter applications. It provides a simple interface to configure and initiate payment transactions.

Installation

To install the SDK, use the following command:

flutter pub add digitalpaye_sdk_flutter

Alternatively, you can download the SDK directly from Pub.dev: Download herearrow-up-right

Getting started

Configuration

Before using the SDK, configure it with your API information. You must provide an API key, an API secret, and other configuration parameters.

final config = DigitalpayeConfig(
  apiKey: 'live_digitalpaye931',
  apiSecret: 'f511e4f4-d932-928cd-a804-51539700d60c',
  isSandbox: false,
  color: AppColors.orange,
);

// DigitalpayeConfig constructor
DigitalpayeConfig({required String apiKey, required String apiSecret, required bool isSandbox, Color ? color, String ?logo});
  • apiKey : Your API key

  • apiSecret : Your API secret

  • isSandbox : Boolean indicating whether the environment is in sandbox mode

  • color : Primary color of the application

  • logo : The application's logo

Payment configuration

Set the parameters for your payment transaction.

  • codeCountry : Country code

  • amount : Transaction amount

  • transactionId : Transaction ID

  • designation : Transaction description

  • currency : Transaction currency

  • emailUser : User's email

  • nameUser : User's name

  • customerId : Customer ID

  • urlError : URL in case of error

  • urlSuccess : URL in case of success

Payment callback

  • config : DigitalpayeConfig

  • payment: DigitalpayePaymentConfig

  • errorBuilder : is a function that returns a Widget to display in case of an error.

  • successBuilder : is a function that returns a Widget to display in case of a successful transaction.

  • pendingBuilder : is a function that returns a Widget to display in case of a pending transaction.

Usage example

Here is a complete example of using the SDK in a Flutter application.

Last updated