VOOZH about

URL: https://www.nuget.org/packages/VantagePay.SDK/

⇱ NuGet Gallery | VantagePay.SDK 1.2026.602.6




👁 Image
VantagePay.SDK 1.2026.602.6

dotnet add package VantagePay.SDK --version 1.2026.602.6
 
 
NuGet\Install-Package VantagePay.SDK -Version 1.2026.602.6
 
 
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="VantagePay.SDK" Version="1.2026.602.6" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VantagePay.SDK" Version="1.2026.602.6" />
 
Directory.Packages.props
<PackageReference Include="VantagePay.SDK" />
 
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 VantagePay.SDK --version 1.2026.602.6
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VantagePay.SDK, 1.2026.602.6"
 
 
#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 VantagePay.SDK@1.2026.602.6
 
 
#: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=VantagePay.SDK&version=1.2026.602.6
 
Install as a Cake Addin
#tool nuget:?package=VantagePay.SDK&version=1.2026.602.6
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

VantagePay SDK for .NET

VantagePay.SDK is the official C# client SDK for integrating with VantagePay APIs.

It provides:

  • typed API clients backed by
  • automatic token refresh for authenticated calls
  • automatic HTTP retries for transient failures
  • real-time payment and broadcast updates via SignalR

The TypeScript SDK on NPM covers client capabilities only. This .NET SDK includes both client and admin capabilities.


Table of Contents


Installation

dotnet add package VantagePay.SDK

Or with NuGet Package Manager Console:

Install-Package VantagePay.SDK

Supported Frameworks

VantagePay.SDK currently targets:

  • .NET 8 (net8.0)
  • .NET 9 (net9.0)
  • .NET 10 (net10.0)

Client Types

Use the client that matches your integration model:

Client Intended use Authentication model
VantagePayClient Client-facing integrations (web/mobile apps, POS apps, merchant/consumer flows) Access/refresh token session (LoginAsync)
VantagePayAdminClient Trusted server-side admin integrations API key (apiKey)

Basic Usage

VantagePayClient (client-facing)

using VantagePay.SDK;
using VantagePay.Models.Lookups;

var client = new VantagePayClient("https://sandbox-api.vantagepay.dev");

await client.Authentication.LoginAsync("233548306110", "Password123!");

var currencies = await client.Lookups.GetCurrenciesAsync();

var summary = await client.Reports.GetTransactionSummaryAsync(Currency.GHS);

VantagePayAdminClient (server-side)

using VantagePay.SDK;

var adminClient = new VantagePayAdminClient(
 "https://sandbox-api.vantagepay.dev",
 apiKey: "your-admin-api-key");

var userReference = await adminClient.Users.CreateUserAsync("partner.user", "StrongPassword123!");

Configuration and Construction

Constructors

VantagePayClient:

  • new VantagePayClient(environmentUrl)
  • new VantagePayClient(environmentUrl, loggerFactory)
  • new VantagePayClient(environmentUrl, accessToken, refreshToken)
  • new VantagePayClient(environmentUrl, accessToken, refreshToken, loggerFactory)

VantagePayAdminClient:

  • new VantagePayAdminClient(environmentUrl, apiKey)
  • new VantagePayAdminClient(environmentUrl, apiKey, loggerFactory)

Logging

Pass an ILoggerFactory to integrate SDK logs into your logging pipeline.

using Microsoft.Extensions.Logging;
using VantagePay.SDK;

using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());

var client = new VantagePayClient(
 "https://sandbox-api.vantagepay.dev",
 accessToken: null,
 refreshToken: null,
 loggerFactory: loggerFactory);

Retry and refresh behavior

  • HTTP retries are automatic for transient failures.
  • access tokens are refreshed automatically when possible using the current refreshToken.
  • SignalR hubs are configured with automatic reconnect.

Authentication and Tokens

Login and token storage

var token = await client.Authentication.LoginAsync("233548306110", "Password123!");

// Tokens are persisted in-memory on the client instance.
string? accessToken = client.ApiTokens.AccessToken;
string? refreshToken = client.ApiTokens.RefreshToken;

Restore existing tokens

var client = new VantagePayClient(
 "https://sandbox-api.vantagepay.dev",
 accessToken: storedAccessToken,
 refreshToken: storedRefreshToken);

Session helpers

bool loggedIn = client.Authentication.IsLoggedIn();
await client.Authentication.RefreshAsync();
await client.Authentication.LogoutAsync();

Token claim helpers

var userReference = client.Authentication.GetCurrentUserReference();
var merchantReference = client.Authentication.GetCurrentMerchantReference();
var consumerReference = client.Authentication.GetCurrentConsumerReference();
var terminalReference = client.Authentication.GetCurrentTerminalReference();
var emailAddress = client.Authentication.GetCurrentEmailAddress();

Error Handling

SDK operations throw ApiException derivatives for API failures.

Primary exception types:

  • ApiValidationException (400)
  • ApiAuthorizationException (401)
  • ApiForbiddenException (403)
  • ApiNotFoundException (404)
  • ApiException (other status codes)
using VantagePay.SDK.Exceptions;

try
{
 await client.Authentication.LoginAsync("user", "wrong-password");
}
catch (ApiAuthorizationException ex)
{
 Console.WriteLine($"Unauthorized ({ex.StatusCode}): {ex.Message}");

 if (ex.ErrorResponse?.MustChangePassword == true)
 {
 await client.Authentication.ChangePasswordAsync("OldPassword", "NewPassword123!");
 }

 if (ex.ErrorResponse?.MustValidatePhoneNumber == true ||
 ex.ErrorResponse?.MustValidateEmailAddress == true)
 {
 await client.Authentication.ResendOtpAsync();
 await client.Authentication.ValidateOtpAsync("123456");
 }
}
catch (ApiValidationException ex)
{
 Console.WriteLine($"Validation error ({ex.StatusCode}): {ex.Message}");
}
catch (ApiException ex)
{
 Console.WriteLine($"API error ({ex.StatusCode}): {ex.Message}");
 throw;
}

Note:

  • many Get* methods return null when an entity is not found.
  • CancellationToken is supported across all async methods.

Public API Surface

VantagePayClient modules

Module Purpose
Authentication Login/logout, refresh, OTP, password, face/liveness checks
Lookups Countries, currencies, languages, banks, wallet operators, categories, product types, address resolution
Consumers Consumer profile operations, files, limits, debit orders, broadcast listener
Merchants Merchant profile operations, OTP verify, terminal setup/config, QR code retrieval, telemetry, broadcast listener
Products Global product catalog browsing and merchant product management, broadcast listener
Payments Payment and refund workflows, tokenization, status monitoring, interactive payment signals
Notifications In-app message retrieval and lifecycle
QrCodes Dynamic QR generation and QR validation
Reports Recent transactions, summaries, daily and detailed transaction reporting
System Health ping

Example API calls

// Lookups
var banks = await client.Lookups.GetBanksAsync();

// Consumer profile
var consumer = await client.Consumers.GetConsumerAsync();

// Merchant profile
var merchant = await client.Merchants.GetMerchantAsync();

// Products
var productTypes = await client.Products.GetActiveProductTypesAsync();

// Notifications
var messages = await client.Notifications.GetMessagesAsync();

// Reports
var recent = await client.Reports.GetRecentTransactionsAsync(limit: 10, successfulOnly: true);

// Health
bool isOnline = await client.System.PingAsync();

Payments and Signals

Payments supports both request/response and event-driven processing.

Basic payment submission

using System.Collections.Generic;
using VantagePay.Models.Lookups;
using VantagePay.Models.Payments;
using VantagePay.Models.Payments.Requests;

var payment = new PaymentRequest
{
 YourReference = "ORDER-1001",
 PaymentSources = new PaymentSources
 {
 MobileWallets = new List<MobileWalletSource>
 {
 new MobileWalletSource
 {
 MobileWalletOperator = MobileWalletOperator.MTN,
 Msisdn = "233555666112",
 AmountInCents = 5000,
 Currency = Currency.GHS,
 }
 }
 },
 PaymentDestinations = new PaymentDestinations
 {
 Merchants = new List<MerchantDestination>
 {
 new MerchantDestination
 {
 MerchantReference = "merchant-reference",
 AmountInCents = 5000,
 Currency = Currency.GHS,
 PaymentType = MerchantPaymentType.BuyingGoods,
 }
 }
 }
};

var initialStatus = await client.Payments.PayAsync(payment);

Subscribing to payment signals

using VantagePay.Models.Lookups;
using VantagePay.Models.Common;

client.Payments.OnPaymentStatusUpdate = status =>
{
 Console.WriteLine($"{status.PaymentReference}: {status.PercentageComplete}%");
};

client.Payments.OnPaymentComplete = status =>
{
 Console.WriteLine($"Payment complete: {status.PaymentReference}");
};

client.Payments.OnRequiresPin = data =>
{
 var pin = "1234";
 _ = client.Payments.SubmitPinCodeAsync(data.TransactionReference, pin);
};

client.Payments.OnRequiresConfirmation = data =>
{
 _ = client.Payments.SubmitConfirmationAsync(data.TransactionReference, confirm: true);
};

client.Payments.OnRequiresAddress = data =>
{
 var address = new Address
 {
 AddressType = AddressType.Billing,
 AddressLine1 = "10 Main Road",
 City = "Johannesburg",
 CountryIsoCode = Country.ZAF,
 PostalCode = "2196",
 };

 _ = client.Payments.SubmitAddressAsync(data.TransactionReference, address);
};

client.Payments.OnRequires3DSecure = data =>
{
 Console.WriteLine($"Open 3DS URL: {data.ThreeDSecureUrl}");
};

client.Payments.OnComplete3DSecure = () =>
{
 Console.WriteLine("3DS flow completed");
};

Waiting for completion

var finalStatus = await client.Payments.WaitForPaymentCompleteAsync();

Consumer, merchant, and product broadcast signals

client.Consumers.OnConsumerUpdate = () =>
{
 Console.WriteLine("Consumer profile updated");
};

client.Merchants.OnMerchantUpdate = () =>
{
 Console.WriteLine("Merchant profile updated");
};

client.Products.OnProductUpdate = () =>
{
 Console.WriteLine("Product catalog updated");
};

await client.Consumers.StartConsumerBroadcastListenerAsync();
await client.Merchants.StartMerchantBroadcastListenerAsync();
await client.Products.StartProductBroadcastListenerAsync();

Manual status-check control

await client.Payments.StartPaymentStatusCheckingAsync(); // listen for external incoming payment

await client.Payments.StopPaymentStatusCheckingAsync(); // stop all

Tokenization and receipts

using VantagePay.Models.Lookups;
using VantagePay.Models.Tokens;

var cardToken = await client.Payments.CreateCardTokenAsync(new CardRequest
{
 CardNumber = "4111111111111111",
 NameOnCard = "Jane Doe",
 ExpiryMonth = Month.March,
 ExpiryYear = 2027,
});

if (cardToken?.Token is not null)
{
 await client.Payments.ActivateCardTokenAsync(cardToken.Token);
}
var receipt = await client.Payments.GetPaymentReceiptAsync(paymentReference);
await client.Payments.SendEmailNotificationAsync(paymentReference.ToString(), "customer@example.com");

Server-side Admin Usage

Use VantagePayAdminClient with API key authorization for administrative workflows.

Admin modules

Module Purpose
Authentication Generate consumer/merchant tokens, reset passwords, OTP send/validate, lock/unlock/logout user
Consumers Manage consumers, files, and KYC state
Merchants Manage merchants, files, KYB state, business hierarchy, device lookup
Notifications Manage templates and send targeted merchant/consumer in-app messages
Products Assignable products, merchant product management, apply product catalogs
Payments Admin payment/refund initiation and status/receipt operations (IPaymentsAdminApi)
Users Create and deactivate users

Admin examples

// Generate a merchant-scoped token pair from the server side.
var merchantToken = await adminClient.Authentication.GenerateMerchantTokenAsync(merchantReference);
// Reset a user password.
await adminClient.Authentication.ResetPasswordAsync("partner.user", "NewStrongPassword123!");
// Create a targeted merchant message.
using VantagePay.Models.Notifications;
using VantagePay.Models.Notifications.Requests;

await adminClient.Notifications.CreateMerchantMessageAsync(
 new CreateMessageRequest
 {
 MessageType = MessageType.Information,
 MessageTarget = MessageTarget.Portal,
 MessagePlacement = MessagePlacement.Dashboard,
 Header = "Planned Maintenance",
 Body = "Service window starts at 22:00 UTC.",
 VisibleUntilDate = DateTimeOffset.UtcNow.AddDays(7),
 },
 merchantReference);

Migration Guide

If migrating from ZGA.Core.Web.Api.Client, apply these namespace/package updates:

  • replace ZGA.Core.Web.Api.Client with VantagePay.SDK
  • replace ZGA.Core.Models with VantagePay.Models
Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.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
1.2026.602.6 117 6/2/2026
1.2026.505.3 119 5/8/2026
1.2026.313.1 134 3/12/2026
1.2026.218.5 155 2/18/2026
1.2026.206.11 233 2/10/2026
1.2026.129.6 125 1/29/2026
1.2025.1211.5 471 12/11/2025
1.2025.1119.3 463 11/19/2025
1.2025.1112.10 340 11/12/2025
1.2025.1015.3 270 10/15/2025
1.2025.1006.5 272 10/6/2025
1.2025.829.3 294 8/29/2025
1.2025.814.3 243 8/14/2025
1.2025.701.3 252 7/8/2025
1.2025.604.3 324 6/4/2025
1.2025.516.5 341 5/19/2025
1.2025.410.2 323 4/10/2025
1.2025.325.5 581 3/25/2025
Loading failed

- Target .NET 10