Browse Source

Add a plain Payment Service

enisn/payment-service-with-mock
enisn 5 years ago
parent
commit
573c4162e7
  1. 116
      services/payment/EShopOnAbp.PaymentService.sln
  2. 16
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/EShopOnAbp.PaymentService.Application.Contracts.csproj
  3. 16
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceApplicationContractsModule.cs
  4. 7
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceRemoteServiceConsts.cs
  5. 19
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/Permissions/PaymentServicePermissionDefinitionProvider.cs
  6. 14
      services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/Permissions/PaymentServicePermissions.cs
  7. 17
      services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj
  8. 14
      services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceAppService.cs
  9. 14
      services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceApplicationAutoMapperProfile.cs
  10. 25
      services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceApplicationModule.cs
  11. 24
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/EShopOnAbp.PaymentService.Domain.Shared.csproj
  12. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/ar.json
  13. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/cs.json
  14. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/de-DE.json
  15. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/en-GB.json
  16. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/en.json
  17. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/es.json
  18. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/fi.json
  19. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/fr.json
  20. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/hi.json
  21. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/hu.json
  22. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/it.json
  23. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/nl.json
  24. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/pl-PL.json
  25. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/pt-BR.json
  26. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/ro-RO.json
  27. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/sk.json
  28. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/sl.json
  29. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/tr.json
  30. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/vi.json
  31. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/zh-Hans.json
  32. 6
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/zh-Hant.json
  33. 10
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentServiceResource.cs
  34. 37
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/PaymentServiceDomainSharedModule.cs
  35. 7
      services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/PaymentServiceErrorCodes.cs
  36. 15
      services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj
  37. 11
      services/payment/src/EShopOnAbp.PaymentService.Domain/PaymentServiceDbProperties.cs
  38. 14
      services/payment/src/EShopOnAbp.PaymentService.Domain/PaymentServiceDomainModule.cs
  39. 14
      services/payment/src/EShopOnAbp.PaymentService.Domain/Settings/PaymentServiceSettingDefinitionProvider.cs
  40. 11
      services/payment/src/EShopOnAbp.PaymentService.Domain/Settings/PaymentServiceSettings.cs
  41. 22
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EShopOnAbp.PaymentService.EntityFrameworkCore.csproj
  42. 13
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/IPaymentServiceDbContext.cs
  43. 48
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContext.cs
  44. 33
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs
  45. 34
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextModelCreatingExtensions.cs
  46. 39
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEfCoreEntityExtensionMappings.cs
  47. 36
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs
  48. 2
      services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/Properties/AssemblyInfo.cs
  49. 53
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/PaymentService-generate-proxy.json
  50. 15
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/SampleClientProxy.Generated.cs
  51. 8
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/SampleClientProxy.cs
  52. 20
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/EShopOnAbp.PaymentService.HttpApi.Client.csproj
  53. 27
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/PaymentServiceHttpApiClientModule.cs
  54. 13
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Controllers/HomeController.cs
  55. 31
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs
  56. 49
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationEventHandler.cs
  57. 29
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj
  58. 108
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs
  59. 56
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Program.cs
  60. 27
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Properties/launchSettings.json
  61. 21
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Startup.cs
  62. 18
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json
  63. 2
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.secrets.json
  64. 15
      services/payment/src/EShopOnAbp.PaymentService.HttpApi/EShopOnAbp.PaymentService.HttpApi.csproj
  65. 13
      services/payment/src/EShopOnAbp.PaymentService.HttpApi/PaymentServiceController.cs
  66. 33
      services/payment/src/EShopOnAbp.PaymentService.HttpApi/PaymentServiceHttpApiModule.cs
  67. 16
      services/payment/test/EShopOnAbp.PaymentService.Application.Tests/EShopOnAbp.PaymentService.Application.Tests.csproj
  68. 10
      services/payment/test/EShopOnAbp.PaymentService.Application.Tests/PaymentServiceApplicationTestBase.cs
  69. 13
      services/payment/test/EShopOnAbp.PaymentService.Application.Tests/PaymentServiceApplicationTestModule.cs
  70. 15
      services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/EShopOnAbp.PaymentService.Domain.Tests.csproj
  71. 10
      services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/PaymentServiceDomainTestBase.cs
  72. 17
      services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/PaymentServiceDomainTestModule.cs
  73. 18
      services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj
  74. 10
      services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreTestBase.cs
  75. 43
      services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreTestModule.cs
  76. 146
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs
  77. 37
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs
  78. 31
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp.csproj
  79. 14
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/PaymentServiceConsoleApiClientModule.cs
  80. 23
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/Program.cs
  81. 21
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/appsettings.json
  82. 2
      services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json
  83. 23
      services/payment/test/EShopOnAbp.PaymentService.TestBase/EShopOnAbp.PaymentService.TestBase.csproj
  84. 33
      services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceDataSeedContributor.cs
  85. 60
      services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceTestBase.cs
  86. 42
      services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceTestBaseModule.cs
  87. 43
      services/payment/test/EShopOnAbp.PaymentService.TestBase/Security/FakeCurrentPrincipalAccessor.cs

116
services/payment/EShopOnAbp.PaymentService.sln

