Browse Source

Close #35: Use EasyAbp.PaymentService

pull/49/head
gdlcf88 6 years ago
parent
commit
eb381966ad
  1. 2
      modules/EasyAbp.EShop.Baskets/common.props
  2. 2
      modules/EasyAbp.EShop.Orders/common.props
  3. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs
  4. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs
  5. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs
  6. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs
  7. 2
      modules/EasyAbp.EShop.Payments/common.props
  8. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj
  9. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs
  10. 16
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs
  11. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs
  12. 20
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreatePaymentDto.cs
  13. 19
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreatePaymentItemDto.cs
  14. 29
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs
  15. 22
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs
  16. 18
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs
  17. 31
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateRefundDto.cs
  18. 24
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs
  19. 18
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs
  20. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj
  21. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs
  22. 11
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/IPaymentAuthorizer.cs
  23. 13
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/MultiCurrencyNotSupportedException.cs
  24. 123
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs
  25. 19
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentItemNotPayableException.cs
  26. 14
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsAppService.cs
  27. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs
  28. 18
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs
  29. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs
  30. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj
  31. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs
  32. 42
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json
  33. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json
  34. 42
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json
  35. 42
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json
  36. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json
  37. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json
  38. 42
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json
  39. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json
  40. 44
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json
  41. 33
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/PaymentEto.cs
  42. 24
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/PaymentItemEto.cs
  43. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  44. 25
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs
  45. 18
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/CurrencyNotSupportedException.cs
  46. 36
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/FreePaymentServiceProvider.cs
  47. 10
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentPayeeAccountProvider.cs
  48. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs
  49. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceProvider.cs
  50. 15
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceResolver.cs
  51. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PayeeAccountNotFoundException.cs
  52. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PayeeConfigurationMissingValueException.cs
  53. 99
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs
  54. 13
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentHasAlreadyBeenCompletedException.cs
  55. 53
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs
  56. 36
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentPayeeAccountProvider.cs
  57. 51
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentServiceResolver.cs
  58. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/UnknownPaymentMethodException.cs
  59. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs
  60. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs
  61. 62
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs
  62. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettingDefinitionProvider.cs
  63. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettings.cs
  64. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj
  65. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs
  66. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs
  67. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs
  68. 38
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs
  69. 21
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs
  70. 14
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs
  71. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj
  72. 7
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs
  73. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj
  74. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs
  75. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj
  76. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs
  77. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs
  78. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj
  79. 46
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml
  80. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs
  81. 0
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.css
  82. 39
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js
  83. 51
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/Index.cshtml
  84. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/Index.cshtml.cs
  85. 0
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/index.css
  86. 26
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/index.js
  87. 47
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml
  88. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs
  89. 0
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.css
  90. 39
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js
  91. 26
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs
  92. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs
  93. 26
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs
  94. 26
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs
  95. 23
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs
  96. 23
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs
  97. 31
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs
  98. 31
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs
  99. 2
      modules/EasyAbp.EShop.Products/common.props
  100. 2
      modules/EasyAbp.EShop.Stores/common.props

2
modules/EasyAbp.EShop.Baskets/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.11</Version>
<Version>0.1.12</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

2
modules/EasyAbp.EShop.Orders/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.11</Version>
<Version>0.1.12</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs

@ -1,4 +1,4 @@
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs

@ -1,4 +1,4 @@
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs

@ -1,6 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.MultiTenancy;

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs

@ -1,6 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.MultiTenancy;

2
modules/EasyAbp.EShop.Payments/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.11</Version>
<Version>0.1.12</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.1.3" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Authorization" Version="2.7.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs

@ -8,17 +8,7 @@ namespace EasyAbp.EShop.Payments.Authorization
{
public override void Define(IPermissionDefinitionContext context)
{
var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments"));
var payment = moduleGroup.AddPermission(PaymentsPermissions.Payments.Default, L("Permission:Payment"));
payment.AddChild(PaymentsPermissions.Payments.Manage, L("Permission:Manage"));
payment.AddChild(PaymentsPermissions.Payments.CrossStore, L("Permission:CrossStore"));
payment.AddChild(PaymentsPermissions.Payments.Create, L("Permission:Create"));
var refund = moduleGroup.AddPermission(PaymentsPermissions.Refunds.Default, L("Permission:Refund"));
refund.AddChild(PaymentsPermissions.Refunds.Manage, L("Permission:Manage"));
refund.AddChild(PaymentsPermissions.Refunds.CrossStore, L("Permission:CrossStore"));
refund.AddChild(PaymentsPermissions.Refunds.Create, L("Permission:Create"));
// var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments"));
}
private static LocalizableString L(string name)

16
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs

@ -10,21 +10,5 @@ namespace EasyAbp.EShop.Payments.Authorization
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(PaymentsPermissions));
}
public class Payments
{
public const string Default = GroupName + ".Payment";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
public const string Create = Default + ".Create";
}
public class Refunds
{
public const string Default = GroupName + ".Refund";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
public const string Create = Default + ".Create";
}
}
}

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.Application;
using EasyAbp.PaymentService;
using Volo.Abp.Application;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using Volo.Abp.Authorization;
@ -8,7 +9,8 @@ namespace EasyAbp.EShop.Payments
[DependsOn(
typeof(EShopPaymentsDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
typeof(AbpAuthorizationModule),
typeof(PaymentServiceApplicationContractsModule)
)]
public class EShopPaymentsApplicationContractsModule : AbpModule
{

20
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreatePaymentDto.cs

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class CreatePaymentDto
{
[DisplayName("PaymentPaymentMethod")]
public string PaymentMethod { get; set; }
[DisplayName("PaymentCurrency")]
public string Currency { get; set; }
[DisplayName("PaymentExtraProperties")]
public Dictionary<string, object> ExtraProperties { get; set; }
[DisplayName("PaymentItem")]
public List<CreatePaymentItemDto> PaymentItems { get; set; }
}
}

19
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreatePaymentItemDto.cs

@ -1,19 +0,0 @@
using System;
using System.ComponentModel;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class CreatePaymentItemDto
{
[DisplayName("PaymentItemItemType")]
public string ItemType { get; set; }
[DisplayName("PaymentItemItemKey")]
public Guid ItemKey { get; set; }
[DisplayName("PaymentItemCurrency")]
public string Currency { get; set; }
[DisplayName("PaymentItemOriginalPaymentAmount")]
public decimal OriginalPaymentAmount { get; set; }
}
}

