Dipjyoti.PocketWallet.Bkash 1.0.4

There is a newer version of this package available.
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
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="Dipjyoti.PocketWallet.Bkash" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dipjyoti.PocketWallet.Bkash --version 1.0.4
#r "nuget: Dipjyoti.PocketWallet.Bkash, 1.0.4"
#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 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

  1. 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; }
}
  1. 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 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. 
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.1.1 147 8/25/2023
1.1.0 112 8/24/2023
1.0.4 152 8/5/2023