Browse Source

Close #40: Make Payment and Refund exclusive table entities

pull/49/head v0.2.1
gdlcf88 6 years ago
parent
commit
8b76e8cda7
  1. 2
      integration/EasyAbp.EShop/common.props
  2. 2
      modules/EasyAbp.EShop.Baskets/common.props
  3. 2
      modules/EasyAbp.EShop.Orders/common.props
  4. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj
  5. 10
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs
  6. 19
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs
  7. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs
  8. 8
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs
  9. 2
      modules/EasyAbp.EShop.Payments/common.props
  10. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj
  11. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/EShopPaymentsApplicationContractsModule.cs
  12. 27
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentDto.cs
  13. 23
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/PaymentItemDto.cs
  14. 19
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/RefundDto.cs
  15. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj
  16. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/EShopPaymentsApplicationModule.cs
  17. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs
  18. 74
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs
  19. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj
  20. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/EShopPaymentsDomainSharedModule.cs
  21. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/cs.json
  22. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/en.json
  23. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pl.json
  24. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/pt-BR.json
  25. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/sl.json
  26. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/tr.json
  27. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/vi.json
  28. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hans.json
  29. 8
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Localization/Payments/zh-Hant.json
  30. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  31. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs
  32. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs
  33. 35
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs
  34. 50
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs
  35. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs
  36. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj
  37. 29
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs
  38. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs
  39. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/IPaymentsDbContext.cs
  40. 17
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs
  41. 31
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs
  42. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj
  43. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp/EShop/Payments/EShopPaymentsHttpApiClientModule.cs
  44. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj
  45. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp/EShop/Payments/EShopPaymentsHttpApiModule.cs
  46. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj
  47. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/EShopPaymentsMongoDbModule.cs
  48. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs
  49. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EShopPaymentsWebModule.cs
  50. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj
  51. 2
      modules/EasyAbp.EShop.Products/common.props
  52. 2
      modules/EasyAbp.EShop.Stores/common.props
  53. 3
      samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj
  54. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs
  55. 3
      samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj
  56. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs
  57. 3
      samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj
  58. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs
  59. 3
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj
  60. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs
  61. 3367
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs
  62. 143
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs
  63. 250
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs
  64. 3
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj
  65. 2
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs
  66. 3
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj
  67. 2
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs
  68. 3
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj
  69. 2
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs
  70. 3
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj
  71. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs

2
integration/EasyAbp.EShop/common.props

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

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

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.2.0</Version>
<Version>0.2.1</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.2.0</Version>
<Version>0.2.1</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.Domain.csproj

@ -8,9 +8,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.2.1" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.8.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" />

10
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs

@ -0,0 +1,10 @@
using System.Threading.Tasks;
using EasyAbp.PaymentService.Payments;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderPaymentChecker
{
Task<bool> IsValidPaymentAsync(Order order, PaymentEto paymentEto);
}
}

19
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs

@ -0,0 +1,19 @@
using System;
using System.Threading.Tasks;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderPaymentChecker : IOrderPaymentChecker, ITransientDependency
{
public Task<bool> IsValidPaymentAsync(Order order, PaymentEto paymentEto)
{
return Task.FromResult(
Guid.TryParse(paymentEto.GetProperty<string>("StoreId"), out var paymentStoreId) &&
order.StoreId == paymentStoreId
);
}
}
}

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