29
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs

@ -1,29 +0,0 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid>
{
public Guid UserId { get; set; }
public string PaymentMethod { get; set; }
public string ExternalTradingCode { get; set; }
public string Currency { get; set; }
public decimal OriginalPaymentAmount { get; set; }
public decimal PaymentDiscount { get; set; }
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
public DateTime? CompletionTime { get; set; }
public List<PaymentItemDto> PaymentItems { get; set; }
}
}

22
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs

@ -1,22 +0,0 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentItemDto : FullAuditedEntityDto<Guid>
{
public string ItemType { get; set; }
public Guid ItemKey { get; set; }
public string Currency { get; set; }
public decimal OriginalPaymentAmount { get; set; }
public decimal PaymentDiscount { get; set; }
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
}
}

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs

@ -1,18 +0,0 @@
using System;
using EasyAbp.EShop.Payments.Payments.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentAppService :
ICrudAppService<
PaymentDto,
Guid,
PagedAndSortedResultRequestDto,
CreatePaymentDto,
object>
{
}
}

31
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateRefundDto.cs

@ -1,31 +0,0 @@
using System;
using System.ComponentModel;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class CreateRefundDto
{
[DisplayName("RefundStoreId")]
public Guid StoreId { get; set; }
[DisplayName("RefundOrderId")]
public Guid OrderId { get; set; }
[DisplayName("RefundRefundPaymentMethod")]
public string RefundPaymentMethod { get; set; }
[DisplayName("RefundExternalTradingCode")]
public string ExternalTradingCode { get; set; }
[DisplayName("RefundCurrency")]
public string Currency { get; set; }
[DisplayName("RefundRefundAmount")]
public decimal RefundAmount { get; set; }
[DisplayName("RefundCustomerRemark")]
public string CustomerRemark { get; set; }
[DisplayName("RefundStaffRemark")]
public string StaffRemark { get; set; }
}
}

24
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs

@ -1,24 +0,0 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class RefundDto : FullAuditedEntityDto<Guid>
{
public Guid StoreId { get; set; }
public Guid OrderId { get; set; }
public string RefundPaymentMethod { get; set; }
public string ExternalTradingCode { get; set; }
public string Currency { get; set; }
public decimal RefundAmount { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
}
}

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs

@ -1,18 +0,0 @@
using System;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Payments.Refunds
{
public interface IRefundAppService :
ICrudAppService<
RefundDto,
Guid,
PagedAndSortedResultRequestDto,
CreateRefundDto,
object>
{
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.1.3" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="2.7.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.PaymentService;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
@ -9,7 +10,8 @@ namespace EasyAbp.EShop.Payments
typeof(EShopPaymentsDomainModule),
typeof(EShopPaymentsApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
typeof(AbpAutoMapperModule),
typeof(PaymentServiceApplicationModule)
)]
public class EShopPaymentsApplicationModule : AbpModule
{

11
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/IPaymentAuthorizer.cs

@ -1,11 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentAuthorizer
{
Task<bool> IsPaymentItemAllowedAsync(Payment payment, PaymentItem paymentItem,
Dictionary<string, object> inputExtraProperties);
}
}

13
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/MultiCurrencyNotSupportedException.cs

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class MultiCurrencyNotSupportedException : BusinessException
{
public MultiCurrencyNotSupportedException() : base(message: $"Multi-currency is not supported.")
{
}
}
}

123
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs

@ -1,123 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments.Dtos;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentAppService : CrudAppService<Payment, PaymentDto, Guid, PagedAndSortedResultRequestDto, CreatePaymentDto, object>,
IPaymentAppService
{
private readonly IPaymentPayeeAccountProvider _paymentPayeeAccountProvider;
private readonly IPaymentServiceResolver _paymentServiceResolver;
private readonly IPaymentRepository _repository;
public PaymentAppService(
IPaymentPayeeAccountProvider paymentPayeeAccountProvider,
IPaymentServiceResolver paymentServiceResolver,
IPaymentRepository repository) : base(repository)
{
_paymentPayeeAccountProvider = paymentPayeeAccountProvider;
_paymentServiceResolver = paymentServiceResolver;
_repository = repository;
}
public override Task<PaymentDto> GetAsync(Guid id)
{
// Todo: Check permission.
return base.GetAsync(id);
}
public override Task<PagedResultDto<PaymentDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
// Todo: Check permission.
return base.GetListAsync(input);
}
public override async Task<PaymentDto> CreateAsync(CreatePaymentDto input)
{
await CheckCreatePolicyAsync();
var providerType = _paymentServiceResolver.GetProviderTypeOrDefault(input.PaymentMethod) ??
throw new UnknownPaymentMethodException(input.PaymentMethod);
var provider = ServiceProvider.GetService(providerType) as IPaymentServiceProvider ??
throw new UnknownPaymentMethodException(input.PaymentMethod);
var paymentItems = input.PaymentItems.Select(inputPaymentItem =>
new PaymentItem(GuidGenerator.Create(), inputPaymentItem.ItemType, inputPaymentItem.ItemKey,
inputPaymentItem.Currency, inputPaymentItem.OriginalPaymentAmount)).ToList();
if (paymentItems.Select(item => item.Currency).Any(c => c != input.Currency))
{
throw new MultiCurrencyNotSupportedException();
}
var payment = new Payment(GuidGenerator.Create(), CurrentTenant.Id, CurrentUser.GetId(),
input.PaymentMethod, input.Currency, paymentItems.Select(item => item.OriginalPaymentAmount).Sum(),
paymentItems);
await Repository.InsertAsync(payment, autoSave: true);
await CheckPayableAsync(payment, input.ExtraProperties);
var payeeConfigurations = await GetPayeeConfigurationsAsync(payment, input.ExtraProperties);
// Todo: payment discount
await provider.PayAsync(payment, input.ExtraProperties, payeeConfigurations);
return MapToGetOutputDto(payment);
}
protected virtual Task<Dictionary<string, object>> GetPayeeConfigurationsAsync(Payment payment,
Dictionary<string, object> inputExtraProperties)
{
// Todo: use payee configurations provider.
// Todo: get store side payee configurations.
var payeeConfigurations = new Dictionary<string, object>();
return Task.FromResult(payeeConfigurations);
}
protected virtual async Task CheckPayableAsync(Payment payment, Dictionary<string, object> inputExtraProperties)
{
var itemSet = new HashSet<PaymentItem>(payment.PaymentItems);
foreach (var authorizer in ServiceProvider.GetServices<IPaymentAuthorizer>())
{
foreach (var item in itemSet.ToList())
{
if (await authorizer.IsPaymentItemAllowedAsync(payment, item, inputExtraProperties))
{
itemSet.Remove(item);
}
}
}
if (!itemSet.IsNullOrEmpty())
{
throw new PaymentItemNotPayableException(itemSet.Select(item => item.ItemKey).ToList());
}
}
[RemoteService(false)]
public override Task<PaymentDto> UpdateAsync(Guid id, object input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task DeleteAsync(Guid id)
{
throw new NotSupportedException();
}
}
}

