• .NET+MVC+Alipay的Sdk版单笔转账到支付宝账户接口


     public class AliPayController : Controller
        {
            // GET: AliPay
            public ActionResult Index()
            {
                return RedirectToAction("PayRequest");
            }
            public static string merchant_private_key = "/BUD4N8Y6Nh9sL4o4KfoMM+/+uoHFQn+/M++++//“/// <summary>
            /// //支付宝的公钥,查看地址:https://b.alipay.com/order/pidAndKey.htm 
            /// </summary>
            public static string alipay_public_key = "/FCEa3/cNMW0QIDAQAB";
    
    
    
            /// <summary>
            /// RSA2私钥 
            /// </summary>
            //public static string private_key = "+++++/Ms20n4l/+///on/Vm4R2/GMS+B0JHrgjrC6uw==";
            /// <summary>
            /// RSA2公钥
            /// </summary>
            //public static string alipay_public_key = "///fQIDAQAB";
    
    
            //[HttpPost]
            public ActionResult PayRequest()
            {
                IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", "2018999999999999", merchant_private_key, "json", "1.0", "RSA", alipay_public_key, "GBK", false);
                AlipayFundTransToaccountTransferRequest request = new AlipayFundTransToaccountTransferRequest();
                request.BizContent = "{" +
            ""out_biz_no":"1888888899999"," +
            ""payee_type":"ALIPAY_LOGONID"," +
            ""payee_account":"999@foxmail.com"," +
            ""amount":"0.1"," +
            ""remark":"转账备注"" +
            "}";
                //Execute 执行服务端返回结果  SDKExecute执行 请求信息 返回到客户端
                AlipayFundTransToaccountTransferResponse response = client.Execute(request);
    
                Console.WriteLine(response.Body);
                return View();
            }
        }
  • 相关阅读:
    Domain Model
    linux 后台运行命令
    morphia(3)-查询
    [八省联考2018] 劈配
    [BZOJ 3218] a+b Problem
    [学习笔记] KM算法
    [HNOI2013] 消毒
    [HNOI2014] 画框
    [HDU 6057] Kanade's convolution
    [模板] 任意模数多项式乘法
  • 原文地址:https://www.cnblogs.com/Warmsunshine/p/8436356.html
Copyright © 2020-2023  润新知