Browse Source

Complete basic payment feature

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

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

@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.5.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.5.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />

1
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs

@ -26,7 +26,6 @@ namespace EasyAbp.EShop.Orders
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Order, OrderEto>(typeof(EShopOrdersDomainModule));
options.EtoMappings.Add<OrderLine, OrderLineEto>(typeof(EShopOrdersDomainModule));
});
}
}

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

@ -0,0 +1,11 @@
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderPaymentCompletedEventHandler : IDistributedEventHandler<EntityUpdatedEto<PaymentEto>>
{
}
}

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

@ -0,0 +1,11 @@
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderPaymentCreatedEventHandler : IDistributedEventHandler<EntityCreatedEto<PaymentEto>>
{
}
}

22
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs

@ -34,6 +34,8 @@ namespace EasyAbp.EShop.Orders.Orders
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
public virtual Guid? PaymentId { get; protected set; }
public virtual DateTime? PaidTime { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
@ -92,5 +94,25 @@ namespace EasyAbp.EShop.Orders.Orders
{
ReducedInventoryAfterPaymentTime = time;
}
public void SetPaymentId(Guid? paymentId)
{
PaymentId = paymentId;
}
public void SetPaidTime(DateTime? paidTime)
{
PaidTime = paidTime;
}
public void SetOrderStatus(OrderStatus orderStatus)
{
OrderStatus = orderStatus;
}
public void SetCompletionTime(DateTime? completionTime)
{
CompletionTime = completionTime;
}
}
}

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

@ -0,0 +1,48 @@
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Timing;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderPaymentCompletedEventHandler : IOrderPaymentCompletedEventHandler, ITransientDependency
{
private readonly IClock _clock;
private readonly IOrderRepository _orderRepository;
public OrderPaymentCompletedEventHandler(
IClock clock,
IOrderRepository orderRepository)
{
_clock = clock;
_orderRepository = orderRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EntityUpdatedEto<PaymentEto> eventData)
{
if (!eventData.Entity.CompletionTime.HasValue)
{
return;
}
foreach (var item in eventData.Entity.PaymentItems.Where(item => item.ItemType == "EasyAbpEShopOrder"))
{
var order = await _orderRepository.FindAsync(item.ItemKey);
if (order == null || order.PaidTime.HasValue)
{
continue;
}
order.SetPaidTime(_clock.Now);
order.SetOrderStatus(OrderStatus.Processing);
await _orderRepository.UpdateAsync(order, true);
}
}
}
}

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

@ -0,0 +1,37 @@
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Payments;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderPaymentCreatedEventHandler : IOrderPaymentCreatedEventHandler, ITransientDependency
{
private readonly IOrderRepository _orderRepository;
public OrderPaymentCreatedEventHandler(IOrderRepository orderRepository)
{
_orderRepository = orderRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EntityCreatedEto<PaymentEto> eventData)
{
foreach (var item in eventData.Entity.PaymentItems.Where(item => item.ItemType == "EasyAbpEShopOrder"))
{
var order = await _orderRepository.FindAsync(item.ItemKey);
if (order == null || order.PaymentId.HasValue)
{
continue;
}
order.SetPaymentId(eventData.Entity.Id);
await _orderRepository.UpdateAsync(order, true);
}
}
}
}

17
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js

@ -1,6 +1,6 @@
$(function () {
var l = abp.localization.getResource('Orders');
var l = abp.localization.getResource('EasyAbpEShopOrders');
var service = easyAbp.eShop.orders.orders.order;
@ -21,7 +21,7 @@ $(function () {
{
text: l('Detail'),
action: function (data) {
editModal.open({ id: data.record.id });
detailModal.open({ id: data.record.id });
}
}
]
@ -32,17 +32,4 @@ $(function () {
{ data: "totalPrice" },
]
}));
createModal.onResult(function () {
dataTable.ajax.reload();
});
editModal.onResult(function () {
dataTable.ajax.reload();
});
$('#NewOrderButton').click(function (e) {
e.preventDefault();
createModal.open();
});
});

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