19
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentItemNotPayableException.cs

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentItemNotPayableException : BusinessException
{
public PaymentItemNotPayableException(Guid itemKey) : base(
message: $"Payment item ({itemKey}) is not payable")
{
}
public PaymentItemNotPayableException(IEnumerable<Guid> itemKeys) : base(
message: $"Payment item ({itemKeys.JoinAsString(", ")}) is not payable")
{
}
}
}

14
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsAppService.cs

@ -1,14 +0,0 @@
using EasyAbp.EShop.Payments.Localization;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Payments
{
public abstract class PaymentsAppService : ApplicationService
{
protected PaymentsAppService()
{
LocalizationResource = typeof(PaymentsResource);
ObjectMapperContext = typeof(EShopPaymentsApplicationModule);
}
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs

@ -1,9 +1,4 @@
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Payments.Dtos;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using AutoMapper;
using Volo.Abp.AutoMapper;
namespace EasyAbp.EShop.Payments
{
@ -14,10 +9,6 @@ namespace EasyAbp.EShop.Payments
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Payment, PaymentDto>();
CreateMap<Refund, RefundDto>();
CreateMap<CreateRefundDto, Refund>(MemberList.Source);
CreateMap<PaymentItem, PaymentItemDto>();
}
}
}

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs

@ -1,18 +0,0 @@
using System;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundAppService : CrudAppService<Refund, RefundDto, Guid, PagedAndSortedResultRequestDto, CreateRefundDto, object>,
IRefundAppService
{
private readonly IRefundRepository _repository;
public RefundAppService(IRefundRepository repository) : base(repository)
{
_repository = repository;
}
}
}

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/EShopOrderPaymentAuthorizer.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs

@ -5,7 +5,7 @@ using EasyAbp.EShop.Orders.Orders;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Payments
namespace EasyAbp.PaymentService.Payments
{
public class EShopOrderPaymentAuthorizer : IPaymentAuthorizer, ITransientDependency
{
@ -40,7 +40,7 @@ namespace EasyAbp.EShop.Payments.Payments
return false;
}
if (!order.ReducedInventoryAfterPlacingTime.HasValue)
if (order.ReducedInventoryAfterPlacingTime.HasValue)
{
return false;
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.1.3" />
<PackageReference Include="Volo.Abp.Validation" Version="2.7.0" />
</ItemGroup>

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs

@ -1,6 +1,7 @@
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using EasyAbp.EShop.Payments.Localization;
using EasyAbp.PaymentService;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
@ -9,7 +10,8 @@ using Volo.Abp.VirtualFileSystem;
namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(AbpValidationModule)
typeof(AbpValidationModule),
typeof(PaymentServiceDomainSharedModule)
)]
public class EShopPaymentsDomainSharedModule : AbpModule
{

42
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json

@ -1,47 +1,5 @@
{
"culture": "cs",
"texts": {
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json

@ -1,48 +1,6 @@
{
"culture": "en",
"texts": {
"ManageYourProfile": "Manage your profile",
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
"ManageYourProfile": "Manage your profile"
}
}

42
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json

@ -1,47 +1,5 @@
{
"culture": "pl",
"texts": {
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
}
}

42
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json

@ -1,47 +1,5 @@
{
"culture": "pt-BR",
"texts": {
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json

@ -1,48 +1,6 @@
{
"culture": "sl",
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom",
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
"ManageYourProfile": "Upravljajte svojim profilom"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json

@ -1,48 +1,6 @@
{
"culture": "tr",
"texts": {
"ManageYourProfile": "Profil y�netimi",
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
"ManageYourProfile": "Profil y�netimi"
}
}

42
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json

@ -1,47 +1,5 @@
{
"culture": "vi",
"texts": {
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json

@ -1,48 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"ManageYourProfile": "管理个人资料",
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
"ManageYourProfile": "管理个人资料"
}
}

44
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json

@ -1,48 +1,6 @@
{
"culture": "zh-Hant",
"texts": {
"ManageYourProfile": "管理個人資料",
"Menu:Payment": "MenuPayment",
"Payment": "Payment",
"PaymentTenantId": "PaymentTenantId",
"PaymentPaymentMethod": "PaymentPaymentMethod",
"PaymentExternalTradingCode": "PaymentExternalTradingCode",
"PaymentCurrency": "PaymentCurrency",
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount",
"PaymentExtraProperties": "PaymentExtraProperties",
"PaymentPaymentDiscount": "PaymentPaymentDiscount",
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount",
"PaymentRefundAmount": "PaymentRefundAmount",
"PaymentCompletionTime": "PaymentCompletionTime",
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"Menu:Refund": "MenuRefund",
"Refund": "Refund",
"RefundTenantId": "RefundTenantId",
"RefundStoreId": "RefundStoreId",
"RefundOrderId": "RefundOrderId",
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod",
"RefundExternalTradingCode": "RefundExternalTradingCode",
"RefundCurrency": "RefundCurrency",
"RefundRefundAmount": "RefundRefundAmount",
"RefundCustomerRemark": "RefundCustomerRemark",
"RefundStaffRemark": "RefundStaffRemark",
"CreateRefund": "CreateRefund",
"EditRefund": "EditRefund",
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?",
"Menu:PaymentItem": "MenuPaymentItem",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"CreatePaymentItem": "CreatePaymentItem",
"EditPaymentItem": "EditPaymentItem",
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?"
"ManageYourProfile": "管理個人資料"
}
}

33
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/PaymentEto.cs

@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
namespace EasyAbp.EShop.Payments.Payments
{
[Serializable]
public class PaymentEto
{
public Guid UserId { get; set; }
public Guid Id { get; set; }
public Guid? TenantId { get; set; }
public string PaymentMethod { get; set; }
public string ExternalTradingCode { get; set; }
public string Currency { get; set; }
public decimal OriginalPaymentAmount { get; set; }
public decimal PaymentDiscount { get; set; }
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
public DateTime? CompletionTime { get; set; }
public List<PaymentItemEto> PaymentItems { get; set; }
}
}

24
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/PaymentItemEto.cs

@ -1,24 +0,0 @@
using System;
namespace EasyAbp.EShop.Payments.Payments
{
[Serializable]
public class PaymentItemEto
{
public Guid Id { get; set; }
public string ItemType { get; set; }
public Guid ItemKey { get; set; }
public string Currency { get; set; }
public decimal OriginalPaymentAmount { get; set; }
public decimal PaymentDiscount { get; set; }
public decimal ActualPaymentAmount { get; set; }
public decimal RefundAmount { get; set; }
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="0.1.3" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.7.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />

25
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs

@ -1,10 +1,7 @@
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Stores;
using EasyAbp.EShop.Stores;
using EasyAbp.PaymentService;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp;
using Volo.Abp.AutoMapper;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
namespace EasyAbp.EShop.Payments
@ -12,20 +9,11 @@ namespace EasyAbp.EShop.Payments
[DependsOn(
typeof(AbpAutoMapperModule),
typeof(EShopPaymentsDomainSharedModule),
typeof(EShopStoresDomainSharedModule)
typeof(EShopStoresDomainSharedModule),
typeof(PaymentServiceDomainModule)
)]
public class EShopPaymentsDomainModule : AbpModule
{
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
var resolver = context.ServiceProvider.GetService<IPaymentServiceResolver>();
if (resolver.GetPaymentMethods().Count == 0)
{
resolver.TryRegisterProvider(FreePaymentServiceProvider.PaymentMethod, typeof(FreePaymentServiceProvider));
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<EShopPaymentsDomainModule>();
@ -34,11 +22,6 @@ namespace EasyAbp.EShop.Payments
{
options.AddProfile<PaymentsDomainAutoMapperProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Payment, PaymentEto>(typeof(EShopPaymentsDomainModule));
});
}
}
}

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/CurrencyNotSupportedException.cs

@ -1,18 +0,0 @@
using System;
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class CurrencyNotSupportedException : BusinessException
{
public CurrencyNotSupportedException(string paymentMethod, string currency) : base(
message: $"Payment method {paymentMethod} does not support currency: {currency}")
{
}
public CurrencyNotSupportedException(string paymentMethod, string currency, Guid storeId) : base(
message: $"Payment method {paymentMethod} in store {storeId} does not support currency: {currency}")
{
}
}
}

36
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/FreePaymentServiceProvider.cs

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Timing;
namespace EasyAbp.EShop.Payments.Payments
{
public class FreePaymentServiceProvider : IPaymentServiceProvider, ITransientDependency
{
private readonly IClock _clock;
private readonly IPaymentRepository _paymentRepository;
public const string PaymentMethod = "Free";
public FreePaymentServiceProvider(
IClock clock,
IPaymentRepository paymentRepository)
{
_clock = clock;
_paymentRepository = paymentRepository;
}
public async Task<Payment> PayAsync(Payment payment, Dictionary<string, object> inputExtraProperties,
Dictionary<string, object> payeeConfigurations)
{
payment.SetPayeeAccount("None");
payment.SetExternalTradingCode(payment.Id.ToString());
payment.CompletePayment(_clock.Now);
return await _paymentRepository.UpdateAsync(payment, true);
}
}
}

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentPayeeAccountProvider.cs

@ -1,10 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentPayeeAccountProvider
{
Task<string> GetPayeeAccountAsync(Payment payment, Dictionary<string, object> inputExtraProperties);
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentRepository.cs

@ -1,9 +0,0 @@
using System;
using Volo.Abp.Domain.Repositories;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentRepository : IRepository<Payment, Guid>
{
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceProvider.cs

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentServiceProvider
{
Task<Payment> PayAsync(Payment payment, Dictionary<string, object> inputExtraProperties,
Dictionary<string, object> payeeConfigurations);
}
}

15
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceResolver.cs

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentServiceResolver
{
bool TryRegisterProvider(string paymentMethod, Type providerType);
List<string> GetPaymentMethods();
Type GetProviderTypeOrDefault(string paymentMethod);
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PayeeAccountNotFoundException.cs

@ -1,12 +0,0 @@
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class PayeeAccountNotFoundException : BusinessException
{
public PayeeAccountNotFoundException(string paymentMethod) : base(
message: $"Cannot find the payee account of payment method {paymentMethod}.")
{
}
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PayeeConfigurationMissingValueException.cs

@ -1,12 +0,0 @@
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class PayeeConfigurationMissingValueException : BusinessException
{
public PayeeConfigurationMissingValueException(string paymentMethod, string configurationKey) : base(
message: $"Payment method ({paymentMethod}) is missing configuration: {configurationKey}.")
{
}
}
}

99
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs

@ -1,99 +0,0 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Payments.Payments
{
public class Payment : FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid UserId { get; protected set; }
[NotNull]
public virtual string PaymentMethod { get; protected set; }
[CanBeNull]
public virtual string PayeeAccount { get; protected set; }
[CanBeNull]
public virtual string ExternalTradingCode { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal OriginalPaymentAmount { get; protected set; }
public virtual decimal PaymentDiscount { get; protected set; }
public virtual decimal ActualPaymentAmount { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
public virtual List<PaymentItem> PaymentItems { get; protected set; }
protected Payment()
{
PaymentItems = new List<PaymentItem>();
}
public Payment(
Guid id,
Guid? tenantId,
Guid userId,
[NotNull] string paymentMethod,
[NotNull] string currency,
decimal originalPaymentAmount,
List<PaymentItem> paymentItems
) :base(id)
{
TenantId = tenantId;
UserId = userId;
PaymentMethod = paymentMethod;
Currency = currency;
OriginalPaymentAmount = originalPaymentAmount;
ActualPaymentAmount = originalPaymentAmount;
PaymentItems = paymentItems;
RefundAmount = 0;
}
public void SetPayeeAccount([NotNull] string payeeAccount)
{
PayeeAccount = payeeAccount;
}
public void SetExternalTradingCode([NotNull] string externalTradingCode)
{
CheckPaymentIsNotCompleted();
ExternalTradingCode = externalTradingCode;
}
public void SetPaymentDiscount(decimal paymentDiscount)
{
CheckPaymentIsNotCompleted();
PaymentDiscount = paymentDiscount;
ActualPaymentAmount -= paymentDiscount;
}
public void CompletePayment(DateTime completionTime)
{
CheckPaymentIsNotCompleted();
CompletionTime = completionTime;
}
private void CheckPaymentIsNotCompleted()
{
if (CompletionTime.HasValue)
{
throw new PaymentHasAlreadyBeenCompletedException(Id);
}
}
}
}

13
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentHasAlreadyBeenCompletedException.cs

@ -1,13 +0,0 @@
using System;
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentHasAlreadyBeenCompletedException : BusinessException
{
public PaymentHasAlreadyBeenCompletedException(Guid id) : base(
message: $"Payment ({id}) has already been completed.")
{
}
}
}

53
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs

@ -1,53 +0,0 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentItem : FullAuditedEntity<Guid>
{
[NotNull]
public virtual string ItemType { get; protected set; }
public virtual Guid ItemKey { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal OriginalPaymentAmount { get; protected set; }
public virtual decimal PaymentDiscount { get; protected set; }
public virtual decimal ActualPaymentAmount { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
protected PaymentItem()
{
}
public PaymentItem(
Guid id,
[NotNull] string itemType,
Guid itemKey,
[NotNull] string currency,
decimal originalPaymentAmount
) :base(id)
{
ItemType = itemType;
ItemKey = itemKey;
Currency = currency;
OriginalPaymentAmount = originalPaymentAmount;
}
public void CompletePayment(
decimal paymentDiscount,
decimal actualPaymentAmount,
decimal refundAmount)
{
PaymentDiscount = paymentDiscount;
ActualPaymentAmount = actualPaymentAmount;
RefundAmount = refundAmount;
}
}
}

36
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentPayeeAccountProvider.cs

@ -1,36 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Settings;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Settings;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentPayeeAccountProvider : IPaymentPayeeAccountProvider, ITransientDependency
{
private readonly IPaymentRepository _paymentRepository;
private readonly ISettingProvider _settingProvider;
public PaymentPayeeAccountProvider(
IPaymentRepository paymentRepository,
ISettingProvider settingProvider)
{
_paymentRepository = paymentRepository;
_settingProvider = settingProvider;
}
public async Task<string> GetPayeeAccountAsync(Payment payment, Dictionary<string, object> inputExtraProperties)
{
// Todo: support multi-store.
var payeeAccount = await _settingProvider.GetOrNullAsync(
PaymentsSettings.GroupName + "." + payment.PaymentMethod + ".DefaultPayeeAccount");
if (payeeAccount == null)
{
throw new PayeeAccountNotFoundException(payment.PaymentMethod);
}
return payeeAccount;
}
}
}

51
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentServiceResolver.cs

@ -1,51 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentServiceResolver : IPaymentServiceResolver, ISingletonDependency
{
protected readonly Dictionary<string, Type> Providers = new Dictionary<string, Type>();
private readonly IServiceProvider _serviceProvider;
public PaymentServiceResolver(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
}
public virtual bool TryRegisterProvider(string paymentMethod, Type providerType)
{
if (Providers.ContainsKey(paymentMethod))
{
return false;
}
using (var scope = _serviceProvider.CreateScope())
{
if (scope.ServiceProvider.GetService(providerType) == null)
{
return false;
}
}
Providers.Add(paymentMethod, providerType);
return true;
}
public virtual List<string> GetPaymentMethods()
{
return Providers.Keys.ToList();
}
public virtual Type GetProviderTypeOrDefault(string paymentMethod)
{
return Providers.GetOrDefault(paymentMethod);
}
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/UnknownPaymentMethodException.cs

@ -1,12 +0,0 @@
using Volo.Abp;
namespace EasyAbp.EShop.Payments.Payments
{
public class UnknownPaymentMethodException : BusinessException
{
public UnknownPaymentMethodException(string paymentMethod) : base(
message: $"Payment method {paymentMethod} does not exist.")
{
}
}
}

3
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs

@ -1,5 +1,4 @@
using AutoMapper;
using EasyAbp.EShop.Payments.Payments;
namespace EasyAbp.EShop.Payments
{
@ -10,8 +9,6 @@ namespace EasyAbp.EShop.Payments
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Payment, PaymentEto>();
CreateMap<PaymentItem, PaymentItemEto>();
}
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs

@ -1,9 +0,0 @@
using System;
using Volo.Abp.Domain.Repositories;
namespace EasyAbp.EShop.Payments.Refunds
{
public interface IRefundRepository : IRepository<Refund, Guid>
{
}
}

62
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs

@ -1,62 +0,0 @@
using System;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Payments.Refunds
{
public class Refund : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }
[NotNull]
public virtual string RefundPaymentMethod { get; protected set; }
[NotNull]
public virtual string ExternalTradingCode { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
[CanBeNull]
public virtual string CustomerRemark { get; protected set; }
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
protected Refund()
{
}
public Refund(
Guid id,
Guid? tenantId,
Guid storeId,
Guid orderId,
string refundPaymentMethod,
string externalTradingCode,
string currency,
decimal refundAmount,
string customerRemark,
string staffRemark
) :base(id)
{
TenantId = tenantId;
StoreId = storeId;
OrderId = orderId;
RefundPaymentMethod = refundPaymentMethod;
ExternalTradingCode = externalTradingCode;
Currency = currency;
RefundAmount = refundAmount;
CustomerRemark = customerRemark;
StaffRemark = staffRemark;
}
}
}

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettingDefinitionProvider.cs

@ -9,10 +9,6 @@ namespace EasyAbp.EShop.Payments.Settings
/* Define module settings here.
* Use names from PaymentsSettings class.
*/
context.Add(
new SettingDefinition(PaymentsSettings.FreePaymentMethod.DefaultPayeeAccount, "None")
);
}
}
}

8
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettings.cs

@ -7,13 +7,5 @@
/* Add constants for setting names. Example:
* public const string MySettingName = GroupName + ".MySettingName";
*/
public static class FreePaymentMethod
{
private const string PaymentMethodName = GroupName + ".Free";
public const string DefaultPayeeAccount = PaymentMethodName + ".DefaultPayeeAccount";
}
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.EntityFrameworkCore" Version="0.1.3" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="2.7.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

8
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs

@ -1,5 +1,4 @@
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
@ -8,7 +7,8 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
[DependsOn(
typeof(EShopPaymentsDomainModule),
typeof(AbpEntityFrameworkCoreModule)
typeof(AbpEntityFrameworkCoreModule),
typeof(PaymentServiceEntityFrameworkCoreModule)
)]
public class EShopPaymentsEntityFrameworkCoreModule : AbpModule
{
@ -19,8 +19,6 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Add custom repositories here. Example:
* options.AddRepository<Question, EfCoreQuestionRepository>();
*/
options.AddRepository<Payment, PaymentRepository>();
options.AddRepository<Refund, RefundRepository>();
});
}
}

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs

@ -1,8 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
@ -12,8 +9,5 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
DbSet<Payment> Payments { get; set; }
DbSet<Refund> Refunds { get; set; }
DbSet<PaymentItem> PaymentItems { get; set; }
}
}

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs

@ -1,8 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
@ -12,9 +10,6 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
public DbSet<Payment> Payments { get; set; }
public DbSet<Refund> Refunds { get; set; }
public DbSet<PaymentItem> PaymentItems { get; set; }
public PaymentsDbContext(DbContextOptions<PaymentsDbContext> options)
: base(options)

38
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs

@ -1,9 +1,7 @@
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Payments.Payments;
using System;
using EasyAbp.PaymentService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
@ -41,36 +39,10 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
b.HasIndex(q => q.CreationTime);
});
*/
builder.Entity<Payment>(b =>
{
b.ToTable(options.TablePrefix + "Payments", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(18,6)");
b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(18,6)");
b.Property(x => x.PaymentDiscount).HasColumnType("decimal(18,6)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)");
});
builder.Entity<Refund>(b =>
{
b.ToTable(options.TablePrefix + "Refunds", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)");
});
builder.Entity<PaymentItem>(b =>
{
b.ToTable(options.TablePrefix + "PaymentItems", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
b.Property(x => x.ActualPaymentAmount).HasColumnType("decimal(18,6)");
b.Property(x => x.OriginalPaymentAmount).HasColumnType("decimal(18,6)");
b.Property(x => x.PaymentDiscount).HasColumnType("decimal(18,6)");
b.Property(x => x.RefundAmount).HasColumnType("decimal(18,6)");
});
// Configure dependent module
builder.ConfigurePaymentService();
}
}
}

