Kh.Org.Nbc.BakongKHQR 1.0.0.9

Install-Package Kh.Org.Nbc.BakongKHQR -Version 1.0.0.9
dotnet add package Kh.Org.Nbc.BakongKHQR --version 1.0.0.9
<PackageReference Include="Kh.Org.Nbc.BakongKHQR" Version="1.0.0.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kh.Org.Nbc.BakongKHQR --version 1.0.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Kh.Org.Nbc.BakongKHQR, 1.0.0.9"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Kh.Org.Nbc.BakongKHQR as a Cake Addin
#addin nuget:?package=Kh.Org.Nbc.BakongKHQR&version=1.0.0.9

// Install Kh.Org.Nbc.BakongKHQR as a Cake Tool
#tool nuget:?package=Kh.Org.Nbc.BakongKHQR&version=1.0.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Nuget Library

Kh.Org.Nbc.BakongKHQR

Installation

  • Using Visual Studio Package Manager
Install-Package Kh.Org.Nbc.BakongKHQR
  • Using Dotnet Cli
dotnet add package Kh.Org.Nbc.BakongKHQR
  • Include in csproj
<ItemGroup>
    <PackageReference Include="Kh.Org.Nbc.BakongKHQR" Version="1.0.0.9" />
    
</ItemGroup>

Platform Support

  • NetStandard 2.0
  • .Net Framework 4.0 and later
  • .NET Core 2.0 and later
  • Xamarin.iOS
  • Xamarin.Android

Build Project

  1. Open Solution Directory
  2. Run Dotnet Cli build command
dotnet restore
dotnet build
  1. Running Test
dotnet test

Code Snippet

Generate KHQR for Individual

var response = BakongKHQR.GenerateIndividual(
    new IndividualInfo {
        BakongAccountID = "john_smith@devb",
        Currency = KHQRCurrency.USD,
        Amount = 100,
        MerchantName = "John Smith",
        MerchantCity = "PHNOM PENH",
        BillNumber = "#12345",
        MobileNumber = "85512233455",
        StoreLabel = "Coffee Shop",
        TerminalLabel = "Cashier_1",
    }
);
if (response.Status.Code == 0)
{
    Console.WriteLine("data: " + response.Data.QR);
    Console.WriteLine("md5: " + response.Data.MD5);
}

Generate KHQR for Merchant

var response = BakongKHQR.GenerateMerchant(
    new MerchantInfo
    {
        BakongAccountID = "john_smith@devb",
        MerchantID = "123456",
        AcquiringBank = "Dev Bank",
        Currency = KHQRCurrency.USD,
        Amount = 100,
        MerchantName = "John Smith",
        MerchantCity = "PHNOM PENH",
        BillNumber = "#12345",
        MobileNumber = "85512233455",
        StoreLabel = "Coffee Shop",
        TerminalLabel = "Cashier_1",
    }
);
if (response.Status.Code == 0)
{
    Console.WriteLine("data: " + response.Data.QR);
    Console.WriteLine("md5: " + response.Data.MD5);
}

Verify KHQR

var response = BakongKHQR.Verify("00020101021229190015john_smith@devb5204599953038405405100.05802KH5910John Smith6010PHNOM PENH62530106#123450211855122334550311Coffee Shop0709Cashier_199170013162622395476963047FDE");
if (response.Status.Code == 0)
{
    Console.WriteLine("valid: " + response.Data.Valid);
}

Decode KHQR

var response = BakongKHQR.Decode("00020101021230410015john_smith@devb01061234560208Dev Bank5204599953038405405100.05802KH5910John Smith6010PHNOM PENH62530106#123450211855122334550311Coffee Shop0709Cashier_19917001316262238109926304FB8B");
var options = new JsonSerializerOptions()
{
    WriteIndented = true
};
Console.WriteLine(JsonSerializer.Serialize(response, options));

Generate Deep Link

var url = "http://api.example.com/v1/generate_deeplink_by_qr";
var qr = "00020101021229180014jonhsmith@nbcq52045999530384054031.05802KH5910Jonh Smith6010Phnom Penh6304C297";
var sourceInfo = new SourceInfo {
    AppName = "Example App",
    AppIconUrl = "http://cdn.example.com/icons.logo.png",
    AppDeepLinkCallback = "http://app.example.com"
};
var response = BakongKHQR.GenerateDeepLink(url, qr, sourceInfo);
if (response.Status.Code == 0) {
    Console.WriteLine(response.Data.ShortLink);
} else {
    Console.WriteLine(response.Status.Message);
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.9 35 1/4/2022
1.0.0.8 84 11/23/2021
1.0.0.7 237 9/10/2021
1.0.0.6 258 7/20/2021
1.0.0.5 114 5/11/2021
1.0.0.4 210 3/17/2021
1.0.0.3 99 2/18/2021
1.0.0.2 124 2/9/2021
1.0.0.1 143 1/25/2021