kaleplussdk 0.4.1 copy "kaleplussdk: ^0.4.1" to clipboard
kaleplussdk: ^0.4.1 copied to clipboard

outdated

Kaleplus App Integration SDK.

This package provides the sdk that integrates with the KalePlus loyalty app. KalePlus app SDK allow POS provide to integrate the KalePlus App gift card and pay functionality. This works across multiple restaurant locations.

Features #

Allow POS to integrate with the KalePlus pay and gift card functionality.

Getting started #

Import the package and start using based on the usage code.

Usage #

Lets take a look at how to use KalePlus sdk.

KaleplusApi.dart #

  KaleplusApi().initialize(
    "chowbus",
    "chowbus-secret",
    "partnerLocationId",
    "exampleKey",
    Locale("en", null),
    KaleplusEnv.dev
  );

kaleplus-gf-page.dart #

  await Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => KaleplusGfPage(
        staffName: "kyuramen",
        desiredColor: Colors.red,
        onGiftcardPurcahseResult: (GiftcardPurchaseResult am) {
          if(am.status == GeneralStatus.success) {
            am.purchasedItems?.forEach((element1) {
              print("Detail ${element1.type.name} ${element1.tranId} ${element1.cardNo}  ${element1.purchaseAmt}  ${element1.cardAmt}");
            });
          } else {
              if(am.partnerTranId.isNotEmpty) {
                print("Refund the Chowbus credit card charges now ${am.partnerTranId}");

                showDialog(
                    context: context,
                    builder: (context) => AlertDialog(
                    content: Text("${KaleplusTranslations().text("failGift")}"),
                ));
              }
          }
          Navigator.pop(context);
  },
  onGiftcardCharge: (chargeAmt, lastFewCardNo) async {
      print("Charge the credit card here ${chargeAmt}  ${lastFewCardNo}");
      return ChargeAmtCallbackResult(GeneralStatus.success, "chowbusTranId");
  })));

kaleplus-pay-page.dart #

  DebitResponse? debitResp = await Navigator.push(
    context,
    MaterialPageRoute(
    builder: (context) => KaleplusPayPage(
    debitRequest, desiredColor: Colors.red)
    ),
  );

  if(debitResp != null) {
    var msg = "";

    if(debitResp.status == DebitStatus.fullyPaid) {
      msg = "fully paid ${debitResp.tranId} ${debitResp.amtDebited} ${debitResp.tip} ${debitResp.remainingBalance} ${debitResp.last4}";
    } else if(debitResp.status == DebitStatus.partiallyPaid) {
      msg = "partial paid ${debitResp.tranId} ${debitResp.amtDebited} ${debitResp.tip} ${debitResp.remainingBalance}";
    } else {
      msg = "fail";
    }
    showDialog(
      context: context,
      builder: (BuildContext context) {
          return AlertDialog(
        title: Text("result show here"),
        content: Text("${msg}"),
        actions: [
        MaterialButton(
          child: Text("OK"),
            onPressed: () {
              Navigator.of(context).pop();
            },
        ),
        ],
      );
      },
    );
  }

Additional information #

You can integrate with our loyalty app and find more information at https://kaleplus.com

0
likes
0
points
415
downloads

Publisher

unverified uploader

Weekly Downloads

Kaleplus App Integration SDK.

Homepage

License

unknown (license)

Dependencies

barcode_scan2, encrypt, flutter, http, path_provider, qr_flutter

More

Packages that depend on kaleplussdk