esewa_maui 1.0.3

dotnet add package esewa_maui --version 1.0.3
                    
NuGet\Install-Package esewa_maui -Version 1.0.3
                    
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="esewa_maui" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="esewa_maui" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="esewa_maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add esewa_maui --version 1.0.3
                    
#r "nuget: esewa_maui, 1.0.3"
                    
#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.
#:package esewa_maui@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=esewa_maui&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=esewa_maui&version=1.0.3
                    
Install as a Cake Tool

esewa_maui

Accept eSewa payments in your .NET MAUI app with a single, async call. esewa_maui wraps the official native eSewa SDKs on Android and iOS and exposes one cross-platform C# API.

var result = await EsewaPayment.Current.PayAsync(new EsewaPaymentRequest
{
    ClientId    = "<your-merchant-client-id>",
    SecretKey   = "<your-merchant-secret>",
    Amount      = "100",
    ProductName = "Premium Subscription",
    ProductId   = "TXN-1001",
    CallbackUrl = "https://your-merchant.com/callback",
    Environment = EsewaEnvironment.Production,
});

if (result.IsSuccess)
    await DisplayAlert("Success", result.Message, "OK");

Requirements

Framework .NET MAUI (.NET 10+)
Android API 24 (Android 7.0) or higher
iOS 13.0 or higher

Installation

dotnet add package esewa_maui

Or via the Package Manager:

Install-Package esewa_maui

That's it — the native SDKs and their dependencies are included in the package. No manifest edits, no Info.plist changes, no extra native setup required.

Android: make sure your app's minimum SDK is 24 or higher (<SupportedOSPlatformVersion> for the -android target). The eSewa SDK's UI components require it.

Usage

Call it from anywhere with an active screen (a page, a view model command, etc.):

using Plugin.Esewa;

async Task PayAsync()
{
    if (!EsewaPayment.IsSupported)
        return; // Not running on Android or iOS.

    var request = new EsewaPaymentRequest
    {
        ClientId    = "<your-merchant-client-id>",
        SecretKey   = "<your-merchant-secret>",
        Amount      = "500",
        ProductName = "Order #1234",
        ProductId   = "ORD-1234",
        CallbackUrl = "https://your-merchant.com/callback",
        Environment = EsewaEnvironment.Production,
    };

    EsewaPaymentResult result = await EsewaPayment.Current.PayAsync(request);

    switch (result.Status)
    {
        case EsewaPaymentStatus.Success:
            // result.Message and result.Details carry the transaction info.
            break;
        case EsewaPaymentStatus.Cancelled:
            // The user backed out of the payment.
            break;
        case EsewaPaymentStatus.Failure:
            // result.Message explains what went wrong.
            break;
    }
}

PayAsync presents the native eSewa checkout UI and completes when the user finishes, cancels, or an error occurs. It never throws for a normal cancellation or decline — inspect result.Status.

API

EsewaPayment

Member Description
EsewaPayment.Current The payment service for the current platform.
EsewaPayment.IsSupported true on Android and iOS.

EsewaPaymentRequest

Property Required Description
ClientId Merchant client id issued by eSewa.
SecretKey Merchant secret key issued by eSewa.
Amount Amount to charge, e.g. "100".
ProductName Product / service name shown to the payer.
ProductId Your unique id for this transaction.
CallbackUrl Callback URL registered with eSewa.
Environment Test (default) or Production.
Properties Optional extra key/value pairs forwarded to the SDK.

EsewaPaymentResult

Member Description
Status Success, Cancelled, or Failure.
IsSuccess Shortcut for Status == Success.
Message Human-readable message from the SDK.
Details Key/value transaction details on success (may be null).

Getting merchant credentials

You need a merchant client id, secret key, and a registered callback URL from eSewa. Sign up and manage these on the official developer portal:

https://developer.esewa.com.np/

Use EsewaEnvironment.Test with sandbox credentials during development, then switch to EsewaEnvironment.Production with your live credentials to go live.

License

Released under the MIT License.

The MIT license covers this plugin. The bundled native eSewa SDKs are the property of eSewa and are subject to eSewa's own licensing terms; see https://developer.esewa.com.np/.

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible. 
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.3 118 7/13/2026
1.0.1 105 7/13/2026
1.0.0 120 7/11/2026

Initial release: Android (AAR binding) and iOS (Swift xcframework via @objc shim) support.