esewa_maui 1.0.3
dotnet add package esewa_maui --version 1.0.3
NuGet\Install-Package esewa_maui -Version 1.0.3
<PackageReference Include="esewa_maui" Version="1.0.3" />
<PackageVersion Include="esewa_maui" Version="1.0.3" />
<PackageReference Include="esewa_maui" />
paket add esewa_maui --version 1.0.3
#r "nuget: esewa_maui, 1.0.3"
#:package esewa_maui@1.0.3
#addin nuget:?package=esewa_maui&version=1.0.3
#tool nuget:?package=esewa_maui&version=1.0.3
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-androidtarget). 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Essentials (>= 10.0.20)
- Square.OkHttp3 (>= 4.12.0)
- Square.OkHttp3.LoggingInterceptor (>= 4.12.0)
- Xamarin.AndroidX.ConstraintLayout (>= 2.2.1.3)
- Xamarin.AndroidX.DataBinding.ViewBinding (>= 7.4.2)
- Xamarin.Kotlin.StdLib (>= 2.3.10.1)
-
net10.0-ios26.0
- Microsoft.Maui.Essentials (>= 10.0.20)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release: Android (AAR binding) and iOS (Swift xcframework via @objc shim) support.