本文实例为大家分享了微信小程序支付C#后端源码,供大家参考,具体内容如下
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web;using System.Web.Mvc;using System.IO;using System.Security.Cryptography;using System.Text;using System.Xml;using Newtonsoft.Json;using Newtonsoft.Json.Linq;namespace Mvc_vue.Controllers{ public class wxController : Controller { // // GET: /wx/ public ActionResult Index() { return View(); } //所需值 public static string _appid = "wxd930ea5d5a258f4f"; public static string _mch_id = "10000100"; public static string _key = "192006250b4c09247ec02edce69f6a2d"; //模拟wx统一下单 openid(前台获取) public string getda(string openid) { return Getprepay_id(_appid, "shanghaifendian", "monixiaofei", _mch_id, GetRandomString(30), "http://puteHash(messageBytes); return Convert.ToBase64String(hashmessage); } } /// <summary> /// wx统一下单请求数据 /// </summary> /// <param name="URL">请求地址</param> /// <param name="urlArgs">参数</param> /// <returns></returns> private static string sendPost(string URL, string urlArgs) { //context.Request["args"] System.Net.WebClient wCient = new System.Net.WebClient(); wCient.Headers.Add("Content-Type", "application/x- Framework4微信小程序支付前端源码
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。