@ -1,19 +0,0 @@
using EasyAbp.EShop.Payments.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace EasyAbp.EShop.Payments.Authorization
{
public class PaymentsPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
//var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<PaymentsResource>(name);
}
}
}

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

@ -1,14 +0,0 @@
using Volo.Abp.Reflection;
namespace EasyAbp.EShop.Payments.Authorization
{
public class PaymentsPermissions
{
public const string GroupName = "EasyAbp.EShop.Payments";
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(PaymentsPermissions));
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

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

@ -0,0 +1,29 @@
using EasyAbp.EShop.Payments.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace EasyAbp.EShop.Payments.Authorization
{
public class PaymentsPermissionDefinitionProvider : PermissionDefinitionProvider
{
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"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<PaymentsResource>(name);
}
}
}

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

@ -0,0 +1,30 @@
using Volo.Abp.Reflection;
namespace EasyAbp.EShop.Payments.Authorization
{
public class PaymentsPermissions
{
public const string GroupName = "EasyAbp.EShop.Payments";
public static string[] GetAll()
{
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";
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EShopPaymentsApplicationContractsModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs

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

@ -0,0 +1,20 @@
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

@ -0,0 +1,19 @@
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; }
}
}

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

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid>
{
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

@ -0,0 +1,22 @@
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

@ -0,0 +1,18 @@
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

@ -0,0 +1,31 @@
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

@ -0,0 +1,24 @@
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

@ -0,0 +1,18 @@
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>
{
}
}

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

@ -4,12 +4,13 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.5.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="2.5.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EShopPaymentsApplicationModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs

45
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/EShopOrderPaymentAuthorizer.cs

@ -0,0 +1,45 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Payments
{
public class EShopOrderPaymentAuthorizer : IPaymentAuthorizer, ITransientDependency
{
private readonly ICurrentUser _currentUser;
private readonly IOrderAppService _orderAppService;
public EShopOrderPaymentAuthorizer(
ICurrentUser currentUser,
IOrderAppService orderAppService)
{
_currentUser = currentUser;
_orderAppService = orderAppService;
}
public virtual async Task<bool> IsPaymentItemAllowedAsync(Payment payment, PaymentItem paymentItem,
Dictionary<string, object> inputExtraProperties)
{
if (paymentItem.ItemType != "EasyAbpEShopOrder")
{
return false;
}
var order = await _orderAppService.GetAsync(paymentItem.ItemKey);
if (order.CustomerUserId != _currentUser.Id)
{
return false;
}
if (order.TotalPrice != paymentItem.OriginalPaymentAmount)
{
return false;
}
return order.OrderStatus == OrderStatus.Pending;
}
}
}

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

@ -0,0 +1,11 @@
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

@ -0,0 +1,13 @@
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.")
{
}
}
}

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

@ -0,0 +1,107 @@
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;
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 async Task<PaymentDto> CreateAsync(CreatePaymentDto input)
{
await CheckCreatePolicyAsync();
var providerType = await _paymentServiceResolver.GetProviderTypeOrDefaultAsync(input.PaymentMethod);
var provider = ServiceProvider.GetService(providerType) as IPaymentServiceProvider;
if (providerType == null || provider == null)
{
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, input.PaymentMethod, input.Currency,
paymentItems.Select(item => item.OriginalPaymentAmount).Sum(), paymentItems);
await Repository.InsertAsync(payment, autoSave: true);
await CheckPayableAsync(payment, input.ExtraProperties);
await FillPayeeAccountAsync(payment, input.ExtraProperties);
// Todo: payment discount
await provider.PayAsync(payment);
return MapToGetOutputDto(payment);
}
protected virtual async Task FillPayeeAccountAsync(Payment payment, Dictionary<string, object> inputExtraProperties)
{
payment.SetPayeeAccount(
await _paymentPayeeAccountProvider.GetPayeeAccountAsync(payment, inputExtraProperties));
}
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

@ -0,0 +1,19 @@
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")
{
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/PaymentsAppService.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsAppService.cs

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

@ -0,0 +1,23 @@
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
{
public class PaymentsApplicationAutoMapperProfile : Profile
{
public PaymentsApplicationAutoMapperProfile()
{
/* 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

@ -0,0 +1,18 @@
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;
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,8 +12,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\Payments\*.json" />
<Content Remove="Localization\Payments\*.json" />
<EmbeddedResource Include="EasyAbp\EShop\Payments\Localization\Payments\*.json" />
<Content Remove="EasyAbp\EShop\Payments\Localization\Payments\*.json" />
</ItemGroup>
</Project>

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EShopPaymentsDomainSharedModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs

@ -17,7 +17,7 @@ namespace EasyAbp.EShop.Payments
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<EShopPaymentsDomainSharedModule>("EasyAbp.EShop.Payments");
options.FileSets.AddEmbedded<EShopPaymentsDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
@ -25,12 +25,12 @@ namespace EasyAbp.EShop.Payments
options.Resources
.Add<PaymentsResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/Payments");
.AddVirtualJson("/EasyAbp/EShop/Payments/Localization/Payments");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Payments", typeof(PaymentsResource));
options.MapCodeNamespace("EasyAbp.EShop.Payments", typeof(PaymentsResource));
});
}
}

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

@ -0,0 +1,47 @@
{
"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}?"
}
}

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

@ -0,0 +1,48 @@
{
"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}?"
}
}

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

@ -0,0 +1,47 @@
{
"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}?"
}
}

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

@ -0,0 +1,47 @@
{
"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}?"
}
}

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

@ -0,0 +1,48 @@
{
"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}?"
}
}

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

@ -0,0 +1,48 @@
{
"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}?"
}
}

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

@ -0,0 +1,47 @@
{
"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}?"
}
}

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

@ -0,0 +1,48 @@
{
"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}?"
}
}

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

@ -0,0 +1,48 @@
{
"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}?"
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/Localization/PaymentsResource.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/PaymentsResource.cs

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

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace EasyAbp.EShop.Payments.Payments
{
[Serializable]
public class PaymentEto
{
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

@ -0,0 +1,24 @@
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; }
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/PaymentsErrorCodes.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/PaymentsErrorCodes.cs

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

@ -1,6 +0,0 @@
{
"culture": "cs",
"texts": {
}
}

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

@ -1,6 +0,0 @@
{
"culture": "en",
"texts": {
"ManageYourProfile": "Manage your profile"
}
}

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

@ -1,6 +0,0 @@
{
"culture": "pl",
"texts": {
}
}

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

@ -1,6 +0,0 @@
{
"culture": "pt-BR",
"texts": {
}
}

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

@ -1,6 +0,0 @@
{
"culture": "sl",
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom"
}
}

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

@ -1,6 +0,0 @@
{
"culture": "tr",
"texts": {
"ManageYourProfile": "Profil yönetimi"
}
}

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

@ -1,6 +0,0 @@
{
"culture": "vi",
"texts": {
}
}

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

@ -1,6 +0,0 @@
{
"culture": "zh-Hans",
"texts": {
"ManageYourProfile": "管理个人资料"
}
}

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

@ -1,6 +0,0 @@
{
"culture": "zh-Hant",
"texts": {
"ManageYourProfile": "管理個人資料"
}
}

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

@ -4,10 +4,11 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.5.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.5.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EShopPaymentsDomainModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs

@ -2,11 +2,14 @@
using EasyAbp.EShop.Stores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.AutoMapper;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(AbpAutoMapperModule),
typeof(EShopPaymentsDomainSharedModule),
typeof(EShopStoresDomainSharedModule)
)]
@ -18,5 +21,20 @@ namespace EasyAbp.EShop.Payments
resolver.TryRegisterProviderAsync(FreePaymentServiceProvider.PaymentMethod, typeof(FreePaymentServiceProvider));
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<EShopPaymentsDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<PaymentsDomainAutoMapperProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Payment, PaymentEto>(typeof(EShopPaymentsDomainModule));
});
}
}
}

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

@ -0,0 +1,33 @@
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
{
[Dependency(ServiceLifetime.Transient, TryRegister = true)]
public class FreePaymentServiceProvider : IPaymentServiceProvider
{
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> extraProperties = null)
{
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

@ -0,0 +1,10 @@
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

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

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/Payments/IPaymentServiceProvider.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceProvider.cs

@ -6,6 +6,6 @@ namespace EasyAbp.EShop.Payments.Payments
{
public interface IPaymentServiceProvider
{
Task<Payment> PayForOrderAsync(Payment payment, Dictionary<string, object> extraProperties = null);
Task<Payment> PayAsync(Payment payment, Dictionary<string, object> extraProperties = null);
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/Payments/IPaymentServiceResolver.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/IPaymentServiceResolver.cs

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

@ -0,0 +1,12 @@
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}.")
{
}
}
}

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

@ -0,0 +1,97 @@
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; }
[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,
[NotNull] string paymentMethod,
[NotNull] string currency,
decimal originalPaymentAmount,
List<PaymentItem> paymentItems
) :base(id)
{
TenantId = tenantId;
PaymentMethod = paymentMethod;
Currency = currency;
OriginalPaymentAmount = originalPaymentAmount;
PaymentItems = paymentItems;
}
public void SetPayeeAccount([NotNull] string payeeAccount)
{
PayeeAccount = payeeAccount;
}
public void SetExternalTradingCode([NotNull] string externalTradingCode)
{
CheckPaymentIsNotCompleted();
ExternalTradingCode = externalTradingCode;
}
public void SetPaymentDiscount(
decimal paymentDiscount,
decimal actualPaymentAmount,
decimal refundAmount)
{
CheckPaymentIsNotCompleted();
PaymentDiscount = paymentDiscount;
ActualPaymentAmount = actualPaymentAmount;
RefundAmount = refundAmount;
}
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

@ -0,0 +1,13 @@
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

@ -0,0 +1,53 @@
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

@ -0,0 +1,36 @@
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;
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/Payments/PaymentServiceResolver.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentServiceResolver.cs

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

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

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/PaymentsDbProperties.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDbProperties.cs

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/PaymentsApplicationAutoMapperProfile.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs

@ -1,14 +1,17 @@
using AutoMapper;
using EasyAbp.EShop.Payments.Payments;
namespace EasyAbp.EShop.Payments
{
public class PaymentsApplicationAutoMapperProfile : Profile
public class PaymentsDomainAutoMapperProfile : Profile
{
public PaymentsApplicationAutoMapperProfile()
public PaymentsDomainAutoMapperProfile()
{
/* 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

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

32
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/Refunds/Refund.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs

@ -1,4 +1,4 @@
using System;
using System;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
@ -30,5 +30,33 @@ namespace EasyAbp.EShop.Payments.Refunds
[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/Settings/PaymentsSettingDefinitionProvider.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettingDefinitionProvider.cs

@ -9,6 +9,10 @@ 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/Settings/PaymentsSettings.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Settings/PaymentsSettings.cs

@ -7,5 +7,13 @@
/* 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";
}
}
}

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

@ -1,23 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
namespace EasyAbp.EShop.Payments.Payments
{
[Dependency(ServiceLifetime.Transient, TryRegister = true)]
public class FreePaymentServiceProvider : IPaymentServiceProvider
{
public const string PaymentMethod = "Free";
public FreePaymentServiceProvider()
{
}
public async Task<Payment> PayForOrderAsync(Payment payment, Dictionary<string, object> extraProperties = null)
{
throw new System.NotImplementedException();
}
}
}

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

@ -1,32 +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; }
[NotNull]
public virtual string PaymentMethod { get; protected set; }
[NotNull]
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 List<PaymentOrder> PaymentOrders { get; protected set; }
}
}

22
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/Payments/PaymentOrder.cs

@ -1,22 +0,0 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentOrder : FullAuditedEntity<Guid>
{
public virtual Guid OrderId { 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; }
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,4 +12,8 @@
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="EasyAbp\EShop\Payments" />
</ItemGroup>
</Project>

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

@ -1,4 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Payments.Payments;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
@ -17,7 +19,9 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Add custom repositories here. Example:
* options.AddRepository<Question, EfCoreQuestionRepository>();
*/
options.AddRepository<Payment, PaymentRepository>();
options.AddRepository<Refund, RefundRepository>();
});
}
}
}
}

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EntityFrameworkCore/IPaymentsDbContext.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs

