使用 ping++做支付的流程
获取支付凭据
/// <summary>
/// 获取支付凭据
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[IsLoginAuthorizeAttribute]
public MessagesDataCode<string> GetPaymentCredential([FromBody] AlipayCharge model)
{
MessagesDataCode<string> result = new MessagesDataCode<string>(false, "无效的参数", -);
if (model != null)
{
try
{
Pingpp.Pingpp.SetApiKey("sk_live_v5KiDKS0Wz1Cnv5Oa19ebrTS"); //sk_test_zvHePSeH0SuHLqP4SGaPKWDS
string appId = "app_4WzfvTm9CGi1eLO0";
string ip = HttpContext.Current.Request.UserHostAddress;
logger.Error("支付获取到的Ip地址为:" + ip);
string OrderNum = DateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(, ); //唯一订单号
int UserId = ADT.Cache.Cache.CAC.Instance.GetUseridBySession(); //用户id
var chParams = new Dictionary<string, object>
{
// 推荐使用 8-20 位,要求数字或字母,不允许其他字符
{"order_no",OrderNum },
// 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"amount",},
// 支付使用的第三方支付渠道取值,请参考: https://www.pingxx.com/api#支付渠道属性值
{"channel", model.channel},
// 3 位 ISO 货币代码,人民币为 cny 。
{"currency", "cny"},
// 商品标题,该参数最长为 32 个 Unicode 字符,银联全渠道( upacp / upacp_wap )限制在 32 个字节。
{"subject", model.subject},
// 商品描述信息,该参数最长为 128 个 Unicode 字符, yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"body", model.body},
// 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
{"client_ip",ip},
{"app", new Dictionary<string, string> {{"id", appId}}},
// 特定渠道发起交易时需要的额外参数,以及部分渠道支付成功返回的额外参数,详细参考 https://www.pingxx.com/api#支付渠道-extra-参数说明
{"extra", new Dictionary<string,object>{
// 可选,开放平台返回的包含账户信息的 token(授权令牌,商户在一定时间内对支付宝某些服务的访问权限)。通过授权登录后获取的 alipay_open_id ,作为该参数的 value ,登录授权账户即会为支付账户,32 位字符串。
//{"extern_token", ""},
// 可选,是否发起实名校验,T 代表发起实名校验;F 代表不发起实名校验。
{"rn_check",'T'}
}},
// 可选:订单失效时间,用 Unix 时间戳表示。时间范围在订单创建后的 1 分钟到 15 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"time_expire", CreateBase64.timeExpire()},
// 可选:订单附加说明,最多 255 个 Unicode 字符。
{"description",model.description}
}; var ch = Charge.Create(chParams);
var test = JsonConvert.SerializeObject(ch);
result.Data = test;
result.Success = true;
result.Code = ;
result.Msg = "成功获取支付凭据"; //在这里生成订单
PayLogBean PayModel = new PayLogBean();
PayModel.PayNo = OrderNum;
PayModel.PayTime = DateTime.Now;
PayModel.Type = model.channel;
PayModel.Valid = false;
PayModel.UserId = UserId;
PayModel.ChangeNum = model.ChangeNum;
PayModel.OrderType = model.OrderType;
if (!new PayLog().Add(PayModel))
{
logger.Error("创建订单失败,该用户Id为" + UserId);
} } catch (Exception ex)
{
logger.Error("创建支付凭据对象发生异常:" + ex);
}
}
return result;
}
验证签名
public static class RSACryptoServiceProviderExtension
{
private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static bool VerifySignedHash(string strDataToVerify, string strSignedData, string strPublicKeyFilePath)
{
byte[] signedData = Convert.FromBase64String(strSignedData); //加密过的签名 UTF8Encoding ByteConverter = new UTF8Encoding(); byte[] dataToVerify = ByteConverter.GetBytes(strDataToVerify);//源数据,使用相同的算法进行消息摘要 ,和解密后的签名比较
try
{
string sPublicKeyPem = File.ReadAllText(strPublicKeyFilePath);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider { PersistKeyInCsp = false };
rsa.LoadPublicKeyPEM(sPublicKeyPem);
if (rsa.VerifyData(dataToVerify, "SHA256", signedData))
{
return true;
} }
catch (CryptographicException e)
{
logger.Error(e.Message); }
return false; }
#region Methods /// <summary>Extension method which initializes an RSACryptoServiceProvider from a DER public key blob.</summary>
public static void LoadPublicKeyDER(this RSACryptoServiceProvider provider, byte[] DERData)
{
byte[] RSAData = RSACryptoServiceProviderExtension.GetRSAFromDER(DERData);
byte[] publicKeyBlob = RSACryptoServiceProviderExtension.GetPublicKeyBlobFromRSA(RSAData);
provider.ImportCspBlob(publicKeyBlob);
} /// <summary>Extension method which initializes an RSACryptoServiceProvider from a DER private key blob.</summary>
public static void LoadPrivateKeyDER(this RSACryptoServiceProvider provider, byte[] DERData)
{
byte[] privateKeyBlob = RSACryptoServiceProviderExtension.GetPrivateKeyDER(DERData);
provider.ImportCspBlob(privateKeyBlob);
} /// <summary>Extension method which initializes an RSACryptoServiceProvider from a PEM public key string.</summary>
public static void LoadPublicKeyPEM(this RSACryptoServiceProvider provider, string sPEM)
{
byte[] DERData = RSACryptoServiceProviderExtension.GetDERFromPEM(sPEM);
RSACryptoServiceProviderExtension.LoadPublicKeyDER(provider, DERData);
} /// <summary>Extension method which initializes an RSACryptoServiceProvider from a PEM private key string.</summary>
public static void LoadPrivateKeyPEM(this RSACryptoServiceProvider provider, string sPEM)
{
byte[] DERData = RSACryptoServiceProviderExtension.GetDERFromPEM(sPEM);
RSACryptoServiceProviderExtension.LoadPrivateKeyDER(provider, DERData);
} /// <summary>Returns a public key blob from an RSA public key.</summary>
internal static byte[] GetPublicKeyBlobFromRSA(byte[] RSAData)
{
byte[] data = null;
UInt32 dwCertPublicKeyBlobSize = ;
if (RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING,
new IntPtr((int)CRYPT_OUTPUT_TYPES.RSA_CSP_PUBLICKEYBLOB), RSAData, (UInt32)RSAData.Length, CRYPT_DECODE_FLAGS.NONE,
data, ref dwCertPublicKeyBlobSize))
{
data = new byte[dwCertPublicKeyBlobSize];
if (!RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING,
new IntPtr((int)CRYPT_OUTPUT_TYPES.RSA_CSP_PUBLICKEYBLOB), RSAData, (UInt32)RSAData.Length, CRYPT_DECODE_FLAGS.NONE,
data, ref dwCertPublicKeyBlobSize))
throw new Win32Exception(Marshal.GetLastWin32Error());
}
else
throw new Win32Exception(Marshal.GetLastWin32Error());
return data;
} /// <summary>Converts DER binary format to a CAPI CRYPT_PRIVATE_KEY_INFO structure.</summary>
internal static byte[] GetPrivateKeyDER(byte[] DERData)
{
byte[] data = null;
UInt32 dwRSAPrivateKeyBlobSize = ;
IntPtr pRSAPrivateKeyBlob = IntPtr.Zero;
if (RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING, new IntPtr((int)CRYPT_OUTPUT_TYPES.PKCS_RSA_PRIVATE_KEY),
DERData, (UInt32)DERData.Length, CRYPT_DECODE_FLAGS.NONE, data, ref dwRSAPrivateKeyBlobSize))
{
data = new byte[dwRSAPrivateKeyBlobSize];
if (!RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING, new IntPtr((int)CRYPT_OUTPUT_TYPES.PKCS_RSA_PRIVATE_KEY),
DERData, (UInt32)DERData.Length, CRYPT_DECODE_FLAGS.NONE, data, ref dwRSAPrivateKeyBlobSize))
throw new Win32Exception(Marshal.GetLastWin32Error());
}
else
throw new Win32Exception(Marshal.GetLastWin32Error());
return data;
} /// <summary>Converts DER binary format to a CAPI CERT_PUBLIC_KEY_INFO structure containing an RSA key.</summary>
internal static byte[] GetRSAFromDER(byte[] DERData)
{
byte[] data = null;
byte[] publicKey = null;
CERT_PUBLIC_KEY_INFO info;
UInt32 dwCertPublicKeyInfoSize = ;
IntPtr pCertPublicKeyInfo = IntPtr.Zero;
if (RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING, new IntPtr((int)CRYPT_OUTPUT_TYPES.X509_PUBLIC_KEY_INFO),
DERData, (UInt32)DERData.Length, CRYPT_DECODE_FLAGS.NONE, data, ref dwCertPublicKeyInfoSize))
{
data = new byte[dwCertPublicKeyInfoSize];
if (RSACryptoServiceProviderExtension.CryptDecodeObject(CRYPT_ENCODING_FLAGS.X509_ASN_ENCODING | CRYPT_ENCODING_FLAGS.PKCS_7_ASN_ENCODING, new IntPtr((int)CRYPT_OUTPUT_TYPES.X509_PUBLIC_KEY_INFO),
DERData, (UInt32)DERData.Length, CRYPT_DECODE_FLAGS.NONE, data, ref dwCertPublicKeyInfoSize))
{
GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
info = (CERT_PUBLIC_KEY_INFO)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(CERT_PUBLIC_KEY_INFO));
publicKey = new byte[info.PublicKey.cbData];
Marshal.Copy(info.PublicKey.pbData, publicKey, , publicKey.Length);
}
finally
{
handle.Free();
}
}
else
throw new Win32Exception(Marshal.GetLastWin32Error());
}
else
throw new Win32Exception(Marshal.GetLastWin32Error());
return publicKey;
} /// <summary>Extracts the binary data from a PEM file.</summary>
internal static byte[] GetDERFromPEM(string sPEM)
{
UInt32 dwSkip, dwFlags;
UInt32 dwBinarySize = ; if (!RSACryptoServiceProviderExtension.CryptStringToBinary(sPEM, (UInt32)sPEM.Length, CRYPT_STRING_FLAGS.CRYPT_STRING_BASE64HEADER, null, ref dwBinarySize, out dwSkip, out dwFlags))
throw new Win32Exception(Marshal.GetLastWin32Error()); byte[] decodedData = new byte[dwBinarySize];
if (!RSACryptoServiceProviderExtension.CryptStringToBinary(sPEM, (UInt32)sPEM.Length, CRYPT_STRING_FLAGS.CRYPT_STRING_BASE64HEADER, decodedData, ref dwBinarySize, out dwSkip, out dwFlags))
throw new Win32Exception(Marshal.GetLastWin32Error());
return decodedData;
} #endregion Methods #region P/Invoke Constants /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_ACQUIRE_CONTEXT_FLAGS : uint
{
CRYPT_NEWKEYSET = 0x8,
CRYPT_DELETEKEYSET = 0x10,
CRYPT_MACHINE_KEYSET = 0x20,
CRYPT_SILENT = 0x40,
CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x80,
CRYPT_VERIFYCONTEXT = 0xF0000000
} /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_PROVIDER_TYPE : uint
{
PROV_RSA_FULL =
} /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_DECODE_FLAGS : uint
{
NONE = ,
CRYPT_DECODE_ALLOC_FLAG = 0x8000
} /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_ENCODING_FLAGS : uint
{
PKCS_7_ASN_ENCODING = 0x00010000,
X509_ASN_ENCODING = 0x00000001,
} /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_OUTPUT_TYPES : int
{
X509_PUBLIC_KEY_INFO = ,
RSA_CSP_PUBLICKEYBLOB = ,
PKCS_RSA_PRIVATE_KEY = ,
PKCS_PRIVATE_KEY_INFO =
} /// <summary>Enumeration derived from Crypto API.</summary>
internal enum CRYPT_STRING_FLAGS : uint
{
CRYPT_STRING_BASE64HEADER = ,
CRYPT_STRING_BASE64 = ,
CRYPT_STRING_BINARY = ,
CRYPT_STRING_BASE64REQUESTHEADER = ,
CRYPT_STRING_HEX = ,
CRYPT_STRING_HEXASCII = ,
CRYPT_STRING_BASE64_ANY = ,
CRYPT_STRING_ANY = ,
CRYPT_STRING_HEX_ANY = ,
CRYPT_STRING_BASE64X509CRLHEADER = ,
CRYPT_STRING_HEXADDR = ,
CRYPT_STRING_HEXASCIIADDR = ,
CRYPT_STRING_HEXRAW = ,
CRYPT_STRING_NOCRLF = 0x40000000,
CRYPT_STRING_NOCR = 0x80000000
} #endregion P/Invoke Constants #region P/Invoke Structures /// <summary>Structure from Crypto API.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct CRYPT_OBJID_BLOB
{
internal UInt32 cbData;
internal IntPtr pbData;
} /// <summary>Structure from Crypto API.</summary>
[StructLayout(LayoutKind.Sequential)]
internal struct CRYPT_ALGORITHM_IDENTIFIER
{
internal IntPtr pszObjId;
internal CRYPT_OBJID_BLOB Parameters;
} /// <summary>Structure from Crypto API.</summary>
[StructLayout(LayoutKind.Sequential)]
struct CRYPT_BIT_BLOB
{
internal UInt32 cbData;
internal IntPtr pbData;
internal UInt32 cUnusedBits;
} /// <summary>Structure from Crypto API.</summary>
[StructLayout(LayoutKind.Sequential)]
struct CERT_PUBLIC_KEY_INFO
{
internal CRYPT_ALGORITHM_IDENTIFIER Algorithm;
internal CRYPT_BIT_BLOB PublicKey;
} #endregion P/Invoke Structures #region P/Invoke Functions /// <summary>Function for Crypto API.</summary>
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptDestroyKey(IntPtr hKey); /// <summary>Function for Crypto API.</summary>
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptImportKey(IntPtr hProv, byte[] pbKeyData, UInt32 dwDataLen, IntPtr hPubKey, UInt32 dwFlags, ref IntPtr hKey); /// <summary>Function for Crypto API.</summary>
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptReleaseContext(IntPtr hProv, Int32 dwFlags); /// <summary>Function for Crypto API.</summary>
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptAcquireContext(ref IntPtr hProv, string pszContainer, string pszProvider, CRYPT_PROVIDER_TYPE dwProvType, CRYPT_ACQUIRE_CONTEXT_FLAGS dwFlags); /// <summary>Function from Crypto API.</summary>
[DllImport("crypt32.dll", SetLastError = true, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptStringToBinary(string sPEM, UInt32 sPEMLength, CRYPT_STRING_FLAGS dwFlags, [Out] byte[] pbBinary, ref UInt32 pcbBinary, out UInt32 pdwSkip, out UInt32 pdwFlags); /// <summary>Function from Crypto API.</summary>
[DllImport("crypt32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptDecodeObjectEx(CRYPT_ENCODING_FLAGS dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, UInt32 cbEncoded, CRYPT_DECODE_FLAGS dwFlags, IntPtr pDecodePara, ref byte[] pvStructInfo, ref UInt32 pcbStructInfo); /// <summary>Function from Crypto API.</summary>
[DllImport("crypt32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CryptDecodeObject(CRYPT_ENCODING_FLAGS dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, UInt32 cbEncoded, CRYPT_DECODE_FLAGS flags, [In, Out] byte[] pvStructInfo, ref UInt32 cbStructInfo); #endregion P/Invoke Functions
}
接受支付结果(异步)
public HttpResponseMessage Index()
{
MessagesCode result = new MessagesCode(false, "无效的参数", -);
try
{ if (HttpContext.Current.Request.RequestType.ToUpper().Equals("POST"))
{
//获取 post 的 event对象
var inputData = ReadStream(HttpContext.Current.Request.InputStream);
//获取 header 中的签名
var sig = HttpContext.Current.Request.Headers.Get("x-pingplusplus-signature"); //公钥路径(请检查你的公钥 .pem 文件存放路径) var path = HttpContext.Current.Server.MapPath("/Lib/public_key.pem"); //验证签名
if (RSACryptoServiceProviderExtension.VerifySignedHash(inputData, sig, path))
{ var jObject = JObject.Parse(inputData);
var type = jObject.SelectToken("type");
var eventType = jObject.SelectToken("object");
if (eventType.ToString() == "event")//验证接收到的是否为 Event 对象。
{
if (type.ToString() == "charge.succeeded")
{ //在这里做支付成功的逻辑处理 1.订单状态改变 2.支付目的改变 3.这里要限制一下更新的次数,只有当订单是未支付时在进行下面的操作
var data = jObject.SelectToken("data");
var credentialObject = data["object"];//凭据对象
var PayNo = credentialObject["order_no"];//订单号
logger.Error("接受到支付成功的事件");
bool IsOk = false;
PayLogBean model = new PayLog().GetModelById(PayNo.ToString());
if (model != null)
{
if (model.Valid)
{
IsOk = true;
}
else
{
using (TransactionScope ts = new TransactionScope())
{
bool OneTrans = false;
bool TwoTrans = false;
OneTrans = new PayLog().UpdateValid(PayNo.ToString(), true);
UserBean userModel = new User().GetModelById((int)model.UserId);
if (userModel != null)
{
if (model.OrderType ==)
{ if (Convert.IsDBNull(userModel.Ranketime)|| userModel.RankId==)//一定不是会员
{ userModel.Rankbtime = DateTime.Now;
userModel.Ranketime = DateTime.Now.AddMonths((int)model.ChangeNum);
userModel.RankId = ;
}
else
{//代表历史上是有会员的记录的
//判断当前是否为会员
if (userModel.RankId == && userModel.Ranketime >= DateTime.Now)
{
userModel.Ranketime = userModel.Ranketime.AddMonths((int)model.ChangeNum);
}
else
{
userModel.RankId = ;
userModel.Ranketime = DateTime.Now.AddMonths((int)model.ChangeNum);
userModel.Ranketime = DateTime.Now; } }
//更新用户信息
TwoTrans = new User().UpdateMemRoleByRMB(userModel);
}
else
{ userModel.Currency = userModel.Currency + model.ChangeNum;
TwoTrans = new User().UpdateCurrency(model.UserId, userModel.Currency);
}
}
if (OneTrans&&TwoTrans)
{ IsOk = true;
ts.Complete(); } }
}
}
if (IsOk)
{
//在这里写日志
if (model.OrderType == ) //购买会员
{
//在这里加一个消费日志
//需要拿这个有效时间去获得人民币的价格是多少
List<ProductBean> productList = new Product().GetAllList().Where(p => p.ValidTime == model.ChangeNum).ToList();
if (productList.Count > )
{
CreateBase64.CreateReclog(, "人民币购买会员", Convert.ToInt64(productList[].ProdutPrice), (int)model.UserId);
} }
else
{//购买虚拟币
CreateBase64.CreateReclog(, "充虚拟币", model.ChangeNum, (int)model.UserId);
}
return Request.CreateResponse(HttpStatusCode.OK, "接受成功");
} }
} } }
} catch (Exception ex)
{
logger.Error("接受ping++的支付订单消息发生异常:" + ex);
}
return Request.CreateResponse(HttpStatusCode.InternalServerError, "接受失败"); }
private static string ReadStream(Stream stream)
{
using (var reader = new StreamReader(stream, Encoding.UTF8))
{
return reader.ReadToEnd();
}
}
根据订单号获取支付状态
/// <summary>
/// 根据订单号获取支付状态
/// </summary>
/// <param name="order_no"></param>
/// <returns></returns>
[HttpGet]
public MessagesDataCode<bool> GetOrderStatus(string order_no)
{
MessagesDataCode<bool> result = new MessagesDataCode<bool>(false, "无效的参数", -);
try
{
PayLogBean model = new PayLog().GetModelById(order_no);
if (model != null)
{
result.Data = model.Valid;
result.Code = ;
result.Msg = "成功获取到订单状态";
result.Success = true;
}
}
catch (Exception ex)
{
logger.Error("获取订单状态发生异常:"+ex);
}
return result;
}
使用 ping++做支付的流程的更多相关文章
- 在Web应用中接入微信支付的流程之极简清晰版
在Web应用中接入微信支付的流程之极简清晰版 背景: 在Web应用中接入微信支付,我以为只是调用几个API稍作调试即可. 没想到微信的API和官方文档里隐坑无数,致我抱着怀疑人生的心情悲愤踩遍了丫们布 ...
- 在Web应用中接入微信支付的流程之极简清晰版 (转)
在Web应用中接入微信支付的流程之极简清晰版 背景: 在Web应用中接入微信支付,我以为只是调用几个API稍作调试即可. 没想到微信的API和官方文档里隐坑无数,致我抱着怀疑人生的心情悲愤踩遍了丫们布 ...
- 【SSH网上商城项目实战21】从Demo中看易宝支付的流程
转自: https://blog.csdn.net/eson_15/article/details/51447492 这一节我们先写一个简单点的Demo来测试易宝支付的流程,熟悉这个流程后, ...
- 干货 | 高耦合场景下,Trip.com如何做支付设计与落地
干货 | 高耦合场景下,Trip.com如何做支付设计与落地 https://mp.weixin.qq.com/s/VR9NTR3RpKVfmUPcwgMABg 原创 Ryann Liu 携程技术 2 ...
- java开发支付宝支付详细流程_demo的运行
首先我要吐槽一下支付宝的开放平台简直就是一个迷宫,赞同的顶一下,下面我把要下载的地址给贴出来要不真不好找: 一.准备工作 1.签名工具下载 https://docs.open.alipay.com/2 ...
- 微信APP支付整体流程记录备忘
支付整体流程见文档:https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=8_3 商户系统和微信支付系统主要交互说明: 步骤1: ...
- 微信支付-H5网页支付开通流程
简介 H5 支付是指商户在微信客户端外的移动端网页展示商品或服务,用户在前述页面确认使用微信支付时,商户发起本服务呼起微信客户端进行支付.主要用于触屏版的手机浏览器请求微信支付的场景.可以方便的从外 ...
- PHP支付宝支付开发流程
支付宝开发流程 1.首先我们先谈谈第三方支付 所谓第三方支付就是和一些各大银行签约,并具备一定实力和信誉保障的第三方独立机构提供的交易平台 目前市面上常见的有支付宝,财付通,网银,易宝支付等,网站 ...
- 微信支付开发+{ping++}微信支付托管
------------------------微信支付接口------------------------------- 微信支付开发并没有想象中的那么难,主要是微信提供了sdk. 微信公众号必须是 ...
随机推荐
- 用python写一个名片管理系统
info = [] #先定义一个空字典while True: #利用while循环 print(' 1.查看名片') #第一个选项 print(' 2.添加名片') #第二个选项 print(' 3. ...
- WPF-在Grid中编程添加控件
摘要: 在Grid中编程添加控件,布局控件的位置用到的代码是: gridLayout.Children.Add(textblock); Grid.SetRow(textblock, ); Grid.S ...
- (转)es6中object.create()和object.assign()
今天学习javascript面向对象,在学习Obejct方法时了解到create方法,偶像想起之前使用的assign方法,顺带查找一番,感觉这篇博客讲解详细,遂转载. 先简单提一下装饰器函数,许多面向 ...
- storm入门基础实例(无可靠性保证实例)
本实例为入门篇无可靠性保证实例,关于storm的介绍,以及一些术语名词等,可以参考Storm介绍(一).Storm介绍(二). 本案例是基于storm0.9.3版本 1.案例结构 案例:Word Co ...
- sort_gff.py
import sys infile = sys.argv[1]outfile = sys.argv[2] gff_list = []fh = open(infile)for x in fh: i ...
- Dart 创建List
list的常用的操作 1. [] ,length 获取元素,和数组长度 2. add(), insert ()添加元素 3. remove(),clear() 删除元素 4.indexOf (), ...
- 解题报告 『机器翻译(vector)』
原题地址 本想练习一下模拟,不过用vector貌似可以轻松水过?(虽然还是模拟) 但突然发现貌似我并不会判断单词是否在内存中出现过? 最后还是靠度娘解决了. 代码如下: #include <bi ...
- Redis事务和实现秒杀功能的实现
今天带着学生学习了Redis的事务功能,Redis的事务与传统的关系型数据库(如MySQL)有所不同,Redis的事务不能回滚. Redis中使用multi.exec.discard.watch.un ...
- 【软件构造】-<笔记>-浅谈java中类的初始化过程
编写java程序时,每创建一个新的对象,都会对对象的内容进行初始化. 每一个类的方法中的局部变量都有严格的初始化要求,因此假如写出下面的程序: void f(){ int i; i++; } 编译时就 ...
- jmeter简单的接口性能测试
原文转自:https://blog.csdn.net/lovesoo/article/details/78579547 Apache JMeter是一款纯java编写负载功能测试和性能测试开源工具软件 ...