Kh.Org.Nbc.BakongKHQR 1.0.0.9

Suggested Alternatives

Kh.Gov.Nbc.BakongKHQR

Additional Details

This library has been moved to new namespace.

dotnet add package Kh.Org.Nbc.BakongKHQR --version 1.0.0.9
NuGet\Install-Package Kh.Org.Nbc.BakongKHQR -Version 1.0.0.9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<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
#r "nuget: Kh.Org.Nbc.BakongKHQR, 1.0.0.9"
#r directive can be used in F# Interactive and Polyglot Notebooks. 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

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));
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);
}

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 1,080 1/4/2022