@ -13,15 +13,18 @@ namespace EasyAbp.EShop.Orders.Orders
{
private readonly IClock _clock;
private readonly ICurrentTenant _currentTenant;
private readonly IOrderPaymentChecker _orderPaymentChecker;
private readonly IOrderRepository _orderRepository;
public OrderPaymentCompletedEventHandler(
IClock clock,
ICurrentTenant currentTenant,
IOrderPaymentChecker orderPaymentChecker,
IOrderRepository orderRepository)
{
_clock = clock;
_currentTenant = currentTenant;
_orderPaymentChecker = orderPaymentChecker;
_orderRepository = orderRepository;
}
@ -39,7 +42,8 @@ namespace EasyAbp.EShop.Orders.Orders
{
var order = await _orderRepository.FindAsync(item.ItemKey);
if (order == null || order.PaidTime.HasValue)
if (order == null || order.PaidTime.HasValue ||
!await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity))
{
continue;
}

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

@ -11,13 +11,16 @@ namespace EasyAbp.EShop.Orders.Orders
public class OrderPaymentCreatedEventHandler : IOrderPaymentCreatedEventHandler, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly IOrderPaymentChecker _orderPaymentChecker;
private readonly IOrderRepository _orderRepository;
public OrderPaymentCreatedEventHandler(
ICurrentTenant currentTenant,
IOrderPaymentChecker orderPaymentChecker,
IOrderRepository orderRepository)
{
_currentTenant = currentTenant;
_orderPaymentChecker = orderPaymentChecker;
_orderRepository = orderRepository;
}
@ -30,11 +33,12 @@ namespace EasyAbp.EShop.Orders.Orders
{
var order = await _orderRepository.FindAsync(item.ItemKey);
if (order == null || order.PaymentId.HasValue)
if (order == null || order.PaymentId.HasValue ||
!await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity))
{
continue;
}
order.SetPaymentId(eventData.Entity.Id);
await _orderRepository.UpdateAsync(order, true);

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

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.2.0</Version>
<Version>0.2.1</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,7 +8,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Authorization" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

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

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

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

@ -1,10 +1,33 @@
using System;
using PaymentServicePaymentDto = EasyAbp.PaymentService.Payments.Dtos.PaymentDto;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class PaymentDto : PaymentServicePaymentDto
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
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 DateTime? CancelledTime { get; set; }
public List<PaymentItemDto> PaymentItems { get; set; }
}
}

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

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
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; }
}
}

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

@ -1,11 +1,26 @@
using System;
using Volo.Abp.Application.Dtos;
using PaymentServiceRefundDto = EasyAbp.PaymentService.Refunds.Dtos.RefundDto;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class RefundDto : PaymentServiceRefundDto
public class RefundDto : FullAuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
public Guid PaymentId { get; set; }
public Guid PaymentItemId { 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; }
}
}

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

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

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

@ -10,8 +10,7 @@ namespace EasyAbp.EShop.Payments
typeof(EShopPaymentsDomainModule),
typeof(EShopPaymentsApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule),
typeof(PaymentServiceApplicationModule)
typeof(AbpAutoMapperModule)
)]
public class EShopPaymentsApplicationModule : AbpModule
{

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

@ -14,6 +14,7 @@ namespace EasyAbp.EShop.Payments
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Payment, PaymentDto>();
CreateMap<PaymentItem, PaymentItemDto>();
CreateMap<Refund, RefundDto>();
}
}

74
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs

@ -1,74 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
namespace EasyAbp.PaymentService.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;
}
if (!order.ReducedInventoryAfterPlacingTime.HasValue)
{
return false;
}
var inputStoreIdString = inputExtraProperties.GetOrDefault("StoreId") as string;
if (order.StoreId.ToString() != inputStoreIdString)
{
if (inputStoreIdString == null)
{
inputExtraProperties.Add("StoreId", order.StoreId);
}
else
{
return false;
}
}
if (order.OrderStatus != OrderStatus.Pending)
{
return false;
}
// Record the StoreId so EasyAbp.EShop.Payments.Payments.Payment entity can use it.
payment.SetProperty("StoreId", order.StoreId);
return true;
}
}
}

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

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

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

