Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

749 B
Raw Blame
using Grand.Business.Core.Interfaces.Checkout.Payments;
using Grand.Infrastructure.Mapper;
using Grand.Web.AdminShared.Models.Payments;

namespace Grand.Web.AdminShared.Extensions.Mapping;

public static class IPaymentMethodMappingExtensions
{
    public static async Task<PaymentMethodModel> ToModel(this IPaymentProvider entity)
    {
        var paymentmethod = entity.MapTo<IPaymentProvider, PaymentMethodModel>();

        paymentmethod.SupportCapture = await entity.SupportCapture();
        paymentmethod.SupportPartiallyRefund = await entity.SupportPartiallyRefund();
        paymentmethod.SupportRefund = await entity.SupportRefund();
        paymentmethod.SupportVoid = await entity.SupportVoid();

        return paymentmethod;
    }
}