21
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Payments/PaymentRepository.cs

@ -1,21 +0,0 @@
using System;
using System.Linq;
using EasyAbp.EShop.Payments.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentRepository : EfCoreRepository<PaymentsDbContext, Payment, Guid>, IPaymentRepository
{
public PaymentRepository(IDbContextProvider<PaymentsDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public override IQueryable<Payment> WithDetails()
{
return base.WithDetails().Include(x => x.PaymentItems);
}
}
}

14
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs

@ -1,14 +0,0 @@
using System;
using EasyAbp.EShop.Payments.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundRepository : EfCoreRepository<PaymentsDbContext, Refund, Guid>, IRefundRepository
{
public RefundRepository(IDbContextProvider<PaymentsDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.1.3" />
<PackageReference Include="Volo.Abp.Http.Client" Version="2.7.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

7
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.PaymentService;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
@ -6,7 +7,9 @@ namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(EShopPaymentsApplicationContractsModule),
typeof(AbpHttpClientModule))]
typeof(AbpHttpClientModule),
typeof(PaymentServiceHttpApiClientModule)
)]
public class EShopPaymentsHttpApiClientModule : AbpModule
{
public const string RemoteServiceName = "Payments";

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.1.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="2.7.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs

@ -1,5 +1,6 @@
using Localization.Resources.AbpUi;
using EasyAbp.EShop.Payments.Localization;
using EasyAbp.PaymentService;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -9,7 +10,9 @@ namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(EShopPaymentsApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
typeof(AbpAspNetCoreMvcModule),
typeof(PaymentServiceHttpApiModule)
)]
public class EShopPaymentsHttpApiModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.MongoDB" Version="0.1.3" />
<PackageReference Include="Volo.Abp.MongoDB" Version="2.7.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