@ -1,7 +1,6 @@
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;
@ -10,8 +9,7 @@ using Volo.Abp.VirtualFileSystem;
namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(AbpValidationModule),
typeof(PaymentServiceDomainSharedModule)
typeof(AbpValidationModule)
)]
public class EShopPaymentsDomainSharedModule : AbpModule
{

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

@ -11,6 +11,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -12,6 +12,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -11,6 +11,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -11,6 +11,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -12,6 +12,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -12,6 +12,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -11,6 +11,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -12,6 +12,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

@ -12,6 +12,14 @@
"CreatePayment": "CreatePayment",
"EditPayment": "EditPayment",
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?",
"PaymentItem": "PaymentItem",
"PaymentItemItemType": "PaymentItemItemType",
"PaymentItemItemKey": "PaymentItemItemKey",
"PaymentItemCurrency": "PaymentItemCurrency",
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount",
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount",
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount",
"PaymentItemRefundAmount": "PaymentItemRefundAmount",
"SuccessfullyDeleted": "Successfully deleted",
"Permission:Refunds": "Refunds",
"Menu:Refunds": "MenuRefunds",

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

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

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

@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payments
typeof(AbpAutoMapperModule),
typeof(EShopPaymentsDomainSharedModule),
typeof(EShopStoresDomainSharedModule),
typeof(PaymentServiceDomainModule)
typeof(PaymentServiceDomainSharedModule)
)]
public class EShopPaymentsDomainModule : AbpModule
{

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

@ -3,10 +3,11 @@ using System.Collections.Generic;
using EasyAbp.PaymentService.Payments;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Payments.Payments
{
public class Payment : FullAuditedAggregateRoot<Guid>, IPayment
public class Payment : FullAuditedAggregateRoot<Guid>, IPayment, IMultiTenant
{
#region Base properties

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

@ -0,0 +1,35 @@
using System;
using EasyAbp.PaymentService.Payments;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentItem : FullAuditedEntity<Guid>, IPaymentItem
{
#region Base properties
[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; }
#endregion
private PaymentItem()
{
}
}
}

50
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs

@ -0,0 +1,50 @@
using System;
using System.Threading.Tasks;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.ObjectMapping;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentSynchronizer :
IDistributedEventHandler<EntityUpdatedEto<PaymentEto>>,
ITransientDependency
{
private readonly IObjectMapper _objectMapper;
private readonly IPaymentRepository _paymentRepository;
public PaymentSynchronizer(
IObjectMapper objectMapper,
IPaymentRepository paymentRepository)
{
_objectMapper = objectMapper;
_paymentRepository = paymentRepository;
}
public async Task HandleEventAsync(EntityUpdatedEto<PaymentEto> eventData)
{
var payment = await _paymentRepository.FindAsync(eventData.Entity.Id);
if (payment == null)
{
payment = _objectMapper.Map<PaymentEto, Payment>(eventData.Entity);
if (Guid.TryParse(eventData.Entity.GetProperty<string>("StoreId"), out var storeId))
{
payment.SetStoreId(storeId);
}
await _paymentRepository.InsertAsync(payment, true);
}
else
{
_objectMapper.Map(eventData.Entity, payment);
await _paymentRepository.UpdateAsync(payment, true);
}
}
}
}

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

@ -1,4 +1,7 @@
using AutoMapper;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.PaymentService.Payments;
using Volo.Abp.AutoMapper;
namespace EasyAbp.EShop.Payments
{
@ -9,6 +12,9 @@ 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<PaymentEto, Payment>(MemberList.Source).Ignore(x => x.StoreId);
CreateMap<PaymentItemEto, PaymentItem>(MemberList.Source);
}
}
}

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

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

29
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs

@ -1,29 +0,0 @@
using System;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
public static class EShopPaymentsEfCoreEntityExtensionMappings
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance
.MapEfCoreProperty<Payment, Guid?>(
"StoreId"
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<Refund, Guid?>(
"StoreId"
);
});
}
}
}

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

@ -1,6 +1,5 @@
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;
@ -9,16 +8,10 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
[DependsOn(
typeof(EShopPaymentsDomainModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(PaymentServiceEntityFrameworkCoreModule)
typeof(AbpEntityFrameworkCoreModule)
)]
public class EShopPaymentsEntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
EShopPaymentsEfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<PaymentsDbContext>(options =>

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

@ -13,6 +13,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
* DbSet<Question> Questions { get; }
*/
DbSet<Payment> Payments { get; set; }
DbSet<PaymentItem> PaymentItems { get; set; }
DbSet<Refund> Refunds { get; set; }
}
}

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

