General.Web/Controllers/API/AlipayController.cs

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Essensoft.AspNetCore.Payment.Alipay;
using Essensoft.AspNetCore.Payment.Alipay.Domain;
using Essensoft.AspNetCore.Payment.Alipay.Notify;
using Essensoft.AspNetCore.Payment.Alipay.Request;
using General.Mvc.Models.Pay;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace General.Mvc.Controllers.API
{
    public class AlipayController : Controller
    {
        private readonly IAlipayClient _client;
        private readonly IAlipayNotifyClient _notifyClient;
        private readonly IOptions<AlipayOptions> _optionsAccessor;

        public AlipayController(IAlipayClient client, IAlipayNotifyClient notifyClient, IOptions<AlipayOptions> optionsAccessor)
        {
            _client = client;
            _notifyClient = notifyClient;
            _optionsAccessor = optionsAccessor;
        }

        /// <summary>
        /// 支付宝指引页
        /// </summary>
        [HttpGet]
        public IActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 当面付-扫码支付
        /// </summary>
        [HttpGet]
        public IActionResult PreCreate()
        {
            return View();
        }

        /// <summary>
        /// 当面付-扫码支付
        /// </summary>
        [HttpPost]
        public async Task<IActionResult> PreCreate(AlipayTradePreCreateViewModel viewModel)
        {
            var model = new AlipayTradePrecreateModel
            {
                OutTradeNo = viewModel.OutTradeNo,
                Subject = viewModel.Subject,
                TotalAmount = viewModel.TotalAmount,
                Body = viewModel.Body
            };
            var req = new AlipayTradePrecreateRequest();
后面还有 356 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。