Hot.Web.Api.Sdk 0.1.3.1

dotnet add package Hot.Web.Api.Sdk --version 0.1.3.1                
NuGet\Install-Package Hot.Web.Api.Sdk -Version 0.1.3.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="Hot.Web.Api.Sdk" Version="0.1.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hot.Web.Api.Sdk --version 0.1.3.1                
#r "nuget: Hot.Web.Api.Sdk, 0.1.3.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.
// Install Hot.Web.Api.Sdk as a Cake Addin
#addin nuget:?package=Hot.Web.Api.Sdk&version=0.1.3.1

// Install Hot.Web.Api.Sdk as a Cake Tool
#tool nuget:?package=Hot.Web.Api.Sdk&version=0.1.3.1                

Hot Recharge API SDK

Version 3 API

Hot Recharge is a Zimbabwean recharge platform for all networks and various utility services. The package allows for users to easily add the version 3.0 API to your c# applications.

Usage - With FactoryClient

  1. Add Package to Project
  2. Create client with credentials
 IHotAPIClient client = HotApiClientFactory.Create("{username}", "{password}");  

Usage - As Injected Service

  1. Add Package to project
  2. Register the SDK in service for DI
var Configuration = new ConfigurationBuilder()
             .SetBasePath(Directory.GetParent(AppContext.BaseDirectory)?.FullName ?? "")
             .AddJsonFile("appsettings.json", false)
             .AddUserSecrets(Assembly.GetExecutingAssembly())
             .AddEnvironmentVariables()
             .Build();

var host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services => {  
        services.AddHotApiSdk(Configuration);
    })
    .Build();
  1. Add credentials to configuration file
 "HotAPI": {
    "Username": "{AccessCode}",
    "Password": "{Password}"
  }
  1. Inject Service into application in constructor
    public class App { 
        private readonly IHotAPIClient _client;
        public App (IHotAPIClient client) {
            _client = client;
        }
        ...
    }

Example Usage

    // Account Balance Query
    var response = await client.Account.BalancesAsync(); 
    if (response.IsSuccessStatusCode)
    {
        result = JsonSerializer.Serialize(response.Content);
    }
    else
    {
        result = JsonSerializer.Serialize(response.Error.Content);
    }
    Console.WriteLine(result);

Implement it yourself

An API guide for Hot Recharge API is available here

Features

  • Recharge Airtime for all mobile networks operators - Econet, Netone, Telecel
  • ZETDC Token Purchases
  • Utility Payments for Telone & Nyaradzo
  • Custom SMS notification message for clients
  • Easily query information for bundles & products available

License

MIT

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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
0.1.3.1 78 11/3/2024
0.1.3 81 11/2/2024
0.1.2 181 10/9/2023