@ -3,8 +3,6 @@ using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.PaymentService;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
@ -15,6 +13,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
* public DbSet<Question> Questions { get; set; }
*/
public DbSet<Payment> Payments { get; set; }
public DbSet<PaymentItem> PaymentItems { get; set; }
public DbSet<Refund> Refunds { get; set; }
public PaymentsDbContext(DbContextOptions<PaymentsDbContext> options)
@ -29,20 +28,6 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
/* Configure the shared tables (with included modules) here */
builder.Entity<Payment>(b =>
{
b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Payments");
b.ConfigureByConvention();
});
builder.Entity<Refund>(b =>
{
b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Refunds");
b.ConfigureByConvention();
});
builder.ConfigureEShopPayments();
}
}

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

@ -1,7 +1,6 @@
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;
@ -43,7 +42,35 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
});
*/
EShopPaymentsEfCoreEntityExtensionMappings.Configure();
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)");
});
}
}
}

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

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

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

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

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

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

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

@ -1,6 +1,5 @@
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;
@ -10,8 +9,7 @@ namespace EasyAbp.EShop.Payments
{
[DependsOn(
typeof(EShopPaymentsApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule),
typeof(PaymentServiceHttpApiModule)
typeof(AbpAspNetCoreMvcModule)
)]
public class EShopPaymentsHttpApiModule : AbpModule
{

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

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

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

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

3
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp/EShop/Payments/MongoDB/PaymentsMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System;
using EasyAbp.PaymentService.MongoDB;
using Volo.Abp;
using Volo.Abp.MongoDB;
@ -18,8 +17,6 @@ namespace EasyAbp.EShop.Payments.MongoDB
);
optionsAction?.Invoke(options);
builder.ConfigurePaymentService();
}
}
}

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

@ -1,7 +1,6 @@
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;
@ -14,8 +13,7 @@ namespace EasyAbp.EShop.Payments.Web
[DependsOn(
typeof(EShopPaymentsHttpApiModule),
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAutoMapperModule),
typeof(PaymentServiceWebModule)
typeof(AbpAutoMapperModule)
)]
public class EShopPaymentsWebModule : AbpModule
{

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

@ -11,7 +11,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.8.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="2.8.0" />
</ItemGroup>

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

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.2.0</Version>
<Version>0.2.1</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.2.0</Version>
<Version>0.2.1</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>

3
samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj

@ -13,7 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.2.1" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSampleApplicationContractsModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
@ -19,6 +20,7 @@ namespace EShopSample
typeof(AbpTenantManagementApplicationContractsModule),
typeof(AbpObjectExtendingModule),
typeof(EShopApplicationContractsModule),
typeof(PaymentServiceApplicationContractsModule),
typeof(PaymentServiceWeChatPayApplicationContractsModule)
)]
public class EShopSampleApplicationContractsModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj

@ -14,7 +14,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.2.1" />
<PackageReference Include="Volo.Abp.Account.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSampleApplicationModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using Volo.Abp.Account;
using Volo.Abp.AutoMapper;
@ -19,6 +20,7 @@ namespace EShopSample
typeof(AbpTenantManagementApplicationModule),
typeof(AbpFeatureManagementApplicationModule),
typeof(EShopApplicationModule),
typeof(PaymentServiceApplicationModule),
typeof(PaymentServiceWeChatPayApplicationModule)
)]
public class EShopSampleApplicationModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj

@ -8,7 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.2.1" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSampleDomainSharedModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using EShopSample.Localization;
using Volo.Abp.AuditLogging;
@ -26,6 +27,7 @@ namespace EShopSample
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpTenantManagementDomainSharedModule),
typeof(EShopDomainSharedModule),
typeof(PaymentServiceDomainSharedModule),
typeof(PaymentServiceWeChatPayDomainSharedModule)
)]
public class EShopSampleDomainSharedModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj

