MyketPayment 1.0.1

dotnet add package MyketPayment --version 1.0.1
                    
NuGet\Install-Package MyketPayment -Version 1.0.1
                    
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="MyketPayment" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MyketPayment" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MyketPayment" />
                    
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 MyketPayment --version 1.0.1
                    
#r "nuget: MyketPayment, 1.0.1"
                    
#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 MyketPayment@1.0.1
                    
#: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=MyketPayment&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=MyketPayment&version=1.0.1
                    
Install as a Cake Tool

📦 MyketPayment

MyketPayment is a lightweight and easy-to-use .NET library for handling in-app purchases via Myket on Android.
It simplifies the integration of the Myket payment system for .NET MAUI and Xamarin.Android apps without needing to write any Java code directly.


✨ Features

  • Supports both in-app purchases and subscriptions
  • Simple, async-based API
  • No extra dependencies required
  • Works with .NET MAUI and Xamarin.Android
  • Secure and easy to integrate

⚙️ Installation

Install-Package MyketPayment

⚙️ Usage Example

1. Initialize the library

using MyketPayment;

List<string> products = new() { "coin_pack_1", "subscription_premium" };

MyketHelper.Initialize(this, "YOUR_RSA_KEY_HERE", products);

Initialize must be called once when the app starts (e.g., in your main Activity).

2. Purchase a product

var result = await MyketHelper.Purchase("coin_pack_1" , "Optional payload");

if (result.Status)
    Console.WriteLine($"Purchase successful: {result.Product.productId}");
else
    Console.WriteLine("Purchase failed.");

3. Purchase a subscription

var result = await MyketHelper.Subscription("subscription_premium", "Optional payload");

if (result.Status)
    Console.WriteLine("Subscription activated!");

4. All availible items to purchase

var items = await MyketHelper.AllAvailibleItems();

It will return all subs and purchase items with details

5. Consume a product (for repeatable items)

var result = await MyketHelper.Consume(purchaseModel);

if (result.Status)
    Console.WriteLine($"Item '{result.ProductID}' Consumed");

6. Data Models (PurchaseModel)

public class PurchaseModel
{
    public string? productId { get; set; }
    public string? purchaseToken { get; set; }
    public string? state { get; set; }
    public string? payload { get; set; }
    public string? signature { get; set; }
    public string? orderId { get; set; }
    public string? originalJson { get; set; }
    public string? purchaseTime { get; set; }
    public string? type { get; set; }
}

7. ItemModel

Contains product details.

public class ItemModel
{
    public string? productId { get; set; }
    public string? description { get; set; }
    public string? price { get; set; }
    public string? title { get; set; }
    public string? type { get; set; }
}

⚠️ Notes

  • Call MyketHelper.Initialize() once before using any other methods.
  • All operations are asynchronous — make sure to use await.
  • If a purchase or subscription fails or is canceled, the returned Status will be false.
  • Always validate the purchase signature on your server to ensure transaction integrity.
  • The RSA key must match the one from your Myket developer panel.
  • For consumable items, remember to call Consume() after a successful purchase.
  • Do not call Initialize() multiple times — the helper automatically handles initialization state.
  • The library depends on a small bridge layer (MyketBridge) that must exist in your Android project.
  • Make sure to declare all your product IDs when calling Initialize().
  • All callbacks return strongly typed models (PurchaseModel, ItemModel) for simplicity.

👨‍💻 Author: SLVZ

Product Compatible and additional computed target framework versions.
.NET net9.0-android36.0 is compatible.  net10.0-android was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0-android36.0

    • No dependencies.

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.1 128 12/12/2025
1.0.0 241 11/14/2025