BazaarPayment 1.0.1
dotnet add package BazaarPayment --version 1.0.1
NuGet\Install-Package BazaarPayment -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="BazaarPayment" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BazaarPayment" Version="1.0.1" />
<PackageReference Include="BazaarPayment" />
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 BazaarPayment --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BazaarPayment, 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 BazaarPayment@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=BazaarPayment&version=1.0.1
#tool nuget:?package=BazaarPayment&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
📦 BazaarPayment
BazaarPayment is a lightweight and easy-to-use .NET library for handling in-app purchases via Cafe Bazaar on Android.
It simplifies the integration of the Bazaar payment system for .NET MAUI and Xamarin.Android apps without needing to write any Java code or use Poolakey 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 BazaarPayment
⚙️ Usage Example
1. Initialize the library
using BazaarPayment;
List<string> products = new() { "coin_pack_1", "subscription_premium" };
BazaarHelper.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 BazaarHelper.Purchase("coin_pack_1");
if (result.Status)
Console.WriteLine($"Purchase successful: {result.Product.productId}");
else
Console.WriteLine("Purchase failed.");
3. Purchase a subscription
var result = await BazaarHelper.Subscription("subscription_premium");
if (result.Status)
Console.WriteLine("Subscription activated!");
4. Query existing purchases/subscriptions
var purchases = await BazaarHelper.CheckPurchases();
var subscriptions = await BazaarHelper.CheckSubscriptions();
5. All availible items to purchase
var items = await BazaarHelper.AllInappItems();
var subs = await BazaarHelper.AllSubItems();
6. Consume a product (for repeatable items)
await BazaarHelper.Consume(purchaseModel);
7. 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; }
}
8. 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
BazaarHelper.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
Statuswill befalse. - Always validate the purchase signature on your server to ensure transaction integrity.
- The RSA key must match the one from your Bazaar 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 (PoolakeyHelper) 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 | Versions 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.