BuckBox Flutter SDK

BuckBox Flutter SDK helps merchant apps open a secure BuckBox checkout flow for UPI and card payments.

Requirements

To start a BuckBox checkout, provide:

  • Merchant API key.
  • Bearer authorization token.
  • Payment amount.
  • Unique merchant transaction ID.
  • Platform value, such as Android or iOS.
  • Checkout environment, either staging or production.
  • Payer details, including first name, last name, email, and phone number.
  • Success, failure, and processing callback handlers.

Installation

Add the package to your Flutter app and import the public SDK surface:

import 'package:buck_box_sdk/buck_box_sdk.dart';

Usage

final sdk = BuckBoxSDK();

final checkoutStarted = await sdk.initSdk(
  context,
  BuckBoxInitConfig(
    apiKey: '<merchant-api-key>',
    authorization: '<bearer-token>',
    amount: 500,
    merchantTxnId: 'ORD-123',
    platform: BuckBoxPlatform.android,
    environment: BuckBoxEnvironment.production,
    payerDetails: const BuckBoxPayerDetails(
      firstName: 'Rahul',
      lastName: 'Sharma',
      email: 'rahul.sharma@example.com',
      phone: '9876543210',
    ),
    onSuccess: (payload) {
      // Show merchant success UI.
    },
    onFailure: (payload) {
      // Show merchant failure UI.
    },
    onProcessing: (payload) {
      // Show merchant pending/processing UI.
    },
  ),
);

initSdk returns true when checkout opens and false when validation fails or another checkout is already in progress.

Environments

environment: BuckBoxEnvironment.staging

or

environment: BuckBoxEnvironment.production

Production is used by default.

Libraries

buck_box_sdk