Zarinpal-Plus 1.0.1

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

درود فراوان برای گزارش مشکل لطفا به شناسه زیر در تلگرام پیام دهید خیلی ممنون @IliyaAsghariii

Zarinpal-Plus

شما با استفاده از این کتاب خانه میتوانید به تمامی سرویس های عمومی زرین پال در سی شارپ بصورت گسترده دسترسی داشته باشید.

آموزش استفاده

استفاده سریع

dotnet add package Zarinpal-Plus --version 1.0.1

ساخت سازنده

using ZarinpalPlus.Services;

var ZRequest = new ZarinpalServices();

ساخت درگاه (Request)

var Response = ZRequest.RequestAsync(new Zarinpal_Plus.Models.RequestModel()
{
    MerchantId = Guid.Parse("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"),
    Description = "توضیحات تستی",
    Amount = 11 * 1000,
    CallBackUrl = "https://www.YOUR_WEBSITE.com",
    UnitType = Zarinpal_Plus.Models.UnitType.IRT,
    MetaData = new Zarinpal_Plus.Models.RequestMetaDataModel()
    {
        Email = "TESTMAIL@GMAIL.COM",
        Mobile = "09000000000",
        OrderId = "000000"
    }
}).Result;

ساخت لینک درگاه (Url)

var Url = ZRequest.GenerateUrl();

برسی جواب درگاه ساخته شده (Verify)

var VResponse = ZRequest.VerifyAsync(new Zarinpal_Plus.Models.VerifyRequestModel()
{
    Amount = 25 * 1000,
    MerchantId = Guid.Parse("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"),
    Authority = "A00000000000000000000000000217885159"
}).Result;

توضیحات تکمیلی

مدل ها

در تابع ساخت درگاه (RequestAsync) $${\color{lightgreen}Request}$$

    public class RequestModel
    {
        public UnitType? UnitType { get; set; }

        public Guid MerchantId { get; set; }

        public int Amount { get; set; }

        public String CallBackUrl { get; set; } = null!;
        public String Description { get; set; } = null!;

        public RequestMetaDataModel? MetaData { get; set; }
    }

    public class RequestMetaDataModel
    {
        public String? Email { get; set; }
        public String? Mobile { get; set; }
        public String? OrderId { get; set; }
    }

    public enum UnitType
    {
        IRR, IRT
    }

در تابع ساخت درگاه (RequestAsync) $${\color{lightgreen}Response}$$

    public class ResponseModel
    {
        public DataModel? Data { get; set; }

        public object? Errors { get; set; }

        public StatusModel? Status { get; set; }
    }
    public class DataModel
    {
        public int Fee { get; set; }

        public string? Authority { get; set; }
        public string? FeeType { get; set; }
    }

در تابع برسی درخواست درگاه (VerifyAsync) $${\color{lightblue}Request}$$

    public class VerifyRequestModel
    {
        public Guid MerchantId { get; set; }

        public int Amount { get; set; }

        public string Authority { get; set; } = null!;
    }

در تابع برسی درخواست درگاه (VerifyAsync) $${\color{lightblue}Response}$$

    public class VerifyResponseModel
    {
        public VerifyDataModel? Data { get; set; }

        public object? Errors { get; set; }

        public StatusModel? Status { get; set; }
    }

    public class VerifyDataModel
    {
        public int Code { get; set; }
        public int RefrenceId { get; set; }
        public int Fee { get; set; }

        public string CardHash { get; set; }
        public string CardPan { get; set; }
        public string FeeType { get; set; }
    }

مدل (StatusModel)

    public class StatusModel
    {
        public int StatusCode { get; set; }

        public string Status { get; set; }
        public string Type { get; set; }

        public StatusMessageModel Messages { get; set; }
    }
    public class StatusMessageModel
    {
        public string Persion { get; set; }
        public string English { get; set; }
    }

جدول وضعیت

نوع وضعیت کد وضعیت پیام فارسی
public Error -9 خطای اعتبار سنجی1- مرچنت کد داخل تنظیمات وارد نشده باشد-2 آدرس بازگشت (callbackurl) وارد نشده باشد -3 توضیحات (description ) وارد نشده باشد و یا از حد مجاز 500 کارکتر بیشتر باشد -4 مبلغ پرداختی کمتر یا بیشتر از حد مجاز
public Error -10 ای پی یا مرچنت كد پذیرنده صحیح نیست.
public Error -11 مرچنت کد فعال نیست، پذیرنده مشکل خود را به امور مشتریان زرین‌پال ارجاع دهد.
public Error -12 تلاش بیش از دفعات مجاز در یک بازه زمانی کوتاه به امور مشتریان زرین پال اطلاع دهید
public Error -15 درگاه پرداخت به حالت تعلیق در آمده است، پذیرنده مشکل خود را به امور مشتریان زرین‌پال ارجاع دهد.
public Error -16 سطح تایید پذیرنده پایین تر از سطح نقره ای است.
public Error -17 محدودیت پذیرنده در سطح آبی
public Success 100 عملیات موفق
PaymentRequest Error -30 پذیرنده اجازه دسترسی به سرویس تسویه اشتراکی شناور را ندارد.
PaymentRequest Error -31 حساب بانکی تسویه را به پنل اضافه کنید. مقادیر وارد شده برای تسهیم درست نیست. پذیرنده جهت استفاده از خدمات سرویس تسویه اشتراکی شناور، باید حساب بانکی معتبری به پنل کاربری خود اضافه نماید.
PaymentRequest Error -32 مبلغ وارد شده از مبلغ کل تراکنش بیشتر است.
PaymentRequest Error -33 درصدهای وارد شده صحیح نیست.
PaymentRequest Error -34 مبلغ وارد شده از مبلغ کل تراکنش بیشتر است.
PaymentRequest Error -35 تعداد افراد دریافت کننده تسهیم بیش از حد مجاز است.
PaymentRequest Error -36 حداقل مبلغ جهت تسهیم باید ۱۰۰۰۰ ریال باشد
PaymentRequest Error -37 یک یا چند شماره شبای وارد شده برای تسهیم از سمت بانک غیر فعال است.
PaymentRequest Error -38 خطا٬عدم تعریف صحیح شبا٬لطفا دقایقی دیگر تلاش کنید.
PaymentRequest Error -39 خطایی رخ داده است به امور مشتریان زرین پال اطلاع دهید
PaymentRequest Error -40
PaymentRequest Error -41 حداکثر مبلغ پرداختی ۱۰۰ میلیون تومان است
PaymentVerify Error -50 مبلغ پرداخت شده با مقدار مبلغ ارسالی در متد وریفای متفاوت است.
PaymentVerify Error -51 پرداخت ناموفق
PaymentVerify Error -52 خطای غیر منتظره‌ای رخ داده است. پذیرنده مشکل خود را به امور مشتریان زرین‌پال ارجاع دهد.
PaymentVerify Error -53 پرداخت متعلق به این مرچنت کد نیست.
PaymentVerify Error -54 اتوریتی نامعتبر است.
PaymentVerify Error -55 تراکنش مورد نظر یافت نشد
PaymentVerify Success 101 تراکنش وریفای شده است.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net10.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.1 231 4/11/2024
1.0.0 198 4/9/2024 1.0.0 is deprecated because it is no longer maintained.