Kh.Gov.Nbc.BakongKHQR
1.0.0.13
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.0
This package targets .NET Framework 4.0. The package is compatible with this framework or higher.
dotnet add package Kh.Gov.Nbc.BakongKHQR --version 1.0.0.13
NuGet\Install-Package Kh.Gov.Nbc.BakongKHQR -Version 1.0.0.13
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.Gov.Nbc.BakongKHQR" Version="1.0.0.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kh.Gov.Nbc.BakongKHQR --version 1.0.0.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Kh.Gov.Nbc.BakongKHQR, 1.0.0.13"
#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.Gov.Nbc.BakongKHQR as a Cake Addin #addin nuget:?package=Kh.Gov.Nbc.BakongKHQR&version=1.0.0.13 // Install Kh.Gov.Nbc.BakongKHQR as a Cake Tool #tool nuget:?package=Kh.Gov.Nbc.BakongKHQR&version=1.0.0.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nuget Library
<br />
Installation
- Using Visual Studio Package Manager
Install-Package Kh.Gov.Nbc.BakongKHQR
- Using Dotnet Cli
dotnet add package Kh.Gov.Nbc.BakongKHQR
- Include in csproj
<ItemGroup>
<PackageReference Include="Kh.Gov.Nbc.BakongKHQR" Version="1.0.0.10" />
</ItemGroup>
Platform Support
- NetStandard 2.0
- .Net Framework 4.0 and later
- .NET Core 2.0 and later
- Xamarin.iOS
- Xamarin.Android
Build Project
- Open Solution Directory
- Run Dotnet Cli build command
dotnet restore
dotnet build
- 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);
}
Product | Versions 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.
-
.NETFramework 4.0
- Newtonsoft.Json (>= 13.0.2)
-
.NETFramework 4.5
- Newtonsoft.Json (>= 13.0.2)
-
.NETFramework 4.6
- Newtonsoft.Json (>= 13.0.2)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.