This article mainly introduces the summary of errors in the development of the mini-program payment function. For more information, see
Summary of the development error of the mini-program payment function
The small program payment has finally completed the pitfall, and found that the pitfall is quite big. now I am posting a post, hoping that students who will enter the pitfall will have a look:
Https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php? Chapter = 7_4 index = 2
You can see the bu
token validity period, per second
public $expiresIn = null;
State
public $state = null;
public $openid = null;
Construct
Public function __construct ($config =[])
{
foreach ($config as $key = = $value) {
$this $key = $value;
}
}
/**
* Get URL to get code
* @throws \invalidargumentexception
* @return String
*/
Public Function Codeurl ()
{
pageThe third step, the callback page processing1, JS SDK callback Address page, insert the following sample code on the callback address pageAs in the second step, put this code in the 2, is to call the corresponding method of the JS SDK, to obtain the information you want to know, generally speaking, we want to get information, at most is the user nickname and User login success, QQ to US return user unique identification. All we have to do is get these two values, and everything will be all
According to the WeChat advanced red envelope interface, the PHP version of the API is developed and the main code analysis is now carried out.The red envelope interface calls the request code. All request parameters are mandatory and correspond to the document:Class Wxapi {Private $ app_id = 'wxxxxxxxxxxxxxxxx'; // public account appid. First, apply for a public accountPrivate $ app_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'; // secret of the public account. The user obtains the toke
Copy codeThe Code is as follows:Function ResumeError (){Return true;}Window. onerror = ResumeError;Function showdd (obj ){Var dds = document. getElementById (obj). getElementsByTagName ("dd ");Var len = dds. length;If (dds [0]. style. display = "none "){// This operation is an expanded menu. You need to determine whether this option exists in the cookie.// 1. Yes, delete// 2. None. do not perform the operationChangeshowmenu (obj );For (var I = 0; I Dds [I]. style. display = "";}} Else {// This o
PHP version QQ interconnection OAuth sample code sharing, oauth sample code
Due to the universality of QQ users in China, all major websites now provide QQ login ports as much as possible. Let's take a look at the php version for your reference.
/*** QQ Internet oauth * @ author dyllen **/class Oauth {// obtain Authorization Code Url const PC_CODE_URL = 'https: // obtain the Access Token Url const PC_ACCESS_TOKEN_URL = 'https: // graph.qq.com/oauth2.0/token'; // obtain the user's Open Id Url con
promise to write $ userLists
Then, if it is correct, you can get the access_token. Because of the timeliness of the access_token, you can replace the access_token with the refresh_token. Because I don't think it is necessary, I didn't write that step.
If there is something wrong with the exchange, it will show{"errcode":40029,"errmsg":"invalid code"}
3) Use openid and access_token to obtain the user's profile nickname and other basic information.
C
The previous article has acquired the user's OpenID
This article is mainly to invoke the micro-credit public payment of the unified next single API
API Address: Https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
Looking at the document, the main process is to encapsulate 20 or so parameters into an XML format sent to the address of the micro-letter to the interface, and then you can get back to the content, if the success of the payment i
link,After obtaining the code, the backend simulates the request. Get user information.
Micro-letter three-time handshake Method (code)
public class Weixinoauth{Get the micro-credit codepublic string Getweixincode (string appid,string appsecret,string RedirectURL){Random r = new Random ();Micro-Letter Login AuthorizationString url = "Https://open.weixin.qq.com/connect/qrconnect?appid=" + AppID + "redirect_uri=" + RedirectURL + " response_type=codescope=snsapi_loginstate=state#wechat_redirect
data, to obtain the micro-letter sent over the XML packet. Here is the XML packet data sent by a new user following the public number message to your backend interface (/yourapi mentioned in the previous article), and after parsing, his structure is as follows:
Tousername: The addressee "here is the public micro-signal."
Fromusername: Sender "Here is the user OpenID"
Createtime: Send Time
Msgtype: Message type Event (response event), text (push
Public platform payment development details, public platform details
Public account payment is a function that calls up payment on the H5 page. You do not need to scan the QR code to make the payment. The first thing to do with this function is to make it clear that only the appid that matches the merchant's mch_id can be successfully paid. When the merchant ID is successfully registered, it will send the relevant information to the mailbox. The key to arousing payment is that
number. The Merchant adjusts the number according to the user and ensures that the unique sp_billno = string. format ("{0} {1} {2}", TenPayV3Info. mchId, DateTime. now. toString ("yyyyMMdd"), TenPayV3Util. buildRandomStr (10);} else {sp_billno = Request ["order_no"];} var timeStamp = TenPayV3Util. getTimestamp (); Var nonceStr = TenPayV3Util. GetNoncestr (); var body = product = null? "Test": product. Name; var price = product = null? 100: product. price * 100; var xmlDataInfo = new tenpayv3uni
Mobile Payment error Summary (jsapi), payment for jsapi
There are many demos for pc.
When you make a payment on the Mobile End, you must first configure the domain name that can be tested and the authorized domain name, one configured in the payment on the public platform.
Note: The method for obtaining the open Id must be written to the configured domain name. Otherwise, the domain name is not authorized.
There is also an authorized domain name configured in the payment, and there is a Web page
Several PHP class libraries with powerful performance are recommended. This article provides 20 very useful PHP class libraries. These 20 PHP class libraries contain the Icon Library, RSS Resolution, thumbnail generation, payment, OpenID, and powerful data functions.
This article provides 20 useful PHP class libraries. These 20 PHP class libraries include the Icon Library, RSS Resolution, thumbnail generation, payment,
/WxPayPubHelper/cacert/apiclient_cert.pem ','Sslkey _ path' => WEB_HOST. '/ThinkPHP/Library/Vendor/WxPayPubHelper/cacert/apiclient_key.pem ','Your Y _ url' => WEB_HOST. '/index. php/Home/WxJsAPI/Your y ','Curl _ timeout' => 30));Step 3: place the js Code that generates the QR code in the Public directory (this js is not used here, and it is used only when the QR code is used for payment) and put the log file in the Public directory: like me:
Step 4: Create a controller: here we have created a W
This article mainly introduces how to call the unified order API of public payment. you can obtain the returned content by encapsulating parameters in xml format and sending them to the interface address, you can refer to the previous article to obtain the user's OpenId.
This article mainly calls the unified order API of public payment
API address: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php? Chapter = 9_1
The main process is to encapsulate abou
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.