Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
FirdausShkr authored Apr 17, 2018
1 parent 744d6bb commit 559db38
Show file tree
Hide file tree
Showing 28 changed files with 14,028 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Grand.Plugin.Payments.MOLPay/Components/MOLPaycs.cs
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 Grand.Plugin.Payments.MOLPay/Controllers/MOLPayController.cs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Grand.Plugin.Payments.MOLPay/Description.txt
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 Grand.Plugin.Payments.MOLPay/Grand.Plugin.Payments.MOLPay.csproj
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>
39 changes: 39 additions & 0 deletions Grand.Plugin.Payments.MOLPay/MOLPayHelper.cs
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;
}
}
}
Loading

0 comments on commit 559db38

Please sign in to comment.