zoukankan      html  css  js  c++  java
  • .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();
            }
        }
  • 相关阅读:
    ImageView一例
    TextView之一:子类的常用属性
    TextView之二:常用属性
    Android中的消息机制:Handler消息传递机制
    关于LayoutParams
    LinearLayout的一些注意事项
    支付宝扫描二维码登录网站
    Cok
    Cok
    STM32的USART
  • 原文地址:https://www.cnblogs.com/Warmsunshine/p/8436356.html
Copyright © 2011-2022 走看看