8
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.PaymentService.MongoDB;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.MongoDB;
@ -6,8 +7,9 @@ namespace EasyAbp.EShop.Payments.MongoDB
{
[DependsOn(
typeof(EShopPaymentsDomainModule),
typeof(AbpMongoDbModule)
)]
typeof(AbpMongoDbModule),
typeof(PaymentServiceMongoDbModule)
)]
public class EShopPaymentsMongoDbModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.EShop.Payments.Localization;
using EasyAbp.PaymentService.Web;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AutoMapper;
@ -13,8 +14,9 @@ namespace EasyAbp.EShop.Payments.Web
[DependsOn(
typeof(EShopPaymentsHttpApiModule),
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAutoMapperModule)
)]
typeof(AbpAutoMapperModule),
typeof(PaymentServiceWebModule)
)]
public class EShopPaymentsWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj

@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.1.3" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.7.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="2.7.0" />
</ItemGroup>
@ -43,6 +44,9 @@
<_ContentIncludedByDefault Remove="Pages\Payments\PaymentOrder\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Payments\Payment\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Refunds\Refund\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\EShop\Payments\Payments\PaymentOrder\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\EShop\Payments\Payments\Payment\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\EShop\Payments\Refunds\Refund\Index.cshtml" />
</ItemGroup>
</Project>

46
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml

@ -1,46 +0,0 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage
@model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment.IndexModel
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = L["Payment"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Payment"].Value);
PageLayout.Content.MenuItemName = "Payment";
}
@section scripts
{
<abp-script src="/Pages/EShop/Payments/Payments/Payment/index.js" />
}
@section styles
{
<abp-style src="/Pages/EShop/Payments/Payments/Payment/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Payment"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="PaymentTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["PaymentPaymentMethod"]</th>
<th>@L["PaymentExternalTradingCode"]</th>
<th>@L["PaymentCurrency"]</th>
<th>@L["PaymentOriginalPaymentAmount"]</th>
<th>@L["PaymentPaymentDiscount"]</th>
<th>@L["PaymentActualPaymentAmount"]</th>
<th>@L["PaymentRefundAmount"]</th>
<th>@L["PaymentCompletionTime"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment
{
public class IndexModel : PaymentsPageModel
{
public async Task OnGetAsync()
{
await Task.CompletedTask;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.css

39
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/index.js

@ -1,39 +0,0 @@
$(function () {
var l = abp.localization.getResource('EasyAbpEShopPayments');
var service = easyAbp.eShop.payments.payments.payment;
var dataTable = $('#PaymentTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('PaymentItem'),
action: function (data) {
}
}
]
}
},
{ data: "paymentMethod" },
{ data: "externalTradingCode" },
{ data: "currency" },
{ data: "originalPaymentAmount" },
{ data: "paymentDiscount" },
{ data: "actualPaymentAmount" },
{ data: "refundAmount" },
{ data: "completionTime" },
]
}));
});

51
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/Index.cshtml

@ -1,51 +0,0 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage
@model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentOrder.IndexModel
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = L["PaymentItem"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:PaymentItem"].Value);
PageLayout.Content.MenuItemName = "PaymentItem";
}
@section scripts
{
<abp-script src="/Pages/Payments/PaymentItem/index.js" />
}
@section styles
{
<abp-style src="/Pages/Payments/PaymentItem/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["PaymentItem"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
<abp-button id="NewPaymentItemButton"
text="@L["CreatePaymentItem"].Value"
icon="plus"
button-type="Primary" />
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="PaymentItemTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["PaymentItemItemType"]</th>
<th>@L["PaymentItemItemKey"]</th>
<th>@L["PaymentItemCurrency"]</th>
<th>@L["PaymentItemOriginalPaymentAmount"]</th>
<th>@L["PaymentItemPaymentDiscount"]</th>
<th>@L["PaymentItemActualPaymentAmount"]</th>
<th>@L["PaymentItemRefundAmount"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/Index.cshtml.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentOrder
{
public class IndexModel : PaymentsPageModel
{
public async Task OnGetAsync()
{
await Task.CompletedTask;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/index.css

26
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/PaymentOrder/index.js

@ -1,26 +0,0 @@
$(function () {
var l = abp.localization.getResource('EasyAbpEShopPayments');
var service = easyAbp.eShop.payments.payments.PaymentItem;
var dataTable = $('#PaymentItemTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{ data: "itemType" },
{ data: "itemKey" },
{ data: "currency" },
{ data: "originalPaymentAmount" },
{ data: "paymentDiscount" },
{ data: "actualPaymentAmount" },
{ data: "refundAmount" },
]
}));
});

47
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml

@ -1,47 +0,0 @@
@page
@using EasyAbp.EShop.Payments.Web.Pages.Refunds.Refund
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage
@model IndexModel
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = L["Refund"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Refund"].Value);
PageLayout.Content.MenuItemName = "Refund";
}
@section scripts
{
<abp-script src="/Pages/EShop/Payments/Refunds/Refund/index.js" />
}
@section styles
{
<abp-style src="/Pages/EShop/Payments/Refunds/Refund/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Refund"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="RefundTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["RefundStoreId"]</th>
<th>@L["RefundOrderId"]</th>
<th>@L["RefundRefundPaymentMethod"]</th>
<th>@L["RefundExternalTradingCode"]</th>
<th>@L["RefundCurrency"]</th>
<th>@L["RefundRefundAmount"]</th>
<th>@L["RefundCustomerRemark"]</th>
<th>@L["RefundStaffRemark"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs

@ -1,12 +0,0 @@
using System.Threading.Tasks;
namespace EasyAbp.EShop.Payments.Web.Pages.Refunds.Refund
{
public class IndexModel : PaymentsPageModel
{
public async Task OnGetAsync()
{
await Task.CompletedTask;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.css

39
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/index.js

@ -1,39 +0,0 @@
$(function () {
var l = abp.localization.getResource('EasyAbpEShopPayments');
var service = easyAbp.eShop.payments.refunds.refund;
var dataTable = $('#RefundTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Detail'),
action: function (data) {
}
},
]
}
},
{ data: "storeId" },
{ data: "orderId" },
{ data: "refundPaymentMethod" },
{ data: "externalTradingCode" },
{ data: "currency" },
{ data: "refundAmount" },
{ data: "customerRemark" },
{ data: "staffRemark" },
]
}));
});

