Browse Source

Upgrade PaymentService module to version 0.4.0

pull/87/head v0.3.3
gdlcf88 6 years ago
parent
commit
ec9821d49f
  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. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs
  6. 18
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs
  7. 2
      modules/EasyAbp.EShop.Payments/common.props
  8. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  9. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs
  10. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentItem.cs
  11. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs
  12. 2
      modules/EasyAbp.EShop.Products/common.props
  13. 2
      modules/EasyAbp.EShop.Stores/common.props
  14. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj
  15. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj
  16. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj
  17. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj
  18. 3601
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.Designer.cs
  19. 52
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.cs
  20. 12
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs
  21. 4
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj
  22. 4
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj
  23. 4
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj
  24. 4
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj

2
integration/EasyAbp.EShop/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.3.2</Version>
<Version>0.3.3</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.3.2</Version>
<Version>0.3.3</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.3.2</Version>
<Version>0.3.3</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,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.4.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.9.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

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

@ -4,7 +4,7 @@ using Volo.Abp.EventBus.Distributed;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderPaymentCompletedEventHandler : IDistributedEventHandler<EntityUpdatedEto<PaymentEto>>
public interface IOrderPaymentCompletedEventHandler : IDistributedEventHandler<PaymentCompletedEto>
{
}

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

@ -38,28 +38,30 @@ namespace EasyAbp.EShop.Orders.Orders
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(EntityUpdatedEto<PaymentEto> eventData)
public virtual async Task HandleEventAsync(PaymentCompletedEto eventData)
{
if (!eventData.Entity.CompletionTime.HasValue)
var payment = eventData.Payment;
if (!payment.CompletionTime.HasValue || payment.CancelledTime.HasValue)
{
return;
}
using var currentTenant = _currentTenant.Change(eventData.Entity.TenantId);
using var currentTenant = _currentTenant.Change(payment.TenantId);
foreach (var item in eventData.Entity.PaymentItems.Where(item => item.ItemType == PaymentsConsts.PaymentItemType))
foreach (var item in payment.PaymentItems.Where(item => item.ItemType == PaymentsConsts.PaymentItemType))
{
var order = await _orderRepository.GetAsync(item.ItemKey);
if (order.PaymentId != eventData.Entity.Id || order.PaidTime.HasValue ||
if (order.PaymentId != payment.Id || order.PaidTime.HasValue ||
order.OrderStatus != OrderStatus.Pending)
{
throw new OrderIsInWrongStageException(order.Id);
}
if (!await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity, item))
if (!await _orderPaymentChecker.IsValidPaymentAsync(order, payment, item))
{
throw new OrderPaymentInvalidException(eventData.Entity.Id, item.ItemKey);
throw new OrderPaymentInvalidException(payment.Id, item.ItemKey);
}
order.SetPaidTime(_clock.Now);
@ -70,7 +72,7 @@ namespace EasyAbp.EShop.Orders.Orders
await _distributedEventBus.PublishAsync(new OrderPaidEto
{
Order = _objectMapper.Map<Order, OrderEto>(order),
PaymentId = eventData.Entity.Id,
PaymentId = payment.Id,
PaymentItemId = item.Id
});
}

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

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

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.Shared" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.4.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.9.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/Payments/Payment.cs

@ -35,6 +35,8 @@ namespace EasyAbp.EShop.Payments.Payments
public virtual decimal RefundAmount { get; protected set; }
public virtual decimal PendingRefundAmount { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
public virtual DateTime? CancelledTime { get; protected set; }

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

@ -24,6 +24,8 @@ namespace EasyAbp.EShop.Payments.Payments
public virtual decimal ActualPaymentAmount { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
public virtual decimal PendingRefundAmount { get; protected set; }
#endregion

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

@ -31,7 +31,11 @@ namespace EasyAbp.EShop.Payments.Refunds
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
public virtual DateTime? CompletedTime { get; protected set; }
public virtual DateTime? CancelledTime { get; protected set; }
#endregion
public virtual Guid? StoreId { get; protected set; }

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

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

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

@ -13,8 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.4.0" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="2.9.0" />

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

@ -14,8 +14,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.4.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="2.9.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="2.9.0" />

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

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.4.0" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="2.9.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="2.9.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="2.9.0" />

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

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

3601
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.Designer.cs

File diff suppressed because it is too large

52
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200624181705_AddedMissingPropertiesInPaymentAndRefund.cs

@ -0,0 +1,52 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedMissingPropertiesInPaymentAndRefund : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CancelledTime",
table: "EShopPaymentsRefunds",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "CompletedTime",
table: "EShopPaymentsRefunds",
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<decimal>(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems",
nullable: false,
defaultValue: 0m);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CancelledTime",
table: "EShopPaymentsRefunds");
migrationBuilder.DropColumn(
name: "CompletedTime",
table: "EShopPaymentsRefunds");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "EShopPaymentsPayments");
migrationBuilder.DropColumn(
name: "PendingRefundAmount",
table: "EShopPaymentsPaymentItems");
}
}
}

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

@ -284,6 +284,9 @@ namespace EShopSample.Migrations
b.Property<string>("PaymentMethod")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("PendingRefundAmount")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(20,8)");
@ -359,6 +362,9 @@ namespace EShopSample.Migrations
b.Property<Guid?>("PaymentId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("PendingRefundAmount")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(20,8)");
@ -375,6 +381,12 @@ namespace EShopSample.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("CancelledTime")
.HasColumnType("datetime2");
b.Property<DateTime?>("CompletedTime")
.HasColumnType("datetime2");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")

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

@ -10,8 +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.EntityFrameworkCore" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.EntityFrameworkCore" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.4.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="2.9.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="2.9.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.9.0" />

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

@ -13,8 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.4.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="2.9.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="2.9.0" />

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

@ -13,8 +13,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.4.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="2.9.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="2.9.0" />

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

@ -45,8 +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.Web" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.3.11" />
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.4.0" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.4.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="2.9.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="2.9.0" />

Loading…
Cancel
Save