@ -0,0 +1,116 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31717.71
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Domain.Shared", "src\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Domain", "src\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Application.Contracts", "src\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Application", "src\EShopOnAbp.PaymentService.Application\EShopOnAbp.PaymentService.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.EntityFrameworkCore", "src\EShopOnAbp.PaymentService.EntityFrameworkCore\EShopOnAbp.PaymentService.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.HttpApi", "src\EShopOnAbp.PaymentService.HttpApi\EShopOnAbp.PaymentService.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.HttpApi.Client", "src\EShopOnAbp.PaymentService.HttpApi.Client\EShopOnAbp.PaymentService.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.TestBase", "test\EShopOnAbp.PaymentService.TestBase\EShopOnAbp.PaymentService.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.EntityFrameworkCore.Tests", "test\EShopOnAbp.PaymentService.EntityFrameworkCore.Tests\EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Domain.Tests", "test\EShopOnAbp.PaymentService.Domain.Tests\EShopOnAbp.PaymentService.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.Application.Tests", "test\EShopOnAbp.PaymentService.Application.Tests\EShopOnAbp.PaymentService.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp", "test\EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp\EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EShopOnAbp.PaymentService.HttpApi.Host", "src\EShopOnAbp.PaymentService.HttpApi.Host\EShopOnAbp.PaymentService.HttpApi.Host.csproj", "{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU
{78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU
{527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU
{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{DFC7C9C8-FBDF-4C34-B92F-1E31C3F561BD} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6AAFA1C6-603E-13FA-45E5-7910AA9F661D}
EndGlobalSection
EndGlobal

16
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/EShopOnAbp.PaymentService.Application.Contracts.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="5.0.0-beta.1" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-beta.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" />
</ItemGroup>
</Project>

16
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceApplicationContractsModule.cs

@ -0,0 +1,16 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
using Volo.Abp.Authorization;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
)]
public class PaymentServiceApplicationContractsModule : AbpModule
{
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/PaymentServiceRemoteServiceConsts.cs

@ -0,0 +1,7 @@
namespace EShopOnAbp.PaymentService
{
public class PaymentServiceRemoteServiceConsts
{
public const string RemoteServiceName = "PaymentService";
}
}

19
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/Permissions/PaymentServicePermissionDefinitionProvider.cs

@ -0,0 +1,19 @@
using EShopOnAbp.PaymentService.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace EShopOnAbp.PaymentService.Permissions
{
public class PaymentServicePermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var myGroup = context.AddGroup(PaymentServicePermissions.GroupName, L("Permission:PaymentService"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<PaymentServiceResource>(name);
}
}
}

14
services/payment/src/EShopOnAbp.PaymentService.Application.Contracts/Permissions/PaymentServicePermissions.cs

@ -0,0 +1,14 @@
using Volo.Abp.Reflection;
namespace EShopOnAbp.PaymentService.Permissions
{
public class PaymentServicePermissions
{
public const string GroupName = "PaymentService";
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(PaymentServicePermissions));
}
}
}

17
services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-beta.1" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-beta.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" />
</ItemGroup>
</Project>

14
services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceAppService.cs

@ -0,0 +1,14 @@
using EShopOnAbp.PaymentService.Localization;
using Volo.Abp.Application.Services;
namespace EShopOnAbp.PaymentService
{
public abstract class PaymentServiceAppService : ApplicationService
{
protected PaymentServiceAppService()
{
LocalizationResource = typeof(PaymentServiceResource);
ObjectMapperContext = typeof(PaymentServiceApplicationModule);
}
}
}

14
services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceApplicationAutoMapperProfile.cs

@ -0,0 +1,14 @@
using AutoMapper;
namespace EShopOnAbp.PaymentService
{
public class PaymentServiceApplicationAutoMapperProfile : Profile
{
public PaymentServiceApplicationAutoMapperProfile()
{
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
}
}
}

25
services/payment/src/EShopOnAbp.PaymentService.Application/PaymentServiceApplicationModule.cs

@ -0,0 +1,25 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceDomainModule),
typeof(PaymentServiceApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
)]
public class PaymentServiceApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<PaymentServiceApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<PaymentServiceApplicationModule>(validate: true);
});
}
}
}

24
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/EShopOnAbp.PaymentService.Domain.Shared.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="5.0.0-beta.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.0-rc.*" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\PaymentService\*.json" />
<Content Remove="Localization\PaymentService\*.json" />
</ItemGroup>
</Project>

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/ar.json

