NestPayDotNet 1.0.1

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

// Install NestPayDotNet as a Cake Tool
#tool nuget:?package=NestPayDotNet&version=1.0.1                

NestPayDotNet SDK

A lightweight and easy-to-use .NET SDK for integrating with the NestPay API, enabling secure and efficient payment processing. This SDK supports various transaction types, including sales, refunds, preauthorization.


Features

  • Transaction Processing: Supports Auth, PreAuth, PostAuth, Void, and Credit operations.
  • Error Handling: Built-in error codes and descriptive error messages for seamless debugging.
  • XML Serialization: Automatically handles request and response conversions.
  • Extensible: Designed for easy customization and scalability.

Usage example

using NestPayDotNet.Exceptions;
using NestPayDotNet;
using NestPayDotNet.Enums;
using NestPayDotNet.Models;
using Newtonsoft.Json;


// NestPay merchant Information
const string NESTPAY_URL = "YOUR_MERCHANT_API_URL";
const string MERCHANT_ID = "YOUR_MERCHANT_ID";
const string MERCHANT_USERNAME = "YOUR_MERCHANT_USERNAME";
const string MERCHANT_PASSWORD = "YOUR_MERCHANT_PASSWORD";


// Test Card Information
const string CARD_NUMBER = "0000000000000000";
const string CARD_EXPIRY = "mm/yy";
const string CARD_CVV = "000";


// Initialize a new transaction request
var saleRequest = new TransactionRequest
{
    CardNumber = CARD_NUMBER,
    CardExpiry = CARD_EXPIRY,
    CardCvv = CARD_CVV,
    Currency = Currency.IQD,
    Lang = Language.English,
    Total = 1000,
    Type = TransactionType.Auth.ToString(),
    OrderId = Guid.NewGuid().ToString(),
};


// Initialize a new NestPayClient
var nestPayClient = new NestPayClient(NESTPAY_URL, MERCHANT_ID, MERCHANT_USERNAME, MERCHANT_PASSWORD);


// Process the transaction
try
{
    var saleResponse = await nestPayClient.ProcessTransactionAsync(saleRequest);

    Console.WriteLine(JsonConvert.SerializeObject(saleResponse));
}
catch (NestPayGatewayException ex)
{
    // Handle the gateway exception
    Console.WriteLine(ex.ToString());
}
catch (NestPayTransactionException ex)
{
    // Handle the transaction exception
    Console.WriteLine(ex.ToString());
}
catch (Exception ex)
{
    // Handle any other exception
    Console.WriteLine(ex.ToString());
}

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.  net9.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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
1.0.1 111 12/7/2024
1.0.0 105 12/4/2024