Skip to main content

Overview

HubtelCheckoutConfiguration holds the merchant-specific configuration required to initialize and authenticate the checkout process with Hubtel’s payment gateway.

Constructor

HubtelCheckoutConfiguration({
  required String merchantID,
  required String callbackUrl,
  required String merchantApiKey,
})

Parameters

merchantID
String
required
Your unique merchant identifier provided by Hubtel. This identifies your business in the Hubtel system.
callbackUrl
String
required
The URL where Hubtel will send payment status notifications. This should be a publicly accessible endpoint on your server.
merchantApiKey
String
required
Your merchant API key for authenticating requests to Hubtel’s payment gateway. Keep this secure and never expose it in client-side code.

Properties

merchantID
String
The merchant’s unique identifier in the Hubtel system.
callbackUrl
String
The callback URL for payment status notifications.
merchantApiKey
String
The API key for authenticating merchant requests.

Usage Example

import 'package:hubtel_merchant_checkout_sdk/hubtel_merchant_checkout_sdk.dart';

// Create configuration with your merchant credentials
final configuration = HubtelCheckoutConfiguration(
  merchantID: 'HM12345',
  merchantApiKey: 'sk_live_abc123xyz789',
  callbackUrl: 'https://myapp.com/payment-callback',
);

// Use the configuration in CheckoutScreen
CheckoutScreen(
  purchaseInfo: purchaseInfo,
  configuration: configuration,
);

Security Notes

Never hardcode your merchantApiKey in your application code. Store it securely using environment variables or secure storage mechanisms.
  • Store API keys in secure environment variables or secrets management systems
  • Never commit API keys to version control
  • Use different API keys for development and production environments
  • Rotate API keys periodically for enhanced security

Obtaining Credentials

To get your merchant credentials:
  1. Log in to your Hubtel Merchant Dashboard
  2. Navigate to Settings > API Keys
  3. Copy your merchantID and merchantApiKey
  4. Configure your callbackUrl in the webhook settings

Build docs developers (and LLMs) love