@ -0,0 +1,7 @@
{
"culture": "ar",
"texts": {
"MyAccount": "إدارة ملفى",
"SamplePageMessage": "صفحة نموذجية للوحدة النمطية PaymentService"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/cs.json

@ -0,0 +1,7 @@
{
"culture": "cs",
"texts": {
"MyAccount": "Spravovat profil",
"SamplePageMessage": "Ukázková stránka pro modul PaymentService"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/de-DE.json

@ -0,0 +1,7 @@
{
"culture": "de-DE",
"texts": {
"MyAccount": "Mein Konto",
"SamplePageMessage": "Eine Beispielseite für das Modul PaymentServiceModul"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/en-GB.json

@ -0,0 +1,7 @@
{
"culture": "en-GB",
"texts": {
"MyAccount": "My account",
"SamplePageMessage": "A sample page for the PaymentService module"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"MyAccount": "My account",
"SamplePageMessage": "A sample page for the PaymentService module"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/es.json

@ -0,0 +1,7 @@
{
"culture": "es",
"texts": {
"MyAccount": "Mi cuenta",
"SamplePageMessage": "Una página de ejemplo para el módulo PaymentService "
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/fi.json

@ -0,0 +1,7 @@
{
"culture": "fi",
"texts": {
"MyAccount": "Tilini",
"SamplePageMessage": "Esimerkkisivu PaymentService-moduulille"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/fr.json

@ -0,0 +1,7 @@
{
"culture": "fr",
"texts": {
"MyAccount": "Mon compte",
"SamplePageMessage": "Exemple de page pour le module PaymentService"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/hi.json

@ -0,0 +1,7 @@
{
"culture": "hi",
"texts": {
"MyAccount": "मेरा खाता",
"SamplePageMessage": "PaymentService मॉड्यूल के लिए एक नमूना पृष्ठ"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/hu.json

@ -0,0 +1,7 @@
{
"culture": "hu",
"texts": {
"MyAccount": "A fiókom",
"SamplePageMessage": "Mintaoldal a PaymentService modulhoz"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/it.json

@ -0,0 +1,7 @@
{
"culture": "it",
"texts": {
"MyAccount": "Il mio conto",
"SamplePageMessage": "Una pagina di esempio per il modulo PaymentService"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/nl.json

@ -0,0 +1,7 @@
{
"culture": "nl",
"texts": {
"MyAccount": "Mijn rekening",
"SamplePageMessage": "Een voorbeeldpagina voor de PaymentService module"
}
}

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/pl-PL.json

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

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/pt-BR.json

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

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/ro-RO.json

@ -0,0 +1,7 @@
{
"culture": "ro-RO",
"texts": {
"MyAccount": "Contul meu",
"SamplePageMessage": "Un exemplu de pagină pentru modululul PaymentService"
}
}

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/sk.json

@ -0,0 +1,6 @@
{
"culture": "sk",
"texts": {
"SamplePageMessage": "Ukážka stránky pre modul PaymentService"
}
}

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/sl.json

@ -0,0 +1,6 @@
{
"culture": "sl",
"texts": {
"MyAccount": "Moj račun"
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/tr.json

@ -0,0 +1,7 @@
{
"culture": "tr",
"texts": {
"MyAccount": "Hesabım",
"SamplePageMessage": "PaymentService modulünden örnek bir sayfa"
}
}

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/vi.json

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

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"MyAccount": "我的账户",
"SamplePageMessage": "PaymentService模块的示例页面"
}
}

6
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentService/zh-Hant.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hant",
"texts": {
"MyAccount": "我的賬戶"
}
}

10
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/Localization/PaymentServiceResource.cs

@ -0,0 +1,10 @@
using Volo.Abp.Localization;
namespace EShopOnAbp.PaymentService.Localization
{
[LocalizationResourceName("PaymentService")]
public class PaymentServiceResource
{
}
}

37
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/PaymentServiceDomainSharedModule.cs

@ -0,0 +1,37 @@
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using EShopOnAbp.PaymentService.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(AbpValidationModule)
)]
public class PaymentServiceDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<PaymentServiceDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<PaymentServiceResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/PaymentService");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("PaymentService", typeof(PaymentServiceResource));
});
}
}
}

7
services/payment/src/EShopOnAbp.PaymentService.Domain.Shared/PaymentServiceErrorCodes.cs

@ -0,0 +1,7 @@
namespace EShopOnAbp.PaymentService
{
public static class PaymentServiceErrorCodes
{
//Add your business exception error codes here...
}
}

15
services/payment/src/EShopOnAbp.PaymentService.Domain/EShopOnAbp.PaymentService.Domain.csproj

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="5.0.0-beta.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Shared\EShopOnAbp.PaymentService.Domain.Shared.csproj" />
</ItemGroup>
</Project>

11
services/payment/src/EShopOnAbp.PaymentService.Domain/PaymentServiceDbProperties.cs

@ -0,0 +1,11 @@
namespace EShopOnAbp.PaymentService
{
public static class PaymentServiceDbProperties
{
public static string DbTablePrefix { get; set; } = "PaymentService";
public static string DbSchema { get; set; } = null;
public const string ConnectionStringName = "PaymentService";
}
}

14
services/payment/src/EShopOnAbp.PaymentService.Domain/PaymentServiceDomainModule.cs

@ -0,0 +1,14 @@
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(AbpDddDomainModule),
typeof(PaymentServiceDomainSharedModule)
)]
public class PaymentServiceDomainModule : AbpModule
{
}
}

14
services/payment/src/EShopOnAbp.PaymentService.Domain/Settings/PaymentServiceSettingDefinitionProvider.cs

@ -0,0 +1,14 @@
using Volo.Abp.Settings;
namespace EShopOnAbp.PaymentService.Settings
{
public class PaymentServiceSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
/* Define module settings here.
* Use names from PaymentServiceSettings class.
*/
}
}
}

11
services/payment/src/EShopOnAbp.PaymentService.Domain/Settings/PaymentServiceSettings.cs

@ -0,0 +1,11 @@
namespace EShopOnAbp.PaymentService.Settings
{
public static class PaymentServiceSettings
{
public const string GroupName = "PaymentService";
/* Add constants for setting names. Example:
* public const string MySettingName = GroupName + ".MySettingName";
*/
}
}

22
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EShopOnAbp.PaymentService.EntityFrameworkCore.csproj

@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.0.0-beta.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rc.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

13
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/IPaymentServiceDbContext.cs

@ -0,0 +1,13 @@
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
[ConnectionStringName(PaymentServiceDbProperties.ConnectionStringName)]
public interface IPaymentServiceDbContext : IEfCoreDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
}
}

48
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContext.cs

@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
[ConnectionStringName(PaymentServiceDbProperties.ConnectionStringName)]
public class PaymentServiceDbContext :
AbpDbContext<PaymentServiceDbContext>
{
/* Add DbSet properties for your Aggregate Roots / Entities here. */
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
* and replaced them for this DbContext. This allows you to perform JOIN
* queries for the entities of these modules over the repositories easily. You
* typically don't need that for other modules. But, if you need, you can
* implement the DbContext interface of the needed module and use ReplaceDbContext
* attribute just like IIdentityDbContext and ITenantManagementDbContext.
*
* More info: Replacing a DbContext of a module ensures that the related module
* uses this DbContext on runtime. Otherwise, it will use its own DbContext class.
*/
public PaymentServiceDbContext(DbContextOptions<PaymentServiceDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
/* Include modules to your migration db context */
builder.ConfigurePaymentService();
/* Configure your own tables/entities inside here */
//builder.Entity<YourEntity>(b =>
//{
// b.ToTable(PaymentServiceConsts.DbTablePrefix + "YourEntities", PaymentServiceConsts.DbSchema);
// b.ConfigureByConvention(); //auto configure for the base class props
// //...
//});
}
}
}

33
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs

@ -0,0 +1,33 @@
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
/* This class is needed for EF Core console commands
* (like Add-Migration and Update-Database commands) */
public class PaymentServiceDbContextFactory : IDesignTimeDbContextFactory<PaymentServiceDbContext>
{
public PaymentServiceDbContext CreateDbContext(string[] args)
{
PaymentServiceEfCoreEntityExtensionMappings.Configure();
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<PaymentServiceDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));
return new PaymentServiceDbContext(builder.Options);
}
private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../EShopOnAbp.PaymentService.HttpApi.Host/"))
.AddJsonFile("appsettings.json", optional: false);
return builder.Build();
}
}
}

34
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextModelCreatingExtensions.cs

@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
public static class PaymentServiceDbContextModelCreatingExtensions
{
public static void ConfigurePaymentService(
this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
/* Configure all entities here. Example:
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Questions", PaymentServiceDbProperties.DbSchema);
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);
});
*/
}
}
}

39
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEfCoreEntityExtensionMappings.cs

@ -0,0 +1,39 @@
using Volo.Abp.Threading;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
public static class PaymentServiceEfCoreEntityExtensionMappings
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can configure extra properties for the
* entities defined in the modules used by your application.
*
* This class can be used to map these extra properties to table fields in the database.
*
* USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
* USE PaymentServiceModuleExtensionConfigurator CLASS (in the Domain.Shared project)
* FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
*
* Example: Map a property to a table field:
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"MyProperty",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128);
}
);
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
*/
});
}
}
}

36
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs

@ -0,0 +1,36 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
[DependsOn(
typeof(PaymentServiceDomainModule),
typeof(AbpEntityFrameworkCoreSqlServerModule)
)]
public class PaymentServiceEntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PaymentServiceEfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<PaymentServiceDbContext>(options =>
{
/* Remove "includeAllEntities: true" to create
* default repositories only for aggregate roots */
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
/* The main point to change your DBMS.
* See also PaymentServiceMigrationsDbContextFactory for EF Core tooling. */
options.UseSqlServer();
});
}
}
}

2
services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/Properties/AssemblyInfo.cs

@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleToAttribute("EShopOnAbp.PaymentService.EntityFrameworkCore.Tests")]

53
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/PaymentService-generate-proxy.json

@ -0,0 +1,53 @@
{
"modules": {
"PaymentService": {
"rootPath": "PaymentService",
"remoteServiceName": "PaymentService",
"controllers": {
"EShopOnAbp.PaymentService.Samples.SampleController": {
"controllerName": "Sample",
"controllerGroupName": "Sample",
"type": "EShopOnAbp.PaymentService.Samples.SampleController",
"interfaces": [
{
"type": "EShopOnAbp.PaymentService.Samples.ISampleAppService"
}
],
"actions": {
"GetAsync": {
"uniqueName": "GetAsync",
"name": "GetAsync",
"httpMethod": "GET",
"url": "api/PaymentService/sample",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "EShopOnAbp.PaymentService.Samples.SampleDto",
"typeSimple": "EShopOnAbp.PaymentService.Samples.SampleDto"
},
"allowAnonymous": null,
"implementFrom": "EShopOnAbp.PaymentService.Samples.ISampleAppService"
},
"GetAuthorizedAsync": {
"uniqueName": "GetAuthorizedAsync",
"name": "GetAuthorizedAsync",
"httpMethod": "GET",
"url": "api/PaymentService/sample/authorized",
"supportedVersions": [],
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "EShopOnAbp.PaymentService.Samples.SampleDto",
"typeSimple": "EShopOnAbp.PaymentService.Samples.SampleDto"
},
"allowAnonymous": false,
"implementFrom": "EShopOnAbp.PaymentService.Samples.ISampleAppService"
}
}
}
}
}
},
"types": {}
}

15
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/SampleClientProxy.Generated.cs

@ -0,0 +1,15 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Modeling;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.ClientProxying;
using EShopOnAbp.PaymentService.Samples;
// ReSharper disable once CheckNamespace
namespace EShopOnAbp.PaymentService.Samples.ClientProxies
{
}

8
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/ClientProxies/SampleClientProxy.cs

@ -0,0 +1,8 @@
// This file is part of SampleClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace EShopOnAbp.PaymentService.Samples.ClientProxies
{
public partial class SampleClientProxy
{
}
}

20
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/EShopOnAbp.PaymentService.HttpApi.Client.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="5.0.0-beta.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="**\*generate-proxy.json" />
<Content Remove="**\*generate-proxy.json" />
</ItemGroup>
</Project>

27
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Client/PaymentServiceHttpApiClientModule.cs

@ -0,0 +1,27 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceApplicationContractsModule),
typeof(AbpHttpClientModule))]
public class PaymentServiceHttpApiClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddStaticHttpClientProxies(
typeof(PaymentServiceApplicationContractsModule).Assembly,
PaymentServiceRemoteServiceConsts.RemoteServiceName
);
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<PaymentServiceHttpApiClientModule>();
});
}
}
}

13
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Controllers/HomeController.cs

@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace EShopOnAbp.PaymentService.Controllers
{
public class HomeController : AbpController
{
public ActionResult Index()
{
return Redirect("~/swagger");
}
}
}

31
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationChecker.cs

@ -0,0 +1,31 @@
using EShopOnAbp.PaymentService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
namespace EShopOnAbp.PaymentService.DbMigrations
{
public class PaymentServiceDatabaseMigrationChecker : PendingMigrationsCheckerBase<PaymentServiceDbContext>
{
public PaymentServiceDatabaseMigrationChecker(
IUnitOfWorkManager unitOfWorkManager,
IServiceProvider serviceProvider,
ICurrentTenant currentTenant,
IDistributedEventBus distributedEventBus)
: base(
unitOfWorkManager,
serviceProvider,
currentTenant,
distributedEventBus,
PaymentServiceDbProperties.ConnectionStringName)
{
}
}
}

49
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/DbMigrations/PaymentServiceDatabaseMigrationEventHandler.cs

@ -0,0 +1,49 @@
using EShopOnAbp.PaymentService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.Microservices.DbMigrations;
using System;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement;
using Volo.Abp.Uow;
namespace EShopOnAbp.PaymentService.DbMigrations
{
public class PaymentServiceDatabaseMigrationEventHandler
: DatabaseMigrationEventHandlerBase<PaymentServiceDbContext>,
IDistributedEventHandler<ApplyDatabaseMigrationsEto>
{
public PaymentServiceDatabaseMigrationEventHandler(
ICurrentTenant currentTenant,
IUnitOfWorkManager unitOfWorkManager,
ITenantStore tenantStore,
ITenantRepository tenantRepository,
IDistributedEventBus distributedEventBus,
string databaseName) : base(currentTenant, unitOfWorkManager, tenantStore, tenantRepository, distributedEventBus, databaseName)
{
}
public async Task HandleEventAsync(ApplyDatabaseMigrationsEto eventData)
{
if (eventData.DatabaseName != DatabaseName)
{
return;
}
if (eventData.TenantId != null)
{
return;
}
try
{
await MigrateDatabaseSchemaAsync(null);
}
catch (Exception ex)
{
await HandleErrorOnApplyDatabaseMigrationAsync(eventData, ex);
}
}
}
}

29
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>EShopOnAbp.PaymentService-c2d31439-b723-48e2-b061-5ebd7aeb6010</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EShopOnAbp.PaymentService.HttpApi\EShopOnAbp.PaymentService.HttpApi.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application\EShopOnAbp.PaymentService.Application.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.EntityFrameworkCore\EShopOnAbp.PaymentService.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\shared\EShopOnAbp.Shared.Hosting.Microservices\EShopOnAbp.Shared.Hosting.Microservices.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
</Project>

108
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs

@ -0,0 +1,108 @@
using EShopOnAbp.PaymentService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.Microservices;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
using System.Collections.Generic;
using System;
using EShopOnAbp.PaymentService.DbMigrations;
using System.Linq;
using Microsoft.AspNetCore.Cors;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceApplicationModule),
typeof(PaymentServiceEntityFrameworkCoreModule),
typeof(PaymentServiceHttpApiModule)
)]
public class PaymentServiceHttpApiHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
JwtBearerConfigurationHelper.Configure(context, "CatalogService");
// SwaggerConfigurationHelper.Configure(context, "Catalog Service API");
SwaggerWithAuthConfigurationHelper.Configure(
context: context,
authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{
{"CatalogService", "Catalog Service API"},
},
apiTitle: "Catalog Service API"
);
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCorrelationId();
app.UseCors();
app.UseAbpRequestLocalization();
app.UseStaticFiles();
app.UseRouting();
// app.UseHttpMetrics();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseMultiTenancy();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "Saas Service API"); });
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints(endpoints =>
{
// endpoints.MapMetrics();
});
}
public override void OnPostApplicationInitialization(ApplicationInitializationContext context)
{
using (var scope = context.ServiceProvider.CreateScope())
{
AsyncHelper.RunSync(
() => scope.ServiceProvider
.GetRequiredService<PaymentServiceDatabaseMigrationChecker>()
.CheckAsync()
);
}
}
}
}

56
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Program.cs

@ -0,0 +1,56 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace EShopOnAbp.PaymentService
{
public class Program
{
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}
}

27
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Properties/launchSettings.json

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44347",
"sslPort": 44347
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"EShopOnAbp.PaymentService.DemoApp": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:44347",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

21
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Startup.cs

@ -0,0 +1,21 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace EShopOnAbp.PaymentService
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<PaymentServiceHttpApiHostModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

18
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json

@ -0,0 +1,18 @@
{
"App": {
"CorsOrigins": "https://*.PaymentService.com,http://localhost:4200,http://localhost:44307,https://localhost:44307"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=PaymentService_Main;Trusted_Connection=True",
"PaymentService": "Server=(LocalDb)\\MSSQLLocalDB;Database=PaymentService_Module;Trusted_Connection=True"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"AuthServer": {
"Authority": "https://localhost:44362/",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "PaymentService_Swagger",
"SwaggerClientSecret": "1q2w3e*"
}
}

2
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.secrets.json

@ -0,0 +1,2 @@
{
}

15
services/payment/src/EShopOnAbp.PaymentService.HttpApi/EShopOnAbp.PaymentService.HttpApi.csproj

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="5.0.0-beta.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />
</ItemGroup>
</Project>

13
services/payment/src/EShopOnAbp.PaymentService.HttpApi/PaymentServiceController.cs

@ -0,0 +1,13 @@
using EShopOnAbp.PaymentService.Localization;
using Volo.Abp.AspNetCore.Mvc;
namespace EShopOnAbp.PaymentService
{
public abstract class PaymentServiceController : AbpControllerBase
{
protected PaymentServiceController()
{
LocalizationResource = typeof(PaymentServiceResource);
}
}
}

33
services/payment/src/EShopOnAbp.PaymentService.HttpApi/PaymentServiceHttpApiModule.cs

@ -0,0 +1,33 @@
using Localization.Resources.AbpUi;
using EShopOnAbp.PaymentService.Localization;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class PaymentServiceHttpApiModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(PaymentServiceHttpApiModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<PaymentServiceResource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
}
}

16
services/payment/test/EShopOnAbp.PaymentService.Application.Tests/EShopOnAbp.PaymentService.Application.Tests.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.Application\EShopOnAbp.PaymentService.Application.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Domain.Tests\EShopOnAbp.PaymentService.Domain.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
</ItemGroup>
</Project>

10
services/payment/test/EShopOnAbp.PaymentService.Application.Tests/PaymentServiceApplicationTestBase.cs

@ -0,0 +1,10 @@
namespace EShopOnAbp.PaymentService
{
/* Inherit from this class for your application layer tests.
* See SampleAppService_Tests for example.
*/
public abstract class PaymentServiceApplicationTestBase : PaymentServiceTestBase<PaymentServiceApplicationTestModule>
{
}
}

13
services/payment/test/EShopOnAbp.PaymentService.Application.Tests/PaymentServiceApplicationTestModule.cs

@ -0,0 +1,13 @@
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceApplicationModule),
typeof(PaymentServiceDomainTestModule)
)]
public class PaymentServiceApplicationTestModule : AbpModule
{
}
}

15
services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/EShopOnAbp.PaymentService.Domain.Tests.csproj

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.EntityFrameworkCore.Tests\EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj" />
</ItemGroup>
</Project>

10
services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/PaymentServiceDomainTestBase.cs

@ -0,0 +1,10 @@
namespace EShopOnAbp.PaymentService
{
/* Inherit from this class for your domain layer tests.
* See SampleManager_Tests for example.
*/
public abstract class PaymentServiceDomainTestBase : PaymentServiceTestBase<PaymentServiceDomainTestModule>
{
}
}

17
services/payment/test/EShopOnAbp.PaymentService.Domain.Tests/PaymentServiceDomainTestModule.cs

@ -0,0 +1,17 @@
using EShopOnAbp.PaymentService.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService
{
/* Domain tests are configured to use the EF Core provider.
* You can switch to MongoDB, however your domain tests should be
* database independent anyway.
*/
[DependsOn(
typeof(PaymentServiceEntityFrameworkCoreTestModule)
)]
public class PaymentServiceDomainTestModule : AbpModule
{
}
}

18
services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0-rc.*" />
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.EntityFrameworkCore\EShopOnAbp.PaymentService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.TestBase\EShopOnAbp.PaymentService.TestBase.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.Sqlite" Version="5.0.0-beta.1" />
</ItemGroup>
</Project>

10
services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreTestBase.cs

@ -0,0 +1,10 @@
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
/* This class can be used as a base class for EF Core integration tests,
* while SampleRepository_Tests uses a different approach.
*/
public abstract class PaymentServiceEntityFrameworkCoreTestBase : PaymentServiceTestBase<PaymentServiceEntityFrameworkCoreTestModule>
{
}
}

