mirror of https://github.com/EasyAbp/EShop.git
123 changed files with 3485 additions and 2340 deletions
@ -1,20 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class CreatePaymentDto |
|||
{ |
|||
[DisplayName("PaymentPaymentMethod")] |
|||
public string PaymentMethod { get; set; } |
|||
|
|||
[DisplayName("PaymentCurrency")] |
|||
public string Currency { get; set; } |
|||
|
|||
[DisplayName("PaymentExtraProperties")] |
|||
public Dictionary<string, object> ExtraProperties { get; set; } |
|||
|
|||
[DisplayName("PaymentItem")] |
|||
public List<CreatePaymentItemDto> PaymentItems { get; set; } |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class CreatePaymentItemDto |
|||
{ |
|||
[DisplayName("PaymentItemItemType")] |
|||
public string ItemType { get; set; } |
|||
|
|||
[DisplayName("PaymentItemItemKey")] |
|||
public Guid ItemKey { get; set; } |
|||
|
|||
[DisplayName("PaymentItemCurrency")] |
|||
public string Currency { get; set; } |
|||
|
|||
[DisplayName("PaymentItemOriginalPaymentAmount")] |
|||
public decimal OriginalPaymentAmount { get; set; } |
|||
} |
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class PaymentDto : ExtensibleFullAuditedEntityDto<Guid> |
|||
{ |
|||
public Guid UserId { get; set; } |
|||
|
|||
public string PaymentMethod { get; set; } |
|||
|
|||
public string ExternalTradingCode { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal OriginalPaymentAmount { get; set; } |
|||
|
|||
public decimal PaymentDiscount { get; set; } |
|||
|
|||
public decimal ActualPaymentAmount { get; set; } |
|||
|
|||
public decimal RefundAmount { get; set; } |
|||
|
|||
public DateTime? CompletionTime { get; set; } |
|||
|
|||
public List<PaymentItemDto> PaymentItems { get; set; } |
|||
} |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments.Dtos |
|||
{ |
|||
public class PaymentItemDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public string ItemType { get; set; } |
|||
|
|||
public Guid ItemKey { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal OriginalPaymentAmount { get; set; } |
|||
|
|||
public decimal PaymentDiscount { get; set; } |
|||
|
|||
public decimal ActualPaymentAmount { get; set; } |
|||
|
|||
public decimal RefundAmount { get; set; } |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Payments.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentAppService : |
|||
ICrudAppService< |
|||
PaymentDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreatePaymentDto, |
|||
object> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Payments.Refunds.Dtos |
|||
{ |
|||
public class CreateRefundDto |
|||
{ |
|||
[DisplayName("RefundStoreId")] |
|||
public Guid StoreId { get; set; } |
|||
|
|||
[DisplayName("RefundOrderId")] |
|||
public Guid OrderId { get; set; } |
|||
|
|||
[DisplayName("RefundRefundPaymentMethod")] |
|||
public string RefundPaymentMethod { get; set; } |
|||
|
|||
[DisplayName("RefundExternalTradingCode")] |
|||
public string ExternalTradingCode { get; set; } |
|||
|
|||
[DisplayName("RefundCurrency")] |
|||
public string Currency { get; set; } |
|||
|
|||
[DisplayName("RefundRefundAmount")] |
|||
public decimal RefundAmount { get; set; } |
|||
|
|||
[DisplayName("RefundCustomerRemark")] |
|||
public string CustomerRemark { get; set; } |
|||
|
|||
[DisplayName("RefundStaffRemark")] |
|||
public string StaffRemark { get; set; } |
|||
} |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds.Dtos |
|||
{ |
|||
public class RefundDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid OrderId { get; set; } |
|||
|
|||
public string RefundPaymentMethod { get; set; } |
|||
|
|||
public string ExternalTradingCode { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal RefundAmount { get; set; } |
|||
|
|||
public string CustomerRemark { get; set; } |
|||
|
|||
public string StaffRemark { get; set; } |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Refunds.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public interface IRefundAppService : |
|||
ICrudAppService< |
|||
RefundDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateRefundDto, |
|||
object> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentAuthorizer |
|||
{ |
|||
Task<bool> IsPaymentItemAllowedAsync(Payment payment, PaymentItem paymentItem, |
|||
Dictionary<string, object> inputExtraProperties); |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class MultiCurrencyNotSupportedException : BusinessException |
|||
{ |
|||
public MultiCurrencyNotSupportedException() : base(message: $"Multi-currency is not supported.") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,123 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Payments.Payments.Dtos; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentAppService : CrudAppService<Payment, PaymentDto, Guid, PagedAndSortedResultRequestDto, CreatePaymentDto, object>, |
|||
IPaymentAppService |
|||
{ |
|||
private readonly IPaymentPayeeAccountProvider _paymentPayeeAccountProvider; |
|||
private readonly IPaymentServiceResolver _paymentServiceResolver; |
|||
private readonly IPaymentRepository _repository; |
|||
|
|||
public PaymentAppService( |
|||
IPaymentPayeeAccountProvider paymentPayeeAccountProvider, |
|||
IPaymentServiceResolver paymentServiceResolver, |
|||
IPaymentRepository repository) : base(repository) |
|||
{ |
|||
_paymentPayeeAccountProvider = paymentPayeeAccountProvider; |
|||
_paymentServiceResolver = paymentServiceResolver; |
|||
_repository = repository; |
|||
} |
|||
|
|||
public override Task<PaymentDto> GetAsync(Guid id) |
|||
{ |
|||
// Todo: Check permission.
|
|||
return base.GetAsync(id); |
|||
} |
|||
|
|||
public override Task<PagedResultDto<PaymentDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|||
{ |
|||
// Todo: Check permission.
|
|||
return base.GetListAsync(input); |
|||
} |
|||
|
|||
public override async Task<PaymentDto> CreateAsync(CreatePaymentDto input) |
|||
{ |
|||
await CheckCreatePolicyAsync(); |
|||
|
|||
var providerType = _paymentServiceResolver.GetProviderTypeOrDefault(input.PaymentMethod) ?? |
|||
throw new UnknownPaymentMethodException(input.PaymentMethod); |
|||
|
|||
var provider = ServiceProvider.GetService(providerType) as IPaymentServiceProvider ?? |
|||
throw new UnknownPaymentMethodException(input.PaymentMethod); |
|||
|
|||
var paymentItems = input.PaymentItems.Select(inputPaymentItem => |
|||
new PaymentItem(GuidGenerator.Create(), inputPaymentItem.ItemType, inputPaymentItem.ItemKey, |
|||
inputPaymentItem.Currency, inputPaymentItem.OriginalPaymentAmount)).ToList(); |
|||
|
|||
if (paymentItems.Select(item => item.Currency).Any(c => c != input.Currency)) |
|||
{ |
|||
throw new MultiCurrencyNotSupportedException(); |
|||
} |
|||
|
|||
var payment = new Payment(GuidGenerator.Create(), CurrentTenant.Id, CurrentUser.GetId(), |
|||
input.PaymentMethod, input.Currency, paymentItems.Select(item => item.OriginalPaymentAmount).Sum(), |
|||
paymentItems); |
|||
|
|||
await Repository.InsertAsync(payment, autoSave: true); |
|||
|
|||
await CheckPayableAsync(payment, input.ExtraProperties); |
|||
|
|||
var payeeConfigurations = await GetPayeeConfigurationsAsync(payment, input.ExtraProperties); |
|||
|
|||
// Todo: payment discount
|
|||
|
|||
await provider.PayAsync(payment, input.ExtraProperties, payeeConfigurations); |
|||
|
|||
return MapToGetOutputDto(payment); |
|||
} |
|||
|
|||
protected virtual Task<Dictionary<string, object>> GetPayeeConfigurationsAsync(Payment payment, |
|||
Dictionary<string, object> inputExtraProperties) |
|||
{ |
|||
// Todo: use payee configurations provider.
|
|||
// Todo: get store side payee configurations.
|
|||
|
|||
var payeeConfigurations = new Dictionary<string, object>(); |
|||
|
|||
return Task.FromResult(payeeConfigurations); |
|||
} |
|||
|
|||
protected virtual async Task CheckPayableAsync(Payment payment, Dictionary<string, object> inputExtraProperties) |
|||
{ |
|||
var itemSet = new HashSet<PaymentItem>(payment.PaymentItems); |
|||
|
|||
foreach (var authorizer in ServiceProvider.GetServices<IPaymentAuthorizer>()) |
|||
{ |
|||
foreach (var item in itemSet.ToList()) |
|||
{ |
|||
if (await authorizer.IsPaymentItemAllowedAsync(payment, item, inputExtraProperties)) |
|||
{ |
|||
itemSet.Remove(item); |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (!itemSet.IsNullOrEmpty()) |
|||
{ |
|||
throw new PaymentItemNotPayableException(itemSet.Select(item => item.ItemKey).ToList()); |
|||
} |
|||
} |
|||
|
|||
[RemoteService(false)] |
|||
public override Task<PaymentDto> UpdateAsync(Guid id, object input) |
|||
{ |
|||
throw new NotSupportedException(); |
|||
} |
|||
|
|||
[RemoteService(false)] |
|||
public override Task DeleteAsync(Guid id) |
|||
{ |
|||
throw new NotSupportedException(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentItemNotPayableException : BusinessException |
|||
{ |
|||
public PaymentItemNotPayableException(Guid itemKey) : base( |
|||
message: $"Payment item ({itemKey}) is not payable") |
|||
{ |
|||
} |
|||
|
|||
public PaymentItemNotPayableException(IEnumerable<Guid> itemKeys) : base( |
|||
message: $"Payment item ({itemKeys.JoinAsString(", ")}) is not payable") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
using EasyAbp.EShop.Payments.Localization; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments |
|||
{ |
|||
public abstract class PaymentsAppService : ApplicationService |
|||
{ |
|||
protected PaymentsAppService() |
|||
{ |
|||
LocalizationResource = typeof(PaymentsResource); |
|||
ObjectMapperContext = typeof(EShopPaymentsApplicationModule); |
|||
} |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Payments.Refunds.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class RefundAppService : CrudAppService<Refund, RefundDto, Guid, PagedAndSortedResultRequestDto, CreateRefundDto, object>, |
|||
IRefundAppService |
|||
{ |
|||
private readonly IRefundRepository _repository; |
|||
|
|||
public RefundAppService(IRefundRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -1,47 +1,5 @@ |
|||
{ |
|||
"culture": "cs", |
|||
"texts": { |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
} |
|||
} |
|||
@ -1,48 +1,6 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"ManageYourProfile": "Manage your profile", |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
"ManageYourProfile": "Manage your profile" |
|||
} |
|||
} |
|||
@ -1,47 +1,5 @@ |
|||
{ |
|||
"culture": "pl", |
|||
"texts": { |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
} |
|||
} |
|||
@ -1,47 +1,5 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
} |
|||
} |
|||
@ -1,48 +1,6 @@ |
|||
{ |
|||
"culture": "sl", |
|||
"texts": { |
|||
"ManageYourProfile": "Upravljajte svojim profilom", |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
"ManageYourProfile": "Upravljajte svojim profilom" |
|||
} |
|||
} |
|||
@ -1,48 +1,6 @@ |
|||
{ |
|||
"culture": "tr", |
|||
"texts": { |
|||
"ManageYourProfile": "Profil y�netimi", |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
"ManageYourProfile": "Profil y�netimi" |
|||
} |
|||
} |
|||
@ -1,47 +1,5 @@ |
|||
{ |
|||
"culture": "vi", |
|||
"texts": { |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
} |
|||
} |
|||
@ -1,48 +1,6 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"ManageYourProfile": "管理个人资料", |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
"ManageYourProfile": "管理个人资料" |
|||
} |
|||
} |
|||
@ -1,48 +1,6 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"ManageYourProfile": "管理個人資料", |
|||
"Menu:Payment": "MenuPayment", |
|||
"Payment": "Payment", |
|||
"PaymentTenantId": "PaymentTenantId", |
|||
"PaymentPaymentMethod": "PaymentPaymentMethod", |
|||
"PaymentExternalTradingCode": "PaymentExternalTradingCode", |
|||
"PaymentCurrency": "PaymentCurrency", |
|||
"PaymentOriginalPaymentAmount": "PaymentOriginalPaymentAmount", |
|||
"PaymentExtraProperties": "PaymentExtraProperties", |
|||
"PaymentPaymentDiscount": "PaymentPaymentDiscount", |
|||
"PaymentActualPaymentAmount": "PaymentActualPaymentAmount", |
|||
"PaymentRefundAmount": "PaymentRefundAmount", |
|||
"PaymentCompletionTime": "PaymentCompletionTime", |
|||
"CreatePayment": "CreatePayment", |
|||
"EditPayment": "EditPayment", |
|||
"PaymentDeletionConfirmationMessage": "Are you sure to delete the payment {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Refund": "MenuRefund", |
|||
"Refund": "Refund", |
|||
"RefundTenantId": "RefundTenantId", |
|||
"RefundStoreId": "RefundStoreId", |
|||
"RefundOrderId": "RefundOrderId", |
|||
"RefundRefundPaymentMethod": "RefundRefundPaymentMethod", |
|||
"RefundExternalTradingCode": "RefundExternalTradingCode", |
|||
"RefundCurrency": "RefundCurrency", |
|||
"RefundRefundAmount": "RefundRefundAmount", |
|||
"RefundCustomerRemark": "RefundCustomerRemark", |
|||
"RefundStaffRemark": "RefundStaffRemark", |
|||
"CreateRefund": "CreateRefund", |
|||
"EditRefund": "EditRefund", |
|||
"RefundDeletionConfirmationMessage": "Are you sure to delete the refund {0}?", |
|||
"Menu:PaymentItem": "MenuPaymentItem", |
|||
"PaymentItem": "PaymentItem", |
|||
"PaymentItemItemType": "PaymentItemItemType", |
|||
"PaymentItemItemKey": "PaymentItemItemKey", |
|||
"PaymentItemCurrency": "PaymentItemCurrency", |
|||
"PaymentItemOriginalPaymentAmount": "PaymentItemOriginalPaymentAmount", |
|||
"PaymentItemPaymentDiscount": "PaymentItemPaymentDiscount", |
|||
"PaymentItemActualPaymentAmount": "PaymentItemActualPaymentAmount", |
|||
"PaymentItemRefundAmount": "PaymentItemRefundAmount", |
|||
"CreatePaymentItem": "CreatePaymentItem", |
|||
"EditPaymentItem": "EditPaymentItem", |
|||
"PaymentItemDeletionConfirmationMessage": "Are you sure to delete the PaymentItem {0}?" |
|||
"ManageYourProfile": "管理個人資料" |
|||
} |
|||
} |
|||
@ -1,33 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
[Serializable] |
|||
public class PaymentEto |
|||
{ |
|||
public Guid UserId { get; set; } |
|||
|
|||
public Guid Id { get; set; } |
|||
|
|||
public Guid? TenantId { get; set; } |
|||
|
|||
public string PaymentMethod { get; set; } |
|||
|
|||
public string ExternalTradingCode { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal OriginalPaymentAmount { get; set; } |
|||
|
|||
public decimal PaymentDiscount { get; set; } |
|||
|
|||
public decimal ActualPaymentAmount { get; set; } |
|||
|
|||
public decimal RefundAmount { get; set; } |
|||
|
|||
public DateTime? CompletionTime { get; set; } |
|||
|
|||
public List<PaymentItemEto> PaymentItems { get; set; } |
|||
} |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
[Serializable] |
|||
public class PaymentItemEto |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string ItemType { get; set; } |
|||
|
|||
public Guid ItemKey { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal OriginalPaymentAmount { get; set; } |
|||
|
|||
public decimal PaymentDiscount { get; set; } |
|||
|
|||
public decimal ActualPaymentAmount { get; set; } |
|||
|
|||
public decimal RefundAmount { get; set; } |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class CurrencyNotSupportedException : BusinessException |
|||
{ |
|||
public CurrencyNotSupportedException(string paymentMethod, string currency) : base( |
|||
message: $"Payment method {paymentMethod} does not support currency: {currency}") |
|||
{ |
|||
} |
|||
|
|||
public CurrencyNotSupportedException(string paymentMethod, string currency, Guid storeId) : base( |
|||
message: $"Payment method {paymentMethod} in store {storeId} does not support currency: {currency}") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,36 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Timing; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class FreePaymentServiceProvider : IPaymentServiceProvider, ITransientDependency |
|||
{ |
|||
private readonly IClock _clock; |
|||
private readonly IPaymentRepository _paymentRepository; |
|||
public const string PaymentMethod = "Free"; |
|||
|
|||
public FreePaymentServiceProvider( |
|||
IClock clock, |
|||
IPaymentRepository paymentRepository) |
|||
{ |
|||
_clock = clock; |
|||
_paymentRepository = paymentRepository; |
|||
} |
|||
|
|||
public async Task<Payment> PayAsync(Payment payment, Dictionary<string, object> inputExtraProperties, |
|||
Dictionary<string, object> payeeConfigurations) |
|||
{ |
|||
payment.SetPayeeAccount("None"); |
|||
|
|||
payment.SetExternalTradingCode(payment.Id.ToString()); |
|||
|
|||
payment.CompletePayment(_clock.Now); |
|||
|
|||
return await _paymentRepository.UpdateAsync(payment, true); |
|||
} |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentPayeeAccountProvider |
|||
{ |
|||
Task<string> GetPayeeAccountAsync(Payment payment, Dictionary<string, object> inputExtraProperties); |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentRepository : IRepository<Payment, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentServiceProvider |
|||
{ |
|||
Task<Payment> PayAsync(Payment payment, Dictionary<string, object> inputExtraProperties, |
|||
Dictionary<string, object> payeeConfigurations); |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public interface IPaymentServiceResolver |
|||
{ |
|||
bool TryRegisterProvider(string paymentMethod, Type providerType); |
|||
|
|||
List<string> GetPaymentMethods(); |
|||
|
|||
Type GetProviderTypeOrDefault(string paymentMethod); |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PayeeAccountNotFoundException : BusinessException |
|||
{ |
|||
public PayeeAccountNotFoundException(string paymentMethod) : base( |
|||
message: $"Cannot find the payee account of payment method {paymentMethod}.") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PayeeConfigurationMissingValueException : BusinessException |
|||
{ |
|||
public PayeeConfigurationMissingValueException(string paymentMethod, string configurationKey) : base( |
|||
message: $"Payment method ({paymentMethod}) is missing configuration: {configurationKey}.") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,99 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class Payment : FullAuditedAggregateRoot<Guid>, IMultiTenant |
|||
{ |
|||
public virtual Guid? TenantId { get; protected set; } |
|||
|
|||
public virtual Guid UserId { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string PaymentMethod { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string PayeeAccount { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string ExternalTradingCode { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string Currency { get; protected set; } |
|||
|
|||
public virtual decimal OriginalPaymentAmount { get; protected set; } |
|||
|
|||
public virtual decimal PaymentDiscount { get; protected set; } |
|||
|
|||
public virtual decimal ActualPaymentAmount { get; protected set; } |
|||
|
|||
public virtual decimal RefundAmount { get; protected set; } |
|||
|
|||
public virtual DateTime? CompletionTime { get; protected set; } |
|||
|
|||
public virtual List<PaymentItem> PaymentItems { get; protected set; } |
|||
|
|||
protected Payment() |
|||
{ |
|||
PaymentItems = new List<PaymentItem>(); |
|||
} |
|||
|
|||
public Payment( |
|||
Guid id, |
|||
Guid? tenantId, |
|||
Guid userId, |
|||
[NotNull] string paymentMethod, |
|||
[NotNull] string currency, |
|||
decimal originalPaymentAmount, |
|||
List<PaymentItem> paymentItems |
|||
) :base(id) |
|||
{ |
|||
TenantId = tenantId; |
|||
UserId = userId; |
|||
PaymentMethod = paymentMethod; |
|||
Currency = currency; |
|||
OriginalPaymentAmount = originalPaymentAmount; |
|||
ActualPaymentAmount = originalPaymentAmount; |
|||
PaymentItems = paymentItems; |
|||
RefundAmount = 0; |
|||
} |
|||
|
|||
public void SetPayeeAccount([NotNull] string payeeAccount) |
|||
{ |
|||
PayeeAccount = payeeAccount; |
|||
} |
|||
|
|||
public void SetExternalTradingCode([NotNull] string externalTradingCode) |
|||
{ |
|||
CheckPaymentIsNotCompleted(); |
|||
|
|||
ExternalTradingCode = externalTradingCode; |
|||
} |
|||
|
|||
public void SetPaymentDiscount(decimal paymentDiscount) |
|||
{ |
|||
CheckPaymentIsNotCompleted(); |
|||
|
|||
PaymentDiscount = paymentDiscount; |
|||
ActualPaymentAmount -= paymentDiscount; |
|||
} |
|||
|
|||
public void CompletePayment(DateTime completionTime) |
|||
{ |
|||
CheckPaymentIsNotCompleted(); |
|||
|
|||
CompletionTime = completionTime; |
|||
} |
|||
|
|||
private void CheckPaymentIsNotCompleted() |
|||
{ |
|||
if (CompletionTime.HasValue) |
|||
{ |
|||
throw new PaymentHasAlreadyBeenCompletedException(Id); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentHasAlreadyBeenCompletedException : BusinessException |
|||
{ |
|||
public PaymentHasAlreadyBeenCompletedException(Guid id) : base( |
|||
message: $"Payment ({id}) has already been completed.") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,53 +0,0 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentItem : FullAuditedEntity<Guid> |
|||
{ |
|||
[NotNull] |
|||
public virtual string ItemType { get; protected set; } |
|||
|
|||
public virtual Guid ItemKey { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string Currency { get; protected set; } |
|||
|
|||
public virtual decimal OriginalPaymentAmount { get; protected set; } |
|||
|
|||
public virtual decimal PaymentDiscount { get; protected set; } |
|||
|
|||
public virtual decimal ActualPaymentAmount { get; protected set; } |
|||
|
|||
public virtual decimal RefundAmount { get; protected set; } |
|||
|
|||
protected PaymentItem() |
|||
{ |
|||
} |
|||
|
|||
public PaymentItem( |
|||
Guid id, |
|||
[NotNull] string itemType, |
|||
Guid itemKey, |
|||
[NotNull] string currency, |
|||
decimal originalPaymentAmount |
|||
) :base(id) |
|||
{ |
|||
ItemType = itemType; |
|||
ItemKey = itemKey; |
|||
Currency = currency; |
|||
OriginalPaymentAmount = originalPaymentAmount; |
|||
} |
|||
|
|||
public void CompletePayment( |
|||
decimal paymentDiscount, |
|||
decimal actualPaymentAmount, |
|||
decimal refundAmount) |
|||
{ |
|||
PaymentDiscount = paymentDiscount; |
|||
ActualPaymentAmount = actualPaymentAmount; |
|||
RefundAmount = refundAmount; |
|||
} |
|||
} |
|||
} |
|||
@ -1,36 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Payments.Settings; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Settings; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentPayeeAccountProvider : IPaymentPayeeAccountProvider, ITransientDependency |
|||
{ |
|||
private readonly IPaymentRepository _paymentRepository; |
|||
private readonly ISettingProvider _settingProvider; |
|||
|
|||
public PaymentPayeeAccountProvider( |
|||
IPaymentRepository paymentRepository, |
|||
ISettingProvider settingProvider) |
|||
{ |
|||
_paymentRepository = paymentRepository; |
|||
_settingProvider = settingProvider; |
|||
} |
|||
public async Task<string> GetPayeeAccountAsync(Payment payment, Dictionary<string, object> inputExtraProperties) |
|||
{ |
|||
// Todo: support multi-store.
|
|||
|
|||
var payeeAccount = await _settingProvider.GetOrNullAsync( |
|||
PaymentsSettings.GroupName + "." + payment.PaymentMethod + ".DefaultPayeeAccount"); |
|||
|
|||
if (payeeAccount == null) |
|||
{ |
|||
throw new PayeeAccountNotFoundException(payment.PaymentMethod); |
|||
} |
|||
|
|||
return payeeAccount; |
|||
} |
|||
} |
|||
} |
|||
@ -1,51 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class PaymentServiceResolver : IPaymentServiceResolver, ISingletonDependency |
|||
{ |
|||
protected readonly Dictionary<string, Type> Providers = new Dictionary<string, Type>(); |
|||
|
|||
private readonly IServiceProvider _serviceProvider; |
|||
|
|||
public PaymentServiceResolver(IServiceProvider serviceProvider) |
|||
{ |
|||
_serviceProvider = serviceProvider; |
|||
} |
|||
|
|||
public virtual bool TryRegisterProvider(string paymentMethod, Type providerType) |
|||
{ |
|||
if (Providers.ContainsKey(paymentMethod)) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
using (var scope = _serviceProvider.CreateScope()) |
|||
{ |
|||
if (scope.ServiceProvider.GetService(providerType) == null) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
Providers.Add(paymentMethod, providerType); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
public virtual List<string> GetPaymentMethods() |
|||
{ |
|||
return Providers.Keys.ToList(); |
|||
} |
|||
|
|||
public virtual Type GetProviderTypeOrDefault(string paymentMethod) |
|||
{ |
|||
return Providers.GetOrDefault(paymentMethod); |
|||
} |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Payments |
|||
{ |
|||
public class UnknownPaymentMethodException : BusinessException |
|||
{ |
|||
public UnknownPaymentMethodException(string paymentMethod) : base( |
|||
message: $"Payment method {paymentMethod} does not exist.") |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public interface IRefundRepository : IRepository<Refund, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -1,62 +0,0 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Refunds |
|||
{ |
|||
public class Refund : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore |
|||
{ |
|||
public virtual Guid? TenantId { get; protected set; } |
|||
|
|||
public virtual Guid StoreId { get; protected set; } |
|||
|
|||
public virtual Guid OrderId { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string RefundPaymentMethod { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string ExternalTradingCode { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string Currency { get; protected set; } |
|||
|
|||
public virtual decimal RefundAmount { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string CustomerRemark { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string StaffRemark { get; protected set; } |
|||
|
|||
protected Refund() |
|||
{ |
|||
} |
|||
|
|||
public Refund( |
|||
Guid id, |
|||
Guid? tenantId, |
|||
Guid storeId, |
|||
Guid orderId, |
|||
string refundPaymentMethod, |
|||
string externalTradingCode, |
|||
string currency, |
|||
decimal refundAmount, |
|||
string customerRemark, |
|||
string staffRemark |
|||
) :base(id) |
|||
{ |
|||
TenantId = tenantId; |
|||
StoreId = storeId; |
|||
OrderId = orderId; |
|||
RefundPaymentMethod = refundPaymentMethod; |
|||
ExternalTradingCode = externalTradingCode; |
|||
Currency = currency; |
|||
RefundAmount = refundAmount; |
|||
CustomerRemark = customerRemark; |
|||
StaffRemark = staffRemark; |
|||
} |
|||
} |
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using EasyAbp.EShop.Payments.EntityFrameworkCore; |
|||
using Microsoft.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) |
|||
{ |
|||
} |
|||
|
|||
public override IQueryable<Payment> WithDetails() |
|||
{ |
|||
return base.WithDetails().Include(x => x.PaymentItems); |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
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) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,46 +0,0 @@ |
|||
@page |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage |
|||
@model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment.IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@{ |
|||
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-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="PaymentTable" class="nowrap"> |
|||
<thead> |
|||
<tr> |
|||
<th>@L["Actions"]</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> |
|||
</tr> |
|||
</thead> |
|||
</abp-table> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -1,12 +0,0 @@ |
|||
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; |
|||
} |
|||
} |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
$(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: "paymentMethod" }, |
|||
{ data: "externalTradingCode" }, |
|||
{ data: "currency" }, |
|||
{ data: "originalPaymentAmount" }, |
|||
{ data: "paymentDiscount" }, |
|||
{ data: "actualPaymentAmount" }, |
|||
{ data: "refundAmount" }, |
|||
{ data: "completionTime" }, |
|||
] |
|||
})); |
|||
}); |
|||
@ -1,51 +0,0 @@ |
|||
@page |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage |
|||
@model EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentOrder.IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@{ |
|||
PageLayout.Content.Title = L["PaymentItem"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:PaymentItem"].Value); |
|||
PageLayout.Content.MenuItemName = "PaymentItem"; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/Payments/PaymentItem/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/Payments/PaymentItem/index.css"/> |
|||
} |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["PaymentItem"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-right"> |
|||
<abp-button id="NewPaymentItemButton" |
|||
text="@L["CreatePaymentItem"].Value" |
|||
icon="plus" |
|||
button-type="Primary" /> |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="PaymentItemTable" class="nowrap"> |
|||
<thead> |
|||
<tr> |
|||
<th>@L["Actions"]</th> |
|||
<th>@L["PaymentItemItemType"]</th> |
|||
<th>@L["PaymentItemItemKey"]</th> |
|||
<th>@L["PaymentItemCurrency"]</th> |
|||
<th>@L["PaymentItemOriginalPaymentAmount"]</th> |
|||
<th>@L["PaymentItemPaymentDiscount"]</th> |
|||
<th>@L["PaymentItemActualPaymentAmount"]</th> |
|||
<th>@L["PaymentItemRefundAmount"]</th> |
|||
</tr> |
|||
</thead> |
|||
</abp-table> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -1,12 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.PaymentOrder |
|||
{ |
|||
public class IndexModel : PaymentsPageModel |
|||
{ |
|||
public async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPayments'); |
|||
|
|||
var service = easyAbp.eShop.payments.payments.PaymentItem; |
|||
|
|||
var dataTable = $('#PaymentItemTable').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: [ |
|||
{ data: "itemType" }, |
|||
{ data: "itemKey" }, |
|||
{ data: "currency" }, |
|||
{ data: "originalPaymentAmount" }, |
|||
{ data: "paymentDiscount" }, |
|||
{ data: "actualPaymentAmount" }, |
|||
{ data: "refundAmount" }, |
|||
] |
|||
})); |
|||
}); |
|||
@ -1,47 +0,0 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Payments.Web.Pages.Refunds.Refund |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@inherits EasyAbp.EShop.Payments.Web.Pages.PaymentsPage |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@{ |
|||
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-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["RefundOrderId"]</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> |
|||
@ -1,12 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Web.Pages.Refunds.Refund |
|||
{ |
|||
public class IndexModel : PaymentsPageModel |
|||
{ |
|||
public async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPayments'); |
|||
|
|||
var service = easyAbp.eShop.payments.refunds.refund; |
|||
|
|||
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: "orderId" }, |
|||
{ data: "refundPaymentMethod" }, |
|||
{ data: "externalTradingCode" }, |
|||
{ data: "currency" }, |
|||
{ data: "refundAmount" }, |
|||
{ data: "customerRemark" }, |
|||
{ data: "staffRemark" }, |
|||
] |
|||
})); |
|||
}); |
|||
@ -1,26 +0,0 @@ |
|||
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
|
|||
} |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
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
|
|||
} |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
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
|
|||
} |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
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
|
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
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
|
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
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
|
|||
}); |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue