-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from appinlet/release/4.5.0
Nop 4.5
- Loading branch information
Showing
30 changed files
with
10,816 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+17 KB
Nop4.5/Nop.Plugin.Payments.PayGate/.vs/Nop.Plugin.Payments.PayGate/v16/.suo
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"" | ||
], | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
14 changes: 14 additions & 0 deletions
14
Nop4.5/Nop.Plugin.Payments.PayGate/Components/PaymentPayGateViewComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Nop.Web.Framework.Components; | ||
|
||
namespace Nop.Plugin.Payments.PayGate.Components | ||
{ | ||
[ViewComponent(Name = "PaymentPayGate")] | ||
public class PaymentPayGateViewComponent : NopViewComponent | ||
{ | ||
public IViewComponentResult Invoke() | ||
{ | ||
return View("~/Plugins/Payments.PayGate/Views/PaymentInfo.cshtml"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
form i.fa::before | ||
{ | ||
position: static !important; | ||
} |
553 changes: 553 additions & 0 deletions
553
Nop4.5/Nop.Plugin.Payments.PayGate/Controllers/PaymentPayGateController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
Nop4.5/Nop.Plugin.Payments.PayGate/Models/ConfigurationModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Nop.Web.Framework.Models; | ||
using Nop.Web.Framework.Mvc.ModelBinding; | ||
|
||
namespace Nop.Plugin.Payments.PayGate.Models | ||
{ | ||
public record ConfigurationModel : BaseNopModel | ||
{ | ||
public int ActiveStoreScopeConfiguration { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.TestMode")] | ||
public bool TestMode { get; set; } | ||
public bool TestMode_OverrideForStore { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.PayGateID")] | ||
public string PayGateID { get; set; } | ||
public bool PayGateID_OverrideForStore { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.EncryptionKey")] | ||
public string EncryptionKey { get; set; } | ||
public bool EncryptionKey_OverrideForStore { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.EnableIpn")] | ||
public bool EnableIpn { get; set; } | ||
public bool EnableIpn_OverrideForStore { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.EnableRedirect")] | ||
public bool EnableRedirect { get; set; } | ||
public bool EnableRedirect_OverrideForStore { get; set; } | ||
|
||
[NopResourceDisplayName("Plugins.Payments.PayGate.Fields.UseSSL")] | ||
public bool UseSSL { get; set; } | ||
public bool UseSSL_OverrideForStore { get; set; } | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
Nop4.5/Nop.Plugin.Payments.PayGate/Nop.Plugin.Payments.PayGate.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Copyright>Copyright © PayGate (Pty) Ltd</Copyright> | ||
<Company>PayGate (Pty) Ltd</Company> | ||
<Authors>App Inlet (Pty) Ltd</Authors> | ||
<Version>4.50</Version> | ||
<Description>This plugin allows paying with PayWeb v3</Description> | ||
<PackageLicenseUrl> | ||
</PackageLicenseUrl> | ||
<PackageProjectUrl>https://www.paygate.co.za/</PackageProjectUrl> | ||
<RepositoryUrl>https://developer.paygate.co.za/product/74</RepositoryUrl> | ||
<RepositoryType>Git</RepositoryType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Remove="Content\PayGate.css" /> | ||
<None Remove="logo.jpg" /> | ||
<None Remove="plugin.json" /> | ||
<None Remove="Views\Configure.cshtml" /> | ||
<None Remove="Views\PaymentInfo.cshtml" /> | ||
<None Remove="Views\_ViewImports.cshtml" /> | ||
</ItemGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath>..\..\Presentation\Nop.Web\Plugins\Payments.PayGate</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\..\Presentation\Nop.Web\Plugins\Payments.PayGate\</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="Content\PayGate.css"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="logo.jpg"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="plugin.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="Views\Configure.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="Views\PaymentInfo.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="Views\_ViewImports.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Presentation\Nop.Web.Framework\Nop.Web.Framework.csproj" /> | ||
</ItemGroup> | ||
<!-- This target execute after "Build" target --> | ||
<Target Name="NopTarget" AfterTargets="Build"> | ||
<!-- Delete unnecessary libraries from plugins path --> | ||
<MSBuild Projects="$(MSBuildProjectDirectory)\..\..\Build\ClearPluginAssemblies.proj" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" /> | ||
</Target> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
Nop4.5/Nop.Plugin.Payments.PayGate/Nop.Plugin.Payments.PayGate.csproj.user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ShowAllFiles>false</ShowAllFiles> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Important points when developing plugins | ||
|
||
|
||
- All views (cshtml files) and web.config file should have "Build action" set to "Content" and "Copy to output directory" set to "Copy if newer" | ||
|
||
- When you develop a new plugin from scratch, and when a new class library is added to the solution, open its .csproj file (a main project file) in any text editor and replace its content with the following one | ||
|
||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net461</TargetFramework> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath>..\..\Presentation\Nop.Web\Plugins\PLUGIN_OUTPUT_DIRECTORY</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\..\Presentation\Nop.Web\Plugins\PLUGIN_OUTPUT_DIRECTORY</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
<!-- This target execute after "Build" target --> | ||
<Target Name="NopTarget" AfterTargets="Build"> | ||
<!-- Delete unnecessary libraries from plugins path --> | ||
<MSBuild Projects="$(MSBuildProjectDirectory)\..\..\Build\ClearPluginAssemblies.proj" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" /> | ||
</Target> | ||
</Project> | ||
|
||
Replace “PLUGIN_OUTPUT_DIRECTORY” in the code above with your real plugin output directory name. | ||
|
||
It’s not required. But this way we can use a new ASP.NET approach to add third-party references. It was introduced in .NET Core. Furthermore, references from already referenced libraries will be loaded automatically. It’s very convenient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Text; | ||
using Nop.Core.Domain.Payments; | ||
|
||
namespace Nop.Plugin.Payments.PayGate | ||
{ | ||
/// <summary> | ||
/// Represents pagate helper | ||
/// </summary> | ||
public class PayGateHelper | ||
{ | ||
/// <summary> | ||
/// Gets a payment status | ||
/// </summary> | ||
/// <param name="paymentStatus">PayGate payment status</param> | ||
/// <param name="pendingReason">PayGate pending reason</param> | ||
/// <returns>Payment status</returns> | ||
public static PaymentStatus GetPaymentStatus(string paymentStatus, string pendingReason) | ||
{ | ||
var result = PaymentStatus.Pending; | ||
|
||
return result; | ||
} | ||
|
||
public string CalculateMD5Hash(string input) | ||
{ | ||
|
||
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); | ||
|
||
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input); | ||
|
||
byte[] hash = md5.ComputeHash(inputBytes); | ||
|
||
// step 2, convert byte array to hex string | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
|
||
for (int i = 0; i < hash.Length; i++) | ||
{ | ||
sb.Append(hash[i].ToString("X2")); | ||
} | ||
return sb.ToString(); | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.