DGePay flutter package

This is the official DGePay flutter package for merchants to integrate our payment system with their Flutter applications.

DGePay flutter package makes the payment system easier for you with just two method calls:

  • makePayment()
  • checkStatus()

And that's all! To know more about its usage please check the details below.

Adding a package dependency to an app

  1. Open the pubspec.yaml file located inside the app folder and add DGePay: ^1.0.0 under dependencies.
  2. Run command flutter pub get to pull and download dependencies.

Usage

  • First, you must create object of DGePayConfigs before using any function and passing the environment type and merchant credentials as a parameter.

    Example:

      
    DGePayConfigs dGePayConfigs = DGePayConfigs(
        env: DGePayEnvironmentType.UAT, // Testing Enviornment
        clientID: 'b20699df06a7456fbd251d0b98530dd4', // Test Client ID
        clientSecretKey: '98c055a82a0efe19',  // Test Client Secret Key
        clientAPIKey: '6bed50b19c1340f4b61ed376b22ec243' // Test Client API Key
    );
    
  • After that, you can start using our package the way you want based on your application. Here we are providing a basic example code snip for you.

    Example

    //Create a DGePay object.
     DGePay dGePay = DGePay();
    
    //Create payment request model and initialize values.
    DGePayPaymentReqModel paymentReqMode = DGePayPaymentReqModel(
    amount: 10.00,
    customerToken: null,
    note: 'Note', // Payment Description
    uniqueTxnId: generateHexId(32),
    dialCode: '+88',
    phoneNumber: 01721111111,  // 11 Digits
    dGePayConfigs: dGePayConfigs);
      
    //Create a payment response model object to store the makePayment() method results.
     DGePayPaymentRespModel paymentRespModel = DGePayPaymentRespModel();
       
    //Calling makePayment() method to initiate payment process.
    paymentRespModel = await dGePay.makePayment(
    context: context,
    dGePayConfigs: dGePayConfigs,
    dGePayPaymentReqModel: paymentReqMode);
      
    //Check the response.
    if (paymentRespModel.status == true) {
    print(paymentRespModel.status);
    print(paymentRespModel.message);
    print(paymentRespModel.dGePayOrderId);
    }
    

That's all! Now you are ready to use our DGePay flutter package to make your payment system easy and smooth.

License

This code is under the MIT open source License.

Please contact with DGePay team for more detail.

Copyright ©️2025 DGePay Services Limited.