tauri-plugin-billing 0.1.3

A Tauri plugin to access the Android billing SDK
use tauri::{command, AppHandle, Runtime};

use crate::models::*;
use crate::BillingExt;
use crate::Result;

#[command]
pub(crate) async fn create_purchase<R: Runtime>(
    app: AppHandle<R>,
    payload: PurchaseRequest,
) -> Result<PurchaseResponse> {
    app.billing().create_purchase(payload)
}

#[command]
pub(crate) async fn consume<R: Runtime>(
    app: AppHandle<R>,
    payload: ConsumeRequest,
) -> Result<PurchaseResponse> {
    app.billing().consume(payload)
}

#[command]
pub(crate) async fn get_product<R: Runtime>(
    app: AppHandle<R>,
    payload: PurchaseRequest,
) -> Result<ProductsResponse> {
    app.billing().get_product(payload)
}

#[command]
pub(crate) async fn get_all_purchases<R: Runtime>(app: AppHandle<R>) -> Result<PurchasesResponse> {
    app.billing().get_all_purchases()
}