mirror of https://github.com/EasyAbp/EShop.git
46 changed files with 863 additions and 11 deletions
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class CreateUpdatePaymentDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using PaymentServicePaymentDto = EasyAbp.PaymentService.Payments.Dtos.PaymentDto; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class PaymentDto : PaymentServicePaymentDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Payments.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentAppService : |
|||
ICrudAppService< |
|||
PaymentDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateUpdatePaymentDto, |
|||
CreateUpdatePaymentDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Payments.Refunds.Dtos |
|||
{ |
|||
public class CreateUpdateRefundDto |
|||
{ |
|||
[DisplayName("RefundStoreId")] |
|||
public Guid? StoreId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
using PaymentServiceRefundDto = EasyAbp.PaymentService.Refunds.Dtos.RefundDto; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds.Dtos |
|||
{ |
|||
public class RefundDto : PaymentServiceRefundDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Refunds.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public interface IRefundAppService : |
|||
ICrudAppService< |
|||
RefundDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateUpdateRefundDto, |
|||
CreateUpdateRefundDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Authorization; |
|||
using EasyAbp.EShop.Payments.Payments.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentAppService : CrudAppService<Payment, PaymentDto, Guid, PagedAndSortedResultRequestDto, CreateUpdatePaymentDto, CreateUpdatePaymentDto>, |
|||
IPaymentAppService |
|||
{ |
|||
protected override string GetPolicyName { get; set; } = PaymentsPermissions.Payments.Default; |
|||
protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Payments.Default; |
|||
protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Payments.Create; |
|||
protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Payments.Update; |
|||
protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Payments.Delete; |
|||
|
|||
private readonly IPaymentRepository _repository; |
|||
|
|||
public PaymentAppService(IPaymentRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Authorization; |
|||
using EasyAbp.EShop.Payments.Refunds.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class RefundAppService : CrudAppService<Refund, RefundDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateRefundDto, CreateUpdateRefundDto>, |
|||
IRefundAppService |
|||
{ |
|||
protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; |
|||
protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; |
|||
protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Refunds.Create; |
|||
protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Refunds.Update; |
|||
protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Refunds.Delete; |
|||
|
|||
private readonly IRefundRepository _repository; |
|||
|
|||
public RefundAppService(IRefundRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -1,5 +1,23 @@ |
|||
{ |
|||
"culture": "cs", |
|||
"texts": { |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +1,24 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"ManageYourProfile": "Manage your profile" |
|||
"ManageYourProfile": "Manage your profile", |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,5 +1,23 @@ |
|||
{ |
|||
"culture": "pl", |
|||
"texts": { |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,5 +1,23 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +1,24 @@ |
|||
{ |
|||
"culture": "sl", |
|||
"texts": { |
|||
"ManageYourProfile": "Upravljajte svojim profilom" |
|||
"ManageYourProfile": "Upravljajte svojim profilom", |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +1,24 @@ |
|||
{ |
|||
"culture": "tr", |
|||
"texts": { |
|||
"ManageYourProfile": "Profil y�netimi" |
|||
"ManageYourProfile": "Profil y�netimi", |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,5 +1,23 @@ |
|||
{ |
|||
"culture": "vi", |
|||
"texts": { |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +1,24 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"ManageYourProfile": "管理个人资料" |
|||
"ManageYourProfile": "管理个人资料", |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +1,24 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"ManageYourProfile": "管理個人資料" |
|||
"ManageYourProfile": "管理個人資料", |
|||
"Permission:Payments": "Payments", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:Payments": "MenuPayments", |
|||
"Payment": "Payment", |
|||
"PaymentStoreId": "PaymentStoreId", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Permission:Refunds": "Refunds", |
|||
"Menu:Refunds": "MenuRefunds", |
|||
"Refund": "Refund", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentRepository : IRepository<Payment, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using PaymentServicePayment = EasyAbp.PaymentService.Payments.Payment; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class Payment : PaymentServicePayment |
|||
{ |
|||
public virtual Guid? StoreId { get; protected set; } |
|||
|
|||
public void SetStoreId(Guid? storeId) |
|||
{ |
|||
StoreId = storeId; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public interface IRefundRepository : IRepository<Refund, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using PaymentServiceRefund = EasyAbp.PaymentService.Refunds.Refund; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class Refund : PaymentServiceRefund |
|||
{ |
|||
public virtual Guid? StoreId { get; protected set; } |
|||
|
|||
public void SetStoreId(Guid? storeId) |
|||
{ |
|||
StoreId = storeId; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentRepository : EfCoreRepository<PaymentsDbContext, Payment, Guid>, IPaymentRepository |
|||
{ |
|||
public PaymentRepository(IDbContextProvider<PaymentsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class RefundRepository : EfCoreRepository<PaymentsDbContext, Refund, Guid>, IRefundRepository |
|||
{ |
|||
public RefundRepository(IDbContextProvider<PaymentsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using EasyAbp.EShop.Payments.Authorization |
|||
@using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["Payment"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:Payment"].Value); |
|||
PageLayout.Content.MenuItemName = "Payment"; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Payments/Payments/Payment/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Payments/Payments/Payment/index.css"/> |
|||
} |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["Payment"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-right"> |
|||
@if (await Authorization.IsGrantedAsync(PaymentsPermissions.Payments.Create)) |
|||
{ |
|||
<abp-button id="NewPaymentButton" |
|||
text="@L["CreatePayment"].Value" |
|||
icon="plus" |
|||
button-type="Primary" /> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="PaymentTable" class="nowrap"> |
|||
<thead> |
|||
<tr> |
|||
<th>@L["Actions"]</th> |
|||
<th>@L["PaymentStoreId"]</th> |
|||
<th>@L["PaymentPaymentMethod"]</th> |
|||
<th>@L["PaymentExternalTradingCode"]</th> |
|||
<th>@L["PaymentCurrency"]</th> |
|||
<th>@L["PaymentOriginalPaymentAmount"]</th> |
|||
<th>@L["PaymentPaymentDiscount"]</th> |
|||
<th>@L["PaymentActualPaymentAmount"]</th> |
|||
<th>@L["PaymentRefundAmount"]</th> |
|||
<th>@L["PaymentCompletionTime"]</th> |
|||
<th>@L["PaymentCancelledTime"]</th> |
|||
</tr> |
|||
</thead> |
|||
</abp-table> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment |
|||
{ |
|||
public class IndexModel : PaymentsPageModel |
|||
{ |
|||
public async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPayments'); |
|||
|
|||
var service = easyAbp.eShop.payments.payments.payment; |
|||
|
|||
var dataTable = $('#PaymentTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[1, "asc"]], |
|||
ajax: abp.libs.datatables.createAjax(service.getList), |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('PaymentItem'), |
|||
action: function (data) { |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ data: "storeId" }, |
|||
{ data: "paymentMethod" }, |
|||
{ data: "externalTradingCode" }, |
|||
{ data: "currency" }, |
|||
{ data: "originalPaymentAmount" }, |
|||
{ data: "paymentDiscount" }, |
|||
{ data: "actualPaymentAmount" }, |
|||
{ data: "refundAmount" }, |
|||
{ data: "completionTime" }, |
|||
{ data: "cancelledTime" }, |
|||
] |
|||
})); |
|||
}); |
|||
@ -0,0 +1,60 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using EasyAbp.EShop.Payments.Authorization |
|||
@using EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["Refund"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:Refund"].Value); |
|||
PageLayout.Content.MenuItemName = "Refund"; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Payments/Refunds/Refund/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Payments/Refunds/Refund/index.css"/> |
|||
} |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["Refund"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-right"> |
|||
@if (await Authorization.IsGrantedAsync(PaymentsPermissions.Refunds.Create)) |
|||
{ |
|||
<abp-button id="NewRefundButton" |
|||
text="@L["CreateRefund"].Value" |
|||
icon="plus" |
|||
button-type="Primary" /> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="RefundTable" class="nowrap"> |
|||
<thead> |
|||
<tr> |
|||
<th>@L["Actions"]</th> |
|||
<th>@L["RefundStoreId"]</th> |
|||
<th>@L["RefundPaymentId"]</th> |
|||
<th>@L["RefundPaymentItemId"]</th> |
|||
<th>@L["RefundRefundPaymentMethod"]</th> |
|||
<th>@L["RefundExternalTradingCode"]</th> |
|||
<th>@L["RefundCurrency"]</th> |
|||
<th>@L["RefundRefundAmount"]</th> |
|||
<th>@L["RefundCustomerRemark"]</th> |
|||
<th>@L["RefundStaffRemark"]</th> |
|||
</tr> |
|||
</thead> |
|||
</abp-table> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund |
|||
{ |
|||
public class IndexModel : PaymentsPageModel |
|||
{ |
|||
public async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPayments'); |
|||
|
|||
var service = easyAbp.eShop.payments.refunds.refund; |
|||
var createModal = new abp.ModalManager(abp.appPath + 'EShop/Payments/Refunds/Refund/CreateModal'); |
|||
var editModal = new abp.ModalManager(abp.appPath + 'EShop/Payments/Refunds/Refund/EditModal'); |
|||
|
|||
var dataTable = $('#RefundTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[1, "asc"]], |
|||
ajax: abp.libs.datatables.createAjax(service.getList), |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('Detail'), |
|||
action: function (data) { |
|||
} |
|||
}, |
|||
] |
|||
} |
|||
}, |
|||
{ data: "storeId" }, |
|||
{ data: "paymentId" }, |
|||
{ data: "paymentItemId" }, |
|||
{ data: "refundPaymentMethod" }, |
|||
{ data: "externalTradingCode" }, |
|||
{ data: "currency" }, |
|||
{ data: "refundAmount" }, |
|||
{ data: "customerRemark" }, |
|||
{ data: "staffRemark" }, |
|||
] |
|||
})); |
|||
|
|||
createModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
editModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
$('#NewRefundButton').click(function (e) { |
|||
e.preventDefault(); |
|||
createModal.open(); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,26 @@ |
|||
using Shouldly; |
|||
using System.Threading.Tasks; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentAppServiceTests : PaymentsApplicationTestBase |
|||
{ |
|||
private readonly IPaymentAppService _paymentAppService; |
|||
|
|||
public PaymentAppServiceTests() |
|||
{ |
|||
_paymentAppService = GetRequiredService<IPaymentAppService>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
// Assert
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using Shouldly; |
|||
using System.Threading.Tasks; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class RefundAppServiceTests : PaymentsApplicationTestBase |
|||
{ |
|||
private readonly IRefundAppService _refundAppService; |
|||
|
|||
public RefundAppServiceTests() |
|||
{ |
|||
_refundAppService = GetRequiredService<IRefundAppService>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
// Assert
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentDomainTests : PaymentsDomainTestBase |
|||
{ |
|||
public PaymentDomainTests() |
|||
{ |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Assert
|
|||
|
|||
// Assert
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class RefundDomainTests : PaymentsDomainTestBase |
|||
{ |
|||
public RefundDomainTests() |
|||
{ |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Assert
|
|||
|
|||
// Assert
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Payments.Payments; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Payments |
|||
{ |
|||
public class PaymentRepositoryTests : PaymentsEntityFrameworkCoreTestBase |
|||
{ |
|||
private readonly IRepository<Payment, Guid> _paymentRepository; |
|||
|
|||
public PaymentRepositoryTests() |
|||
{ |
|||
_paymentRepository = GetRequiredService<IRepository<Payment, Guid>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
await WithUnitOfWorkAsync(async () => |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
//Assert
|
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Payments.Refunds; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Payments.EntityFrameworkCore.Refunds |
|||
{ |
|||
public class RefundRepositoryTests : PaymentsEntityFrameworkCoreTestBase |
|||
{ |
|||
private readonly IRepository<Refund, Guid> _refundRepository; |
|||
|
|||
public RefundRepositoryTests() |
|||
{ |
|||
_refundRepository = GetRequiredService<IRepository<Refund, Guid>>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
await WithUnitOfWorkAsync(async () => |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
//Assert
|
|||
}); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue