SuperQi 0.8.0-alhpa

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

SuperQi .NET SDK

.NET SDK for SuperQi Wallet Mini Program OpenAPIs.

Supports .NET 9, and .NET 10.

Installation

dotnet add package SuperQi

Setup

using SuperQi;

var client = new SuperQi(
    gatewayBaseUrl: "https://***************",
    clientId: "YOUR_CLIENT_ID",
    merchantPrivateKey: "BASE64_ENCODED_RSA_PRIVATE_KEY"
);

The merchantPrivateKey is a Base64-encoded PEM RSA private key. All requests are automatically signed with RSA-256.

Authorization

Get Access Token

Exchange an authorization code (from my.getAuthCode) for an access token:

using SuperQi.Models.AccessToken;

var response = await client.GetAccessTokenAsync(new AccessTokenRequest
{
    AuthorizationCode = "AUTH_CODE_FROM_WALLET"
});

var accessToken = response.AccessToken;
var customerId = response.CustomerId;

Refresh Token

using SuperQi.Models.RefreshToken;

var response = await client.GetRefreshTokenAsync(new RefreshTokenRequest
{
    RefreshToken = "YOUR_REFRESH_TOKEN"
});

Users

Get User Info

Retrieve user profile details using an access token:

using SuperQi.Models.UserInfo;

var response = await client.GetUserInfoAsync(new UserInfoRequest
{
    AccessToken = "ACCESS_TOKEN"
});

var user = response.UserInfo;
// user.UserId, user.UserName, user.Avatar, user.Gender, etc.

Payments

Create Payment (Cashier)

Redirect the user to the wallet cashier for payment approval:

using SuperQi.Models;
using SuperQi.Models.Pay;

var response = await client.PayAsync(new PayRequest
{
    ProductCode = "51051000101000000011",
    PaymentRequestId = "UNIQUE_MERCHANT_PAYMENT_ID",
    PaymentAmount = new Amount { Currency = "IQD", Value = "150000" },
    Order = new PayOrder
    {
        OrderDescription = "Order #1234",
        Buyer = new PayBuyer { ReferenceBuyerId = customerId }
    },
    PaymentNotifyUrl = "https://your-server.com/notify"
});

if (response.Result.ResultStatus == ResultStatus.Accepted)
{
    // Redirect user to: response.RedirectActionForm.RedirectionUrl
}

Create Payment (Agreement / Auto-Debit)

Charge the user automatically using a signed agreement:

var response = await client.PayAsync(new PayRequest
{
    ProductCode = "51051000101000100031",
    PaymentRequestId = "UNIQUE_MERCHANT_PAYMENT_ID",
    PaymentAuthCode = "ACCESS_TOKEN_FROM_AGREEMENT",
    PaymentAmount = new Amount { Currency = "IQD", Value = "150000" },
    Order = new PayOrder
    {
        OrderDescription = "Monthly subscription"
    }
});

Refund

Issue a full or partial refund against a completed payment:

using SuperQi.Models;
using SuperQi.Models.Refund;

var response = await client.RefundAsync(new RefundRequest
{
    RefundRequestId = "UNIQUE_MERCHANT_REFUND_ID",
    PaymentId = "WALLET_PAYMENT_ID",
    RefundAmount = new Amount { Currency = "IQD", Value = "50000" },
    RefundReason = "Customer requested cancellation"
});

Inquiry Payment

Poll for the latest payment status:

using SuperQi.Models.InquiryPayment;

var response = await client.InquiryPaymentAsync(new InquiryPaymentRequest
{
    PaymentId = "WALLET_PAYMENT_ID"
});

// response.PaymentStatus: Processing, AuthSuccess, Success, Fail

Inquiry Refund

Poll for the latest refund status:

using SuperQi.Models.InquiryRefund;

var response = await client.InquiryRefundAsync(new InquiryRefundRequest
{
    RefundId = "WALLET_REFUND_ID"
});

// response.RefundStatus: Processing, Success, Fail

Messages

Send Push Notification

using SuperQi.Models.SendPush;

var response = await client.SendPushAsync(new SendPushRequest
{
    AccessToken = "ACCESS_TOKEN",
    RequestId = "UNIQUE_REQUEST_ID",
    Content = new SendPushContentRequest
    {
        Title = "Order Shipped",
        Content = "Your order #1234 has been shipped.",
        AppIdentifier = "YOUR_MINI_APP_ID"
    }
});

Send Inbox Message

Requires the NOTIFICATION_INBOX scope on the access token:

using SuperQi.Models.SendInbox;

var response = await client.SendInboxAsync(new SendInboxRequest
{
    AccessToken = "ACCESS_TOKEN",
    RequestId = "UNIQUE_REQUEST_ID",
    Content = new SendInboxContentRequest
    {
        Title = "Welcome",
        Content = "Thanks for signing up!",
        AppIdentifier = "YOUR_MINI_APP_ID"
    }
});

Result Handling

All responses include a Result object with ResultStatus:

using SuperQi.Enums;

switch (response.Result.ResultStatus)
{
    case ResultStatus.Successful:
        // Operation succeeded
        break;
    case ResultStatus.Accepted:
        // Accepted, further action needed (e.g. cashier redirect)
        break;
    case ResultStatus.Unknown:
        // Unknown outcome, retry or poll
        break;
    case ResultStatus.Failed:
        // Failed, check ResultCode and ResultMessage
        break;
}

License

MIT

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

    • No dependencies.
  • net9.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
0.8.0-alhpa 336 5/12/2026
0.7.0-alhpa 251 3/21/2026
0.6.0-alhpa 77 3/17/2026
0.5.0-alhpa 75 3/9/2026
0.4.1-alhpa 89 1/14/2026
0.4.0-alhpa 86 1/13/2026