43
services/payment/test/EShopOnAbp.PaymentService.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreTestModule.cs

@ -0,0 +1,43 @@
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Sqlite;
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService.EntityFrameworkCore
{
[DependsOn(
typeof(PaymentServiceTestBaseModule),
typeof(PaymentServiceEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqliteModule)
)]
public class PaymentServiceEntityFrameworkCoreTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var sqliteConnection = CreateDatabaseAndGetConnection();
Configure<AbpDbContextOptions>(options =>
{
options.Configure(abpDbContextConfigurationContext =>
{
abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection);
});
});
}
private static SqliteConnection CreateDatabaseAndGetConnection()
{
var connection = new SqliteConnection("Data Source=:memory:");
connection.Open();
new PaymentServiceDbContext(
new DbContextOptionsBuilder<PaymentServiceDbContext>().UseSqlite(connection).Options
).GetService<IRelationalDatabaseCreator>().CreateTables();
return connection;
}
}
}

146
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs

@ -0,0 +1,146 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using IdentityModel.Client;
using Microsoft.Extensions.Configuration;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityModel;
namespace EShopOnAbp.PaymentService
{
public class ClientDemoService : ITransientDependency
{
private readonly IIdentityModelAuthenticationService _authenticationService;
private readonly IConfiguration _configuration;
public ClientDemoService(
IIdentityModelAuthenticationService authenticationService,
IConfiguration configuration)
{
_authenticationService = authenticationService;
_configuration = configuration;
}
public async Task RunAsync()
{
await TestWithDynamicProxiesAsync();
await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync();
await TestAllManuallyAsync();
}
/* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy
* feature. It is just simple as calling a local service method.
* Authorization and HTTP request details are handled by the ABP framework.
*/
private async Task TestWithDynamicProxiesAsync()
{
Console.WriteLine();
Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****");
}
/* Shows how to use HttpClient to perform a request to the HTTP API.
* It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens.
*/
private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync()
{
Console.WriteLine();
Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****");
//Get access token using ABP's IIdentityModelAuthenticationService
var accessToken = await _authenticationService.GetAccessTokenAsync(
new IdentityClientConfiguration(
_configuration["IdentityClients:Default:Authority"],
_configuration["IdentityClients:Default:Scope"],
_configuration["IdentityClients:Default:ClientId"],
_configuration["IdentityClients:Default:ClientSecret"],
_configuration["IdentityClients:Default:GrantType"],
_configuration["IdentityClients:Default:UserName"],
_configuration["IdentityClients:Default:UserPassword"]
)
);
//Perform the actual HTTP request
using (var httpClient = new HttpClient())
{
httpClient.SetBearerToken(accessToken);
var url = _configuration["RemoteServices:PaymentService:BaseUrl"] +
"api/PaymentService/sample/authorized";
var responseMessage = await httpClient.GetAsync(url);
if (responseMessage.IsSuccessStatusCode)
{
var responseString = await responseMessage.Content.ReadAsStringAsync();
Console.WriteLine("Result: " + responseString);
}
else
{
throw new Exception("Remote server returns error code: " + responseMessage.StatusCode);
}
}
}
/* Shows how to use HttpClient to perform a request to the HTTP API.
* It obtains access token using IdentityServer's API. See its documentation:
* https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html
*/
private async Task TestAllManuallyAsync()
{
Console.WriteLine();
Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****");
//Obtain access token from the IDS4 server
// discover endpoints from metadata
var client = new HttpClient();
var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]);
if (disco.IsError)
{
Console.WriteLine(disco.Error);
return;
}
// request token
var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
{
Address = disco.TokenEndpoint,
ClientId = _configuration["IdentityClients:Default:ClientId"],
ClientSecret = _configuration["IdentityClients:Default:ClientSecret"],
UserName = _configuration["IdentityClients:Default:UserName"],
Password = _configuration["IdentityClients:Default:UserPassword"],
Scope = _configuration["IdentityClients:Default:Scope"]
});
if (tokenResponse.IsError)
{
Console.WriteLine(tokenResponse.Error);
return;
}
Console.WriteLine(tokenResponse.Json);
//Perform the actual HTTP request
using (var httpClient = new HttpClient())
{
httpClient.SetBearerToken(tokenResponse.AccessToken);
var url = _configuration["RemoteServices:PaymentService:BaseUrl"] +
"api/PaymentService/sample/authorized";
var responseMessage = await httpClient.GetAsync(url);
if (responseMessage.IsSuccessStatusCode)
{
var responseString = await responseMessage.Content.ReadAsStringAsync();
Console.WriteLine("Result: " + responseString);
}
else
{
throw new Exception("Remote server returns error code: " + responseMessage.StatusCode);
}
}
}
}
}

37
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs

@ -0,0 +1,37 @@
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
namespace EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp
{
public class ConsoleTestAppHostedService : IHostedService
{
private readonly IConfiguration _configuration;
public ConsoleTestAppHostedService(IConfiguration configuration)
{
_configuration = configuration;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = AbpApplicationFactory.Create<PaymentServiceConsoleApiClientModule>(options=>
{
options.Services.ReplaceConfiguration(_configuration);
}))
{
application.Initialize();
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
await demo.RunAsync();
application.Shutdown();
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}

31
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp.csproj

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.0.0-beta.1" />
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.HttpApi.Client\EShopOnAbp.PaymentService.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<None Remove="appsettings.json" />
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="appsettings.secrets.json" />
<Content Include="appsettings.secrets.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-rc.*" />
</ItemGroup>
</Project>

14
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/PaymentServiceConsoleApiClientModule.cs

@ -0,0 +1,14 @@
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Modularity;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(PaymentServiceHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
)]
public class PaymentServiceConsoleApiClientModule : AbpModule
{
}
}

23
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/Program.cs

@ -0,0 +1,23 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp
{
class Program
{
static async Task Main(string[] args)
{
await CreateHostBuilder(args).RunConsoleAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.AddAppSettingsSecretsJson()
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<ConsoleTestAppHostedService>();
});
}
}

21
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/appsettings.json

@ -0,0 +1,21 @@
{
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44362/"
},
"PaymentService": {
"BaseUrl": "https://localhost:44347/"
}
},
"IdentityClients": {
"Default": {
"GrantType": "password",
"ClientId": "PaymentService_App",
"ClientSecret": "1q2w3e*",
"UserName": "admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44362/",
"Scope": "PaymentService"
}
}
}

2
services/payment/test/EShopOnAbp.PaymentService.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json

@ -0,0 +1,2 @@
{
}

23
services/payment/test/EShopOnAbp.PaymentService.TestBase/EShopOnAbp.PaymentService.TestBase.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EShopOnAbp.PaymentService</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-beta.1" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-beta.1" />
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-beta.1" />
<ProjectReference Include="..\..\src\EShopOnAbp.PaymentService.Domain\EShopOnAbp.PaymentService.Domain.csproj" />
</ItemGroup>
</Project>

33
services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceDataSeedContributor.cs

@ -0,0 +1,33 @@
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
namespace EShopOnAbp.PaymentService
{
public class PaymentServiceDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly IGuidGenerator _guidGenerator;
private readonly ICurrentTenant _currentTenant;
public PaymentServiceDataSeedContributor(
IGuidGenerator guidGenerator, ICurrentTenant currentTenant)
{
_guidGenerator = guidGenerator;
_currentTenant = currentTenant;
}
public Task SeedAsync(DataSeedContext context)
{
/* Instead of returning the Task.CompletedTask, you can insert your test data
* at this point!
*/
using (_currentTenant.Change(context?.TenantId))
{
return Task.CompletedTask;
}
}
}
}

60
services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceTestBase.cs

@ -0,0 +1,60 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
using Volo.Abp.Testing;
namespace EShopOnAbp.PaymentService
{
/* All test classes are derived from this class, directly or indirectly. */
public abstract class PaymentServiceTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule>
where TStartupModule : IAbpModule
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
protected virtual Task WithUnitOfWorkAsync(Func<Task> func)
{
return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
}
protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func<Task> action)
{
using (var scope = ServiceProvider.CreateScope())
{
var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
using (var uow = uowManager.Begin(options))
{
await action();
await uow.CompleteAsync();
}
}
}
protected virtual Task<TResult> WithUnitOfWorkAsync<TResult>(Func<Task<TResult>> func)
{
return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
}
protected virtual async Task<TResult> WithUnitOfWorkAsync<TResult>(AbpUnitOfWorkOptions options, Func<Task<TResult>> func)
{
using (var scope = ServiceProvider.CreateScope())
{
var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
using (var uow = uowManager.Begin(options))
{
var result = await func();
await uow.CompleteAsync();
return result;
}
}
}
}
}

42
services/payment/test/EShopOnAbp.PaymentService.TestBase/PaymentServiceTestBaseModule.cs

@ -0,0 +1,42 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Authorization;
using Volo.Abp.Autofac;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
namespace EShopOnAbp.PaymentService
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpTestBaseModule),
typeof(AbpAuthorizationModule),
typeof(PaymentServiceDomainModule)
)]
public class PaymentServiceTestBaseModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysAllowAuthorization();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
SeedTestData(context);
}
private static void SeedTestData(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(async () =>
{
using (var scope = context.ServiceProvider.CreateScope())
{
await scope.ServiceProvider
.GetRequiredService<IDataSeeder>()
.SeedAsync();
}
});
}
}
}

43
services/payment/test/EShopOnAbp.PaymentService.TestBase/Security/FakeCurrentPrincipalAccessor.cs

@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Security.Claims;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Security.Claims;
namespace EShopOnAbp.PaymentService.Security
{
[Dependency(ReplaceServices = true)]
public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor
{
protected override ClaimsPrincipal GetClaimsPrincipal()
{
return GetPrincipal();
}
private ClaimsPrincipal _principal;
private ClaimsPrincipal GetPrincipal()
{
if (_principal == null)
{
lock (this)
{
if (_principal == null)
{
_principal = new ClaimsPrincipal(
new ClaimsIdentity(
new List<Claim>
{
new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"),
new Claim(AbpClaimTypes.UserName,"admin"),
new Claim(AbpClaimTypes.Email,"admin@abp.io")
}
)
);
}
}
}
return _principal;
}
}
}
Loading…
Cancel
Save