seerbit_flutter 0.0.7 copy "seerbit_flutter: ^0.0.7" to clipboard
seerbit_flutter: ^0.0.7 copied to clipboard

Seerbit Flutter SDK can be used to integrate the SeerBit payment gateway into your flutter application..

example/lib/main.dart

import 'dart:async';
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:seerbit_flutter/new/customization.dart';
import 'package:seerbit_flutter/new/methods.dart';
import 'package:seerbit_flutter/new/payload.dart';
import 'package:seerbit_flutter/new/split.dart';

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(MaterialApp(home: SeerbitTest()));
}

class SeerbitTest extends StatelessWidget {
  SeerbitTest({Key? key}) : super(key: key);
  SeerbitMethod SeerBit = new SeerbitMethod();

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      height: 1000,
      width: 500,
      child: Center(
        child: TextButton(
          onPressed: () => paymentStart(context),
          child: Text(
            "Checkout",
            style: TextStyle(color: Colors.red),
          ),
        ),
      ),
    );
  }

  paymentStart(context) {
    PayloadModel payload = PayloadModel(
        currency: 'NGN',
        email: "hellxo@gmxail.com",
        description: "Sneakers",
        fullName: "General ZxXXod",
        country: "NG",
        amount: "102",
        transRef: DateTime.now().millisecondsSinceEpoch.toString(),
        publicKey: "SBPUBK_V1YL57ICZQSNCADEWE5XEVTNB72TLWZA",
        pocketRef: "",
        vendorId: "",
        setAmountByCustomer: false,
        tokenize: false,
        planId: "",
        //  splits: SplitModel(
        //   type: "FLAT", //FLAT, PERCENTAGE
        //   transactionFee: "SUB_ACCOUNT", //  ALL_ACCOUNTS, PROPORTIONATE, SUB_ACCOUNT, PARENT_ACCOUNT
        //   bearerSubAccountCode: "SUBACCT001",
        //   items: [
        //     FeeItem(subAccountCode: "SUBACCT001", value: "3.01"),
        //     FeeItem(subAccountCode: "ops-costs-2sD4kA", value: "2.00")
        //   ]
        // ),
        customization: const CustomizationModel(
          borderColor: "#000000",
          backgroundColor: "#004C64",
          buttonColor: "#0084A0",
          paymentMethod: [
            PayChannel.account,
            PayChannel.transfer,
            PayChannel.card,
            PayChannel.momo
          ],
          confetti: false,
          logo: "logo_url || base64",
        ));
    SeerBit.startPayment(context, payload: payload, onSuccess: (_) {
      print(_);
      Future.delayed(const Duration(milliseconds: 3000), () {
        SeerbitMethod.endPayment(context);
      });
    }, onCancel: (_) {
      print('*' * 400);
    });
  }
}
5
likes
130
points
49
downloads

Documentation

API reference

Publisher

verified publisherseerbit.com

Weekly Downloads

Seerbit Flutter SDK can be used to integrate the SeerBit payment gateway into your flutter application..

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_inappwebview, provider, url_launcher

More

Packages that depend on seerbit_flutter