Dipjyoti.PocketWallet.Bkash
1.0.4
See the version list below for details.
dotnet add package Dipjyoti.PocketWallet.Bkash --version 1.0.4
NuGet\Install-Package Dipjyoti.PocketWallet.Bkash -Version 1.0.4
<PackageReference Include="Dipjyoti.PocketWallet.Bkash" Version="1.0.4" />
paket add Dipjyoti.PocketWallet.Bkash --version 1.0.4
#r "nuget: Dipjyoti.PocketWallet.Bkash, 1.0.4"
// Install Dipjyoti.PocketWallet.Bkash as a Cake Addin
#addin nuget:?package=Dipjyoti.PocketWallet.Bkash&version=1.0.4
// Install Dipjyoti.PocketWallet.Bkash as a Cake Tool
#tool nuget:?package=Dipjyoti.PocketWallet.Bkash&version=1.0.4
PocketWallet.Bkash Tutorial - Step by Step process.
Basic Information
What is PocketWallet.Bkash?
PocketWallet.Bkash is a library that is built with .NET 6, offering integration with Bkash, a popular Bangladeshi e-wallet system. The application is designed to streamline the payment process for businesses and users by providing seamless support for Bkash transactions.
Features
- Smooth integration process.
- Complete Support for Bkash transactions.
Technologies Used
The library is developed using the following technologies:
- .NET 6
- C# language
- Bkash API
Usage
Add Configuration
Add this appsettings.json configuration block and provide appropriate values. Note: These informations need to be collected found from Bkash support.
"BkashOptions": {
"MerchantUserName": "",
"MerchantPassword": "",
"AppKey": "",
"AppSecret": "",
"ProductionMode": false
}
Dependency Injection
- Create a "BkashOptions" class matching with configuration files "BkashOptions" section.
Version 1.0.0
public class BkashOptions
{
public string MerchantUserName { get; set; }
public string MerchantPassword { get; set; }
public string AppKey { get; set; }
public string AppSecret { get; set; }
public bool ProductionMode { get; set; }
}
Version 1.0.1+
public class BkashOptions
{
public string MerchantUserName { get; set; }
public string MerchantPassword { get; set; }
public string AppKey { get; set; }
public string AppSecret { get; set; }
public bool ProductionMode { get; set; }
public PaymentModes PaymentMode { get; set; }
}
- Add Bkash Dependency
var bkashOptions = new BkashOptions();
builder.Configuration.GetSection("BkashOptions").Bind(bkashOptions);
builder.Services.AddBkash(option =>
{
option.MerchantUserName = bkashOptions.MerchantUserName;
option.MerchantPassword = bkashOptions.MerchantPassword;
option.AppKey = bkashOptions.AppKey;
option.AppSecret = bkashOptions.AppSecret;
option.ProductionMode = bkashOptions.ProductionMode;
});
Payment Process
To Create Payment:
- Add "IBkashPayment" interface in the constructor of any class as follows,
private readonly IBkashPayment _bkashPayment;
public WalletsController(IBkashPayment bkashPayment)
{
_bkashPayment = bkashPayment;
}
- Call the payment method.
Version 1.0.0
var result = await _bkashPayment.CreatePayment(new CreateBkashPayment{});
Version 1.0.1+
var result = await _bkashPayment.Create(new CreatePaymentCommand{});
Please check property summary for better understanding about the responsibility of the property.
Thus, the other methods will work similarly.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- AutoMapper.Extensions.Microsoft.DependencyInjection (>= 12.0.1)
- Swashbuckle.AspNetCore.Newtonsoft (>= 6.2.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.