From 967f86dda621d2d01767b62f5a0567ba8f7fcc7e Mon Sep 17 00:00:00 2001 From: Mahdi Roshanfekr Date: Sun, 17 Mar 2019 01:41:53 +0330 Subject: [PATCH] zarinPal files --- Models/ConfigurationModel.cs | 43 ++ Models/PaymentInfoModel.cs | 21 + Models/ResultModel.cs | 17 + Properties/AssemblyInfo.cs | 36 ++ Properties/Settings.Designer.cs | 37 ++ Properties/Settings.settings | 9 + Validator/PaymentInfoValidator.cs | 57 ++ Views/Configure.cshtml | 62 ++ Views/PaymentInfo.cshtml | 31 + Views/Result.cshtml | 14 + .../PaymentGatewayImplementationService.wsdl | 244 ++++++++ .../ZarinPalWebService/Reference.cs | 544 ++++++++++++++++++ .../ZarinPalWebService/Reference.map | 6 + 13 files changed, 1121 insertions(+) create mode 100644 Models/ConfigurationModel.cs create mode 100644 Models/PaymentInfoModel.cs create mode 100644 Models/ResultModel.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings create mode 100644 Validator/PaymentInfoValidator.cs create mode 100644 Views/Configure.cshtml create mode 100644 Views/PaymentInfo.cshtml create mode 100644 Views/Result.cshtml create mode 100644 Web References/ZarinPalWebService/PaymentGatewayImplementationService.wsdl create mode 100644 Web References/ZarinPalWebService/Reference.cs create mode 100644 Web References/ZarinPalWebService/Reference.map diff --git a/Models/ConfigurationModel.cs b/Models/ConfigurationModel.cs new file mode 100644 index 0000000..0db9756 --- /dev/null +++ b/Models/ConfigurationModel.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Web.Mvc; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Plugin.Payments.ZarinPal.Models +{ + public class ConfigurationModel : BaseNopModel + { + public ConfigurationModel() + { + AvailableCurency = new List(); + } + + public IList AvailableCurency { get; set; } + + public int ActiveStoreScopeConfiguration { get; set; } + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.Currency")] + public int CurrencyId { get; set; } + + public bool CurrencyId_OverrideForStore { get; set; } + + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.Description")] + public string Description { get; set; } + + public bool Description_OverrideForStore { get; set; } + + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.MerchantCode")] + public string MerchantCode { get; set; } + + public bool MerchantCode_OverrideForStore { get; set; } + + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.UseSsl")] + public bool UseSsl { get; set; } + + public bool UseSsl_OverrideForStore { get; set; } + + } +} \ No newline at end of file diff --git a/Models/PaymentInfoModel.cs b/Models/PaymentInfoModel.cs new file mode 100644 index 0000000..dda556f --- /dev/null +++ b/Models/PaymentInfoModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Nop.Web.Framework; +using Nop.Web.Framework.Mvc; + +namespace Nop.Plugin.Payments.ZarinPal.Models +{ + public class PaymentInfoModel : BaseNopModel + { + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.EMail")] + public string EMail { get; set; } + + [NopResourceDisplayName("Plugins.Payments.ZarinPal.Fields.Phonenumber")] + public string Phonenumber { get; set; } + + } +} diff --git a/Models/ResultModel.cs b/Models/ResultModel.cs new file mode 100644 index 0000000..710f371 --- /dev/null +++ b/Models/ResultModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Nop.Plugin.Payments.ZarinPal.Models +{ + public class ResultModel + { + public long RefId { get; set; } + + public int Status { get; set; } + + public string Message { get; set; } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7354e82 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Nop.Plugin.Payments.ZarinPal")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Nop.Plugin.Payments.ZarinPal")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("59aaed07-8c3f-4804-b10d-5bbad0a01eac")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..99910bd --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Nop.Plugin.Payments.ZarinPal.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("https://www.zarinpal.com/pg/services/WebGate/service")] + public string Nop_Plugin_Payments_ZarinPal_ZarinPalWebService_PaymentGatewayImplementationService { + get { + return ((string)(this["Nop_Plugin_Payments_ZarinPal_ZarinPalWebService_PaymentGatewayImplementationServi" + + "ce"])); + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..219a9ee --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + https://www.zarinpal.com/pg/services/WebGate/service + + + \ No newline at end of file diff --git a/Validator/PaymentInfoValidator.cs b/Validator/PaymentInfoValidator.cs new file mode 100644 index 0000000..59c482c --- /dev/null +++ b/Validator/PaymentInfoValidator.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FluentValidation; +using Nop.Plugin.Payments.ZarinPal.Models; +using Nop.Services.Localization; +using Nop.Web.Framework.Validators; + +namespace Nop.Plugin.Payments.ZarinPal.Validator +{ + public class PaymentInfoValidator : BaseNopValidator + { + public PaymentInfoValidator(ILocalizationService localizationService) + { + string _emailPattern = + "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; + + //RuleFor(x => x.EMail).Matches(_emailPattern) + // .WithMessage(localizationService.GetResource("Plugins.Payments.ZarinPal.Fields.EMail.IsWrong")); + + RuleFor(p => p.EMail) + .EmailAddress() + .WithMessage(localizationService.GetResource("Plugins.Payments.ZarinPal.Fields.EMail.IsWrong")) + .When(CheckEmptyEmail); + + RuleFor(p => p.Phonenumber) + .Must(CheckPhonenumberType) + .WithMessage(localizationService.GetResource("Plugins.Payments.ZarinPal.Fields.Phonenumber.TypeIsNotValid")); + + } + + private bool CheckEmptyEmail(PaymentInfoModel model) + { + return !string.IsNullOrEmpty(model.EMail); + } + + private bool CheckPhonenumberType(string phonenumber) + { + if (phonenumber.Length == 0) + return true; + + try + { + var temp = Convert.ToDouble(phonenumber); + + return true; + } + catch (Exception) + { + return false; + } + } + } +} diff --git a/Views/Configure.cshtml b/Views/Configure.cshtml new file mode 100644 index 0000000..6060af5 --- /dev/null +++ b/Views/Configure.cshtml @@ -0,0 +1,62 @@ +@{ + Layout = ""; +} +@model Nop.Plugin.Payments.ZarinPal.Models.ConfigurationModel +@using Nop.Web.Framework; + +@Html.Action("StoreScopeConfiguration", "Setting", new { area = "Admin" }) + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() +
+
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.Description_OverrideForStore, model => model.Description, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.Description) +
+
+ @Html.NopEditorFor(model => model.Description) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.MerchantCode_OverrideForStore, model => model.MerchantCode, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.MerchantCode) +
+
+ @Html.NopEditorFor(model => model.MerchantCode) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.UseSsl_OverrideForStore, model => model.UseSsl, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.UseSsl) +
+
+ @Html.NopEditorFor(model => model.UseSsl) +
+
+
+
+ @Html.OverrideStoreCheckboxFor(model => model.CurrencyId_OverrideForStore, model => model.CurrencyId, Model.ActiveStoreScopeConfiguration) + @Html.NopLabelFor(model => model.CurrencyId) +
+
+ @Html.DropDownListFor(model => model.CurrencyId, Model.AvailableCurency) +
+
+
+
+   +
+
+ +
+
+
+
+
+} \ No newline at end of file diff --git a/Views/PaymentInfo.cshtml b/Views/PaymentInfo.cshtml new file mode 100644 index 0000000..99af25f --- /dev/null +++ b/Views/PaymentInfo.cshtml @@ -0,0 +1,31 @@ +@{ + Layout = ""; +} +@model Nop.Plugin.Payments.ZarinPal.Models.PaymentInfoModel + + + + + + + + + + + + + +
+

