In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "WeChat Mini Programs payment interface case analysis". The editor shows you the operation process through the actual case, and the operation method is simple, fast and practical. I hope this "WeChat Mini Programs payment interface case analysis" article can help you solve the problem.
Mini Program adjusts payment API Mini Program adjusts payment data signature field list: field name variable name required type sample value description Mini Program adjusts payment data signature field list:
Field name, variable name, required type value description Mini Program IDappId is the Mini Program ID timestamp assigned by Stringwxd678efh667hg6787 Wechat timeStamp is the number of seconds since the String1490840662 timestamp 00:00:00 on January 1, 1970, that is, the current time random string nonceStr is a String5K8264ILTKCH16CQ2502SI8ZNMTM67VS random string, no longer than 32 bits. Packet package is the prepay_id parameter value returned by Stringprepay_id=wx2017033010242291fcfe0db70013231072 unified order issuing API. Submission format such as: prepay_id=wx2017033010242291fcfe0db70013231072 signature method signType is StringMD5 signature type, default is MD5, and HMAC-SHA256 and MD5 are supported. Note that it needs to be consistent with the signature type of the unified order.
Examples are as follows:
PaySign = MD5 (appId=wxd678efh667hg6787&nonceStr=5K8264ILTKCH16CQ2502SI8ZNMTM67VS&package=prepay_id=wx2017033010242291fcfe0db70013231072&signType=MD5&timeStamp=1490840662&key=qazwsxedcrfvtgbyhnujmikolp111111) = 22D9B4E54AB1950F51E0649E8810ACD6
Call wx.requestPayment (OBJECT) to initiate WeChat Pay
Object parameter description:
The required parameter type indicates that timeStampString is the number of seconds in time stamp from 00:00:00 on January 1, 1970, that is, the current time nonceStrString is a random string with a length of less than 32 characters. PackageString is the prepay_id parameter value returned by the API for issuing orders. For example, the submission format: prepay_id=*signTypeString is the signature type, default is MD5, and HMAC-SHA256 and MD5 are supported. Note that it needs to be consistent with the signature type of the unified order. For more information on signature scheme, please see successFunction No API call successful callback function failFunction No API call failed callback function completeFunction No API call end callback function (both successful and failed calls will be executed)
Callback result:
Callback type errMsg indicates that successrequestPayment:ok call payment succeeded failrequestPayment:fail cancel user canceled payment failrequestPayment:fail (detail message) call failed, where detail message is the detailed reason for the failure returned by the backend
Sample code:
Wx.requestPayment (
{
'timeStamp':''
'nonceStr':''
'package':''
'signType': 'MD5'
'paySign':''
'success':function (res) {}
'fail':function (res) {}
'complete':function (res) {}
})
This is the end of the content of "case Analysis of WeChat Mini Programs payment Interface". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.