-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
744d6bb
commit 559db38
Showing
28 changed files
with
14,028 additions
and
0 deletions.
There are no files selected for viewing
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,27 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.Rendering; | ||
using System.Collections.Generic; | ||
using Grand.Plugin.Payments.MOLPay.Models; | ||
|
||
namespace Grand.Plugin.Payments.MOLPay.Components | ||
{ | ||
[ViewComponent(Name = "MOLPay")] | ||
public class MOLPayComponent : ViewComponent | ||
{ | ||
public MOLPayComponent() { } | ||
|
||
public IViewComponentResult Invoke() | ||
{ | ||
var model = new PaymentInfoModel() | ||
{ | ||
ChannelTypes = new List<SelectListItem> | ||
{ | ||
new SelectListItem { Text = "Maybank2u", Value = "maybank2u" }, | ||
new SelectListItem { Text = "CIMB Clicks", Value = "cimbclicks" }, | ||
} | ||
}; | ||
|
||
return View("~/Plugins/Payments.MOLPay/Views/MOLPay/PaymentInfo.cshtml"); | ||
} | ||
} | ||
} |
552 changes: 552 additions & 0 deletions
552
Grand.Plugin.Payments.MOLPay/Controllers/MOLPayController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
Group: Payment methods | ||
FriendlyName: MOLPay | ||
SystemName: Payments.MOLPay | ||
Version: 1.00 | ||
SupportedVersions: 4.10 | ||
Author: Firdaus | ||
DisplayOrder: 1 | ||
FileName: Grand.Plugin.Payments.MOLPay.dll |
68 changes: 68 additions & 0 deletions
68
Grand.Plugin.Payments.MOLPay/Grand.Plugin.Payments.MOLPay.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,68 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<Copyright>Copyright © UNIT-SOFT Sp. z o.o.</Copyright> | ||
<Authors>UNIT-SOFT Sp. z o.o.</Authors> | ||
<Company>UNIT-SOFT Sp. z o.o.</Company> | ||
<PackageProjectUrl>https://grandnode.com/</PackageProjectUrl> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\..\Grand.Web\Plugins\Payments.MOLPay\</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath>..\..\Grand.Web\Plugins\Payments.MOLPay\</OutputPath> | ||
<OutDir>$(OutputPath)</OutDir> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Views\MOLPay\_ViewImports.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="Components\MOLPaycs.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Grand.Core\Grand.Core.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\Grand.Data\Grand.Data.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\Grand.Framework\Grand.Framework.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\Grand.Services\Grand.Services.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="System.Web"> | ||
<HintPath>System.Web</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
|
||
<ItemGroup> | ||
<None Update="Description.txt"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="logo.jpg"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Views\MOLPay\Configure.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Views\MOLPay\PaymentInfo.cshtml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</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,39 @@ | ||
using Grand.Core.Domain.Payments; | ||
|
||
namespace Grand.Plugin.Payments.MOLPay | ||
{ | ||
public class MOLPayHelper | ||
{ | ||
public static string OrderTotalSentToMOLPay => "OrderTotalSentToMOLPay"; | ||
|
||
/// <summary> | ||
/// Gets a payment status | ||
/// </summary> | ||
/// <param name="paymentStatus">PayPal payment status</param> | ||
/// <param name="pendingReason">PayPal pending reason</param> | ||
/// <returns>Payment status</returns> | ||
public static PaymentStatus GetPaymentStatus(string paymentStatus) | ||
{ | ||
var result = PaymentStatus.Pending; | ||
|
||
if (paymentStatus == null) | ||
paymentStatus = string.Empty; | ||
|
||
switch (paymentStatus) | ||
{ | ||
case "22": | ||
result = PaymentStatus.Pending; | ||
break; | ||
case "00": | ||
result = PaymentStatus.Paid; | ||
break; | ||
case "11": | ||
result = PaymentStatus.Voided; | ||
break; | ||
default: | ||
break; | ||
} | ||
return result; | ||
} | ||
} | ||
} |
Oops, something went wrong.