26
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs

@ -27,33 +27,7 @@ namespace EasyAbp.EShop.Payments.Web
private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<PaymentsResource>>(); //Add main menu items.
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
var paymentManagementMenuItem = new ApplicationMenuItem("PaymentManagement", l["Menu:PaymentManagement"]);
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Payments.Manage))
{
paymentManagementMenuItem.AddItem(
new ApplicationMenuItem("Payment", l["Menu:Payment"], "/EShop/Payments/Payments/Payment")
);
}
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Refunds.Manage))
{
paymentManagementMenuItem.AddItem(
new ApplicationMenuItem("Refund", l["Menu:Refund"], "/EShop/Payments/Refunds/Refund")
);
}
if (!paymentManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop",
() => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"]));
eShopMenuItem.Items.Add(paymentManagementMenuItem);
}
}
}
}

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs

@ -1,5 +1,3 @@
using EasyAbp.EShop.Payments.Payments.Dtos;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using AutoMapper;
namespace EasyAbp.EShop.Payments.Web
@ -11,9 +9,6 @@ namespace EasyAbp.EShop.Payments.Web
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<PaymentDto, CreatePaymentDto>();
CreateMap<RefundDto, CreateRefundDto>();
CreateMap<PaymentItemDto, CreatePaymentItemDto>();
}
}
}

26
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Payments/PaymentAppServiceTests.cs

@ -1,26 +0,0 @@
using Shouldly;
using System.Threading.Tasks;
using Xunit;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentAppServiceTests : PaymentsApplicationTestBase
{
private readonly IPaymentAppService _paymentAppService;
public PaymentAppServiceTests()
{
_paymentAppService = GetRequiredService<IPaymentAppService>();
}
[Fact]
public async Task Test1()
{
// Arrange
// Act
// Assert
}
}
}

26
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Application.Tests/Refunds/RefundAppServiceTests.cs

@ -1,26 +0,0 @@
using Shouldly;
using System.Threading.Tasks;
using Xunit;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundAppServiceTests : PaymentsApplicationTestBase
{
private readonly IRefundAppService _refundAppService;
public RefundAppServiceTests()
{
_refundAppService = GetRequiredService<IRefundAppService>();
}
[Fact]
public async Task Test1()
{
// Arrange
// Act
// Assert
}
}
}

23
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Payments/PaymentDomainTests.cs

@ -1,23 +0,0 @@
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentDomainTests : PaymentsDomainTestBase
{
public PaymentDomainTests()
{
}
[Fact]
public async Task Test1()
{
// Arrange
// Assert
// Assert
}
}
}

23
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.Domain.Tests/Refunds/RefundDomainTests.cs

@ -1,23 +0,0 @@
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundDomainTests : PaymentsDomainTestBase
{
public RefundDomainTests()
{
}
[Fact]
public async Task Test1()
{
// Arrange
// Assert
// Assert
}
}
}

31
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Payments/PaymentRepositoryTests.cs

@ -1,31 +0,0 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.Domain.Repositories;
using Xunit;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Payments
{
public class PaymentRepositoryTests : PaymentsEntityFrameworkCoreTestBase
{
private readonly IRepository<Payment, Guid> _paymentRepository;
public PaymentRepositoryTests()
{
_paymentRepository = GetRequiredService<IRepository<Payment, Guid>>();
}
[Fact]
public async Task Test1()
{
await WithUnitOfWorkAsync(async () =>
{
// Arrange
// Act
//Assert
});
}
}
}

31
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.EntityFrameworkCore.Tests/EntityFrameworkCore/Refunds/RefundRepositoryTests.cs

@ -1,31 +0,0 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Refunds;
using Volo.Abp.Domain.Repositories;
using Xunit;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Refunds
{
public class RefundRepositoryTests : PaymentsEntityFrameworkCoreTestBase
{
private readonly IRepository<Refund, Guid> _refundRepository;
public RefundRepositoryTests()
{
_refundRepository = GetRequiredService<IRepository<Refund, Guid>>();
}
[Fact]
public async Task Test1()
{
await WithUnitOfWorkAsync(async () =>
{
// Arrange
// Act
//Assert
});
}
}
}

2
modules/EasyAbp.EShop.Products/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.11</Version>
<Version>0.1.12</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

2
modules/EasyAbp.EShop.Stores/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.11</Version>
<Version>0.1.12</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save