+ @T("Plugins.Payments.ZarinPal.Fields.RedirectionTip") +

+
+ @Html.LabelFor(model => model.EMail): + + @Html.TextBoxFor(model => model.EMail) + @Html.ValidationMessageFor(model => model.EMail) +
+ @Html.LabelFor(model => model.Phonenumber): + + @Html.TextBoxFor(model => model.Phonenumber) +
\ No newline at end of file diff --git a/Views/Result.cshtml b/Views/Result.cshtml new file mode 100644 index 0000000..171b3d4 --- /dev/null +++ b/Views/Result.cshtml @@ -0,0 +1,14 @@ +@model Nop.Plugin.Payments.ZarinPal.Models.ResultModel +@{ + Layout = "~/Views/Shared/_ColumnsOne.cshtml"; +} + +
+
+
+
+ @T("Plugins.Payments.ZarinPal.Failed") +
+
+
+
diff --git a/Web References/ZarinPalWebService/PaymentGatewayImplementationService.wsdl b/Web References/ZarinPalWebService/PaymentGatewayImplementationService.wsdl new file mode 100644 index 0000000..580b66a --- /dev/null +++ b/Web References/ZarinPalWebService/PaymentGatewayImplementationService.wsdl @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Payment request session creation should be done by using this method. + + + + + + + + + + Payment request session creation with additional data like wages and more should be done by using this method. + + + + + + + + + + Payment verification should be done by using this method. + + + + + + + + + + Payment verification with additional data should be done by using this method. + + + + + + + + + + Get a limited list of unverified transactions and their amounts. + + + + + + + + + + By using this method you can refresh the authority to the needed valid time. + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Web References/ZarinPalWebService/Reference.cs b/Web References/ZarinPalWebService/Reference.cs new file mode 100644 index 0000000..1b50741 --- /dev/null +++ b/Web References/ZarinPalWebService/Reference.cs @@ -0,0 +1,544 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. +// +#pragma warning disable 1591 + +namespace Nop.Plugin.Payments.ZarinPal.ZarinPalWebService { + using System; + using System.Web.Services; + using System.Diagnostics; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + using System.ComponentModel; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="PaymentGatewayImplementationServiceBinding", Namespace="http://zarinpal.com/")] + public partial class PaymentGatewayImplementationService : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback PaymentRequestOperationCompleted; + + private System.Threading.SendOrPostCallback PaymentRequestWithExtraOperationCompleted; + + private System.Threading.SendOrPostCallback PaymentVerificationOperationCompleted; + + private System.Threading.SendOrPostCallback PaymentVerificationWithExtraOperationCompleted; + + private System.Threading.SendOrPostCallback GetUnverifiedTransactionsOperationCompleted; + + private System.Threading.SendOrPostCallback RefreshAuthorityOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public PaymentGatewayImplementationService() { + this.Url = global::Nop.Plugin.Payments.ZarinPal.Properties.Settings.Default.Nop_Plugin_Payments_ZarinPal_ZarinPalWebService_PaymentGatewayImplementationService; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event PaymentRequestCompletedEventHandler PaymentRequestCompleted; + + /// + public event PaymentRequestWithExtraCompletedEventHandler PaymentRequestWithExtraCompleted; + + /// + public event PaymentVerificationCompletedEventHandler PaymentVerificationCompleted; + + /// + public event PaymentVerificationWithExtraCompletedEventHandler PaymentVerificationWithExtraCompleted; + + /// + public event GetUnverifiedTransactionsCompletedEventHandler GetUnverifiedTransactionsCompleted; + + /// + public event RefreshAuthorityCompletedEventHandler RefreshAuthorityCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#PaymentRequest", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int PaymentRequest(string MerchantID, int Amount, string Description, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] string Email, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] string Mobile, string CallbackURL, out string Authority) { + object[] results = this.Invoke("PaymentRequest", new object[] { + MerchantID, + Amount, + Description, + Email, + Mobile, + CallbackURL}); + Authority = ((string)(results[1])); + return ((int)(results[0])); + } + + /// + public void PaymentRequestAsync(string MerchantID, int Amount, string Description, string Email, string Mobile, string CallbackURL) { + this.PaymentRequestAsync(MerchantID, Amount, Description, Email, Mobile, CallbackURL, null); + } + + /// + public void PaymentRequestAsync(string MerchantID, int Amount, string Description, string Email, string Mobile, string CallbackURL, object userState) { + if ((this.PaymentRequestOperationCompleted == null)) { + this.PaymentRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPaymentRequestOperationCompleted); + } + this.InvokeAsync("PaymentRequest", new object[] { + MerchantID, + Amount, + Description, + Email, + Mobile, + CallbackURL}, this.PaymentRequestOperationCompleted, userState); + } + + private void OnPaymentRequestOperationCompleted(object arg) { + if ((this.PaymentRequestCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.PaymentRequestCompleted(this, new PaymentRequestCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#PaymentRequestWithExtra", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int PaymentRequestWithExtra(string MerchantID, int Amount, string Description, string AdditionalData, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] string Email, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] string Mobile, string CallbackURL, out string Authority) { + object[] results = this.Invoke("PaymentRequestWithExtra", new object[] { + MerchantID, + Amount, + Description, + AdditionalData, + Email, + Mobile, + CallbackURL}); + Authority = ((string)(results[1])); + return ((int)(results[0])); + } + + /// + public void PaymentRequestWithExtraAsync(string MerchantID, int Amount, string Description, string AdditionalData, string Email, string Mobile, string CallbackURL) { + this.PaymentRequestWithExtraAsync(MerchantID, Amount, Description, AdditionalData, Email, Mobile, CallbackURL, null); + } + + /// + public void PaymentRequestWithExtraAsync(string MerchantID, int Amount, string Description, string AdditionalData, string Email, string Mobile, string CallbackURL, object userState) { + if ((this.PaymentRequestWithExtraOperationCompleted == null)) { + this.PaymentRequestWithExtraOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPaymentRequestWithExtraOperationCompleted); + } + this.InvokeAsync("PaymentRequestWithExtra", new object[] { + MerchantID, + Amount, + Description, + AdditionalData, + Email, + Mobile, + CallbackURL}, this.PaymentRequestWithExtraOperationCompleted, userState); + } + + private void OnPaymentRequestWithExtraOperationCompleted(object arg) { + if ((this.PaymentRequestWithExtraCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.PaymentRequestWithExtraCompleted(this, new PaymentRequestWithExtraCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#PaymentVerification", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int PaymentVerification(string MerchantID, string Authority, int Amount, out long RefID) { + object[] results = this.Invoke("PaymentVerification", new object[] { + MerchantID, + Authority, + Amount}); + RefID = ((long)(results[1])); + return ((int)(results[0])); + } + + /// + public void PaymentVerificationAsync(string MerchantID, string Authority, int Amount) { + this.PaymentVerificationAsync(MerchantID, Authority, Amount, null); + } + + /// + public void PaymentVerificationAsync(string MerchantID, string Authority, int Amount, object userState) { + if ((this.PaymentVerificationOperationCompleted == null)) { + this.PaymentVerificationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPaymentVerificationOperationCompleted); + } + this.InvokeAsync("PaymentVerification", new object[] { + MerchantID, + Authority, + Amount}, this.PaymentVerificationOperationCompleted, userState); + } + + private void OnPaymentVerificationOperationCompleted(object arg) { + if ((this.PaymentVerificationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.PaymentVerificationCompleted(this, new PaymentVerificationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#PaymentVerificationWithExtra", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int PaymentVerificationWithExtra(string MerchantID, string Authority, int Amount, out long RefID, out string ExtraDetail) { + object[] results = this.Invoke("PaymentVerificationWithExtra", new object[] { + MerchantID, + Authority, + Amount}); + RefID = ((long)(results[1])); + ExtraDetail = ((string)(results[2])); + return ((int)(results[0])); + } + + /// + public void PaymentVerificationWithExtraAsync(string MerchantID, string Authority, int Amount) { + this.PaymentVerificationWithExtraAsync(MerchantID, Authority, Amount, null); + } + + /// + public void PaymentVerificationWithExtraAsync(string MerchantID, string Authority, int Amount, object userState) { + if ((this.PaymentVerificationWithExtraOperationCompleted == null)) { + this.PaymentVerificationWithExtraOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPaymentVerificationWithExtraOperationCompleted); + } + this.InvokeAsync("PaymentVerificationWithExtra", new object[] { + MerchantID, + Authority, + Amount}, this.PaymentVerificationWithExtraOperationCompleted, userState); + } + + private void OnPaymentVerificationWithExtraOperationCompleted(object arg) { + if ((this.PaymentVerificationWithExtraCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.PaymentVerificationWithExtraCompleted(this, new PaymentVerificationWithExtraCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#GetUnverifiedTransactions", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int GetUnverifiedTransactions(string MerchantID, out string Authorities) { + object[] results = this.Invoke("GetUnverifiedTransactions", new object[] { + MerchantID}); + Authorities = ((string)(results[1])); + return ((int)(results[0])); + } + + /// + public void GetUnverifiedTransactionsAsync(string MerchantID) { + this.GetUnverifiedTransactionsAsync(MerchantID, null); + } + + /// + public void GetUnverifiedTransactionsAsync(string MerchantID, object userState) { + if ((this.GetUnverifiedTransactionsOperationCompleted == null)) { + this.GetUnverifiedTransactionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUnverifiedTransactionsOperationCompleted); + } + this.InvokeAsync("GetUnverifiedTransactions", new object[] { + MerchantID}, this.GetUnverifiedTransactionsOperationCompleted, userState); + } + + private void OnGetUnverifiedTransactionsOperationCompleted(object arg) { + if ((this.GetUnverifiedTransactionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetUnverifiedTransactionsCompleted(this, new GetUnverifiedTransactionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("#RefreshAuthority", RequestNamespace="http://zarinpal.com/", ResponseNamespace="http://zarinpal.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute("Status")] + public int RefreshAuthority(string MerchantID, string Authority, int ExpireIn) { + object[] results = this.Invoke("RefreshAuthority", new object[] { + MerchantID, + Authority, + ExpireIn}); + return ((int)(results[0])); + } + + /// + public void RefreshAuthorityAsync(string MerchantID, string Authority, int ExpireIn) { + this.RefreshAuthorityAsync(MerchantID, Authority, ExpireIn, null); + } + + /// + public void RefreshAuthorityAsync(string MerchantID, string Authority, int ExpireIn, object userState) { + if ((this.RefreshAuthorityOperationCompleted == null)) { + this.RefreshAuthorityOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRefreshAuthorityOperationCompleted); + } + this.InvokeAsync("RefreshAuthority", new object[] { + MerchantID, + Authority, + ExpireIn}, this.RefreshAuthorityOperationCompleted, userState); + } + + private void OnRefreshAuthorityOperationCompleted(object arg) { + if ((this.RefreshAuthorityCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RefreshAuthorityCompleted(this, new RefreshAuthorityCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void PaymentRequestCompletedEventHandler(object sender, PaymentRequestCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class PaymentRequestCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal PaymentRequestCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + + /// + public string Authority { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void PaymentRequestWithExtraCompletedEventHandler(object sender, PaymentRequestWithExtraCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class PaymentRequestWithExtraCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal PaymentRequestWithExtraCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + + /// + public string Authority { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void PaymentVerificationCompletedEventHandler(object sender, PaymentVerificationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class PaymentVerificationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal PaymentVerificationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + + /// + public long RefID { + get { + this.RaiseExceptionIfNecessary(); + return ((long)(this.results[1])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void PaymentVerificationWithExtraCompletedEventHandler(object sender, PaymentVerificationWithExtraCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class PaymentVerificationWithExtraCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal PaymentVerificationWithExtraCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + + /// + public long RefID { + get { + this.RaiseExceptionIfNecessary(); + return ((long)(this.results[1])); + } + } + + /// + public string ExtraDetail { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[2])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void GetUnverifiedTransactionsCompletedEventHandler(object sender, GetUnverifiedTransactionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetUnverifiedTransactionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetUnverifiedTransactionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + + /// + public string Authorities { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + public delegate void RefreshAuthorityCompletedEventHandler(object sender, RefreshAuthorityCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1087.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RefreshAuthorityCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RefreshAuthorityCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Web References/ZarinPalWebService/Reference.map b/Web References/ZarinPalWebService/Reference.map new file mode 100644 index 0000000..cf01ee8 --- /dev/null +++ b/Web References/ZarinPalWebService/Reference.map @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file