@ -13,7 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="0.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSampleDomainModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.WeChatPay;
using EShopSample.MultiTenancy;
@ -31,6 +32,7 @@ namespace EShopSample
typeof(AbpSettingManagementDomainModule),
typeof(AbpTenantManagementDomainModule),
typeof(EShopDomainModule),
typeof(PaymentServiceDomainModule),
typeof(PaymentServiceWeChatPayDomainModule)
)]
public class EShopSampleDomainModule : AbpModule

3367
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.Designer.cs

File diff suppressed because it is too large

143
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200603115405_MadePaymentAndRefundExclusiveTableEntities.cs

@ -0,0 +1,143 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class MadePaymentAndRefundExclusiveTableEntities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServiceRefunds");
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServicePayments");
migrationBuilder.CreateTable(
name: "EShopPaymentsPayments",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
PaymentMethod = table.Column<string>(nullable: true),
PayeeAccount = table.Column<string>(nullable: true),
ExternalTradingCode = table.Column<string>(nullable: true),
Currency = table.Column<string>(nullable: true),
OriginalPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentDiscount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
ActualPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CompletionTime = table.Column<DateTime>(nullable: true),
CancelledTime = table.Column<DateTime>(nullable: true),
StoreId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPaymentsPayments", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EShopPaymentsRefunds",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
PaymentId = table.Column<Guid>(nullable: false),
PaymentItemId = table.Column<Guid>(nullable: false),
RefundPaymentMethod = table.Column<string>(nullable: true),
ExternalTradingCode = table.Column<string>(nullable: true),
Currency = table.Column<string>(nullable: true),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CustomerRemark = table.Column<string>(nullable: true),
StaffRemark = table.Column<string>(nullable: true),
StoreId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPaymentsRefunds", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EShopPaymentsPaymentItems",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
ItemType = table.Column<string>(nullable: true),
ItemKey = table.Column<Guid>(nullable: false),
Currency = table.Column<string>(nullable: true),
OriginalPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentDiscount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
ActualPaymentAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RefundAmount = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
PaymentId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EShopPaymentsPaymentItems", x => x.Id);
table.ForeignKey(
name: "FK_EShopPaymentsPaymentItems_EShopPaymentsPayments_PaymentId",
column: x => x.PaymentId,
principalTable: "EShopPaymentsPayments",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_EShopPaymentsPaymentItems_PaymentId",
table: "EShopPaymentsPaymentItems",
column: "PaymentId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EShopPaymentsPaymentItems");
migrationBuilder.DropTable(
name: "EShopPaymentsRefunds");
migrationBuilder.DropTable(
name: "EShopPaymentsPayments");
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServiceRefunds",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServicePayments",
type: "uniqueidentifier",
nullable: true);
}
}
}

250
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs

@ -203,6 +203,243 @@ namespace EShopSample.Migrations
b.ToTable("EShopOrdersOrderLines");
});
modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("ActualPaymentAmount")
.HasColumnType("decimal(18,6)");
b.Property<DateTime?>("CancelledTime")
.HasColumnType("datetime2");
b.Property<DateTime?>("CompletionTime")
.HasColumnType("datetime2");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExternalTradingCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("OriginalPaymentAmount")
.HasColumnType("decimal(18,6)");
b.Property<string>("PayeeAccount")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("PaymentDiscount")
.HasColumnType("decimal(18,6)");
b.Property<string>("PaymentMethod")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(18,6)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("EShopPaymentsPayments");
});
modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("ActualPaymentAmount")
.HasColumnType("decimal(18,6)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<Guid>("ItemKey")
.HasColumnType("uniqueidentifier");
b.Property<string>("ItemType")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("OriginalPaymentAmount")
.HasColumnType("decimal(18,6)");
b.Property<decimal>("PaymentDiscount")
.HasColumnType("decimal(18,6)");
b.Property<Guid?>("PaymentId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(18,6)");
b.HasKey("Id");
b.HasIndex("PaymentId");
b.ToTable("EShopPaymentsPaymentItems");
});
modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Currency")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerRemark")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExternalTradingCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PaymentId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PaymentItemId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(18,6)");
b.Property<string>("RefundPaymentMethod")
.HasColumnType("nvarchar(max)");
b.Property<string>("StaffRemark")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.ToTable("EShopPaymentsRefunds");
});
modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b =>
{
b.Property<Guid>("Id")
@ -960,9 +1197,6 @@ namespace EShopSample.Migrations
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(18,6)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
@ -1111,9 +1345,6 @@ namespace EShopSample.Migrations
b.Property<string>("StaffRemark")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
@ -2881,6 +3112,13 @@ namespace EShopSample.Migrations
.HasForeignKey("OrderId");
});
modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b =>
{
b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null)
.WithMany("PaymentItems")
.HasForeignKey("PaymentId");
});
modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b =>
{
b.HasOne("EasyAbp.EShop.Products.Products.Product", null)

3
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj

@ -10,7 +10,8 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\integration\EasyAbp.EShop\src\EasyAbp.EShop.EntityFrameworkCore\EasyAbp.EShop.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopSample.Domain\EShopSample.Domain.csproj" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.EntityFrameworkCore" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.2.1" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="2.8.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EntityFrameworkCore/EShopSampleEntityFrameworkCoreModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop.EntityFrameworkCore;
using EasyAbp.PaymentService.EntityFrameworkCore;
using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -27,6 +28,7 @@ namespace EShopSample.EntityFrameworkCore
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(EShopEntityFrameworkCoreModule),
typeof(PaymentServiceEntityFrameworkCoreModule),
typeof(PaymentServiceWeChatPayEntityFrameworkCoreModule)
)]
public class EShopSampleEntityFrameworkCoreModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj

@ -13,7 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.2.1" />
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSampleHttpApiClientModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Account;
@ -18,6 +19,7 @@ namespace EShopSample
typeof(AbpTenantManagementHttpApiClientModule),
typeof(AbpFeatureManagementHttpApiClientModule),
typeof(EShopHttpApiClientModule),
typeof(PaymentServiceHttpApiClientModule),
typeof(PaymentServiceWeChatPayHttpApiClientModule)
)]
public class EShopSampleHttpApiClientModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj

@ -13,7 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.2.1" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSampleHttpApiModule.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using Volo.Abp.Account;
using Volo.Abp.FeatureManagement;
@ -17,6 +18,7 @@ namespace EShopSample
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(EShopHttpApiModule),
typeof(PaymentServiceHttpApiModule),
typeof(PaymentServiceWeChatPayHttpApiModule)
)]
public class EShopSampleHttpApiModule : AbpModule

3
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj

@ -45,7 +45,8 @@
<ProjectReference Include="..\EShopSample.Application\EShopSample.Application.csproj" />
<ProjectReference Include="..\EShopSample.HttpApi\EShopSample.HttpApi.csproj" />
<ProjectReference Include="..\EShopSample.EntityFrameworkCore.DbMigrations\EShopSample.EntityFrameworkCore.DbMigrations.csproj" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.1.8" />
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.2.1" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.2.1" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="2.8.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs

@ -13,6 +13,7 @@ using EasyAbp.EShop.Stores;
using EasyAbp.EShop.Stores.Web;
using EasyAbp.EShop.Web;
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.Web;
using EasyAbp.PaymentService.WeChatPay;
using EasyAbp.PaymentService.WeChatPay.Web;
using Localization.Resources.AbpUi;
@ -66,6 +67,7 @@ namespace EShopSample.Web
typeof(AbpTenantManagementWebModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(EShopWebModule),
typeof(PaymentServiceWebModule),
typeof(PaymentServiceWeChatPayWebModule)
)]
public class EShopSampleWebModule : AbpModule

Loading…
Cancel
Save