@ -1,5 +1,8 @@
using Volo.Abp.Data;
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
{
@ -9,5 +12,8 @@ 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; }
}
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EntityFrameworkCore/PaymentsDbContext.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs

@ -1,6 +1,8 @@
using Microsoft.EntityFrameworkCore;
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
{
@ -10,6 +12,9 @@ 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)
@ -24,4 +29,4 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
builder.ConfigurePayments();
}
}
}
}

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

@ -0,0 +1,76 @@
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.EShop.Payments.Payments;
using System;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
public static class PaymentsDbContextModelCreatingExtensions
{
public static void ConfigurePayments(
this ModelBuilder builder,
Action<PaymentsModelBuilderConfigurationOptions> optionsAction = null)
{
Check.NotNull(builder, nameof(builder));
var options = new PaymentsModelBuilderConfigurationOptions(
PaymentsDbProperties.DbTablePrefix,
PaymentsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
/* Configure all entities here. Example:
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + "Questions", options.Schema);
b.ConfigureByConvention();
//Properties
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Relations
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
//Indexes
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)");
});
}
}
}

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EntityFrameworkCore/PaymentsModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsModelBuilderConfigurationOptions.cs

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

@ -0,0 +1,14 @@
using System;
using EasyAbp.EShop.Payments.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)
{
}
}
}

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

@ -0,0 +1,14 @@
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)
{
}
}
}

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

@ -1,43 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
public static class PaymentsDbContextModelCreatingExtensions
{
public static void ConfigurePayments(
this ModelBuilder builder,
Action<PaymentsModelBuilderConfigurationOptions> optionsAction = null)
{
Check.NotNull(builder, nameof(builder));
var options = new PaymentsModelBuilderConfigurationOptions(
PaymentsDbProperties.DbTablePrefix,
PaymentsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
/* Configure all entities here. Example:
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + "Questions", options.Schema);
b.ConfigureByConvention();
//Properties
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Relations
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
//Indexes
b.HasIndex(q => q.CreationTime);
});
*/
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EShopPaymentsHttpApiClientModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EShopPaymentsHttpApiModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/PaymentsController.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/PaymentsController.cs

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Payments</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,4 +12,8 @@
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="EasyAbp\EShop\Payments" />
</ItemGroup>
</Project>

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/MongoDB/EShopPaymentsMongoDbModule.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/MongoDB/IPaymentsMongoDbContext.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/IPaymentsMongoDbContext.cs

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/MongoDB/PaymentsMongoDbContext.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContext.cs

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/MongoDB/PaymentsMongoDbContextExtensions.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs

0
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/MongoDB/PaymentsMongoModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoModelBuilderConfigurationOptions.cs

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

@ -39,4 +39,10 @@
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Pages\Payments\PaymentOrder\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Payments\Payment\Index.cshtml" />
<_ContentIncludedByDefault Remove="Pages\Refunds\Refund\Index.cshtml" />
</ItemGroup>
</Project>

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

Loading…
Cancel
Save