WeChat public platform WeChatPHPSDK

Source: Internet
Author: User
Tags openid
Address: github. comdodgepuddingwechat-php-sdk public platform php Development Kit, detailed interface operations, support chain call payment access documentation: mp. weixin. qq. comcgi-binreadtemplate? Tbusinesscourse2_tmpllangzh_CNwechat.class.php calls the official API

Address: https://github.com/dodgepudding/wechat-php-sdk public platform php Development Kit, refined interface operations, support chain call payment access documentation: https://mp.weixin.qq.com/cgi-bin/readtemplate? T = business/course2_tmpllang = zh_CN wechat. class. php calls the official API and has

Address: https://github.com/dodgepudding/wechat-php-sdk

Public platform php Development Kit, refined interface operations, support chain call

Payment access document: https://mp.weixin.qq.com/cgi-bin/readtemplate? T = business/course2_tmpl & lang = zh_CN

  1. Wechat. class. php
    Call the official API to provide more flexible message classification response methods and support chain call operations;
Main functions
  • Access verification (primary permission)
  • Automatic reply (text, image, voice, video, music, text) (initial permission)
  • Menu operations (query, create, and delete) (menu permissions)
  • Customer Service Message (text, image, voice, video, music, text) (authentication permission)
  • QR code (create a temporary or permanent QR code and obtain the URL of the QR code) (authentication permission)
  • Group operations (query, create, modify, and move users to groups) (authentication permission)
  • Webpage authorization (Basic authorization, user information authorization) (authentication permission)
  • User Information (query basic user information and obtain the list of users) (authentication permission)
  • Media files (upload and obtain) (authentication permission)
  • Call the address component (Payment permission)
  • Generate order signature data (Payment permission)
  • Successful order callback (Payment permission)
  • Delivery Notification (Payment permission)
  • Payment Order query (Payment permission)
Initialization action

$ Options = array ('Token' => 'tokenaccesskey', // enter your set key 'appid '=> 'wxdk1234567890', // enter the app id of the Advanced Call function, please query 'appsecret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' in the Development Mode background, // enter the partnerid => '000000' key for Advanced Call functions, // the ID of the tenpay merchant, dedicated for payment permissions. Do not enter the 'ererkey' => '', // The accesskey of the fortune service merchant, and the accesskey of the payment permission 'paysignkey' =>''. // The accesskey of the merchant signature, special payment permission); $ weObj = new Wechat ($ options); // create an instance object // TODO: Call the methods of each $ weObj instance

Add the Auth advanced permission class method:

    • CheckAuth ($ appid, $ appsecret) is input here to the appid and appsecret provided by the Advanced Public background interface. The function will return the access_token operation token.
    • CreateMenu ($ data) Create menu $ data menu structure for details, see http://mp.weixin.qq.com/wiki/index.php? Title = % E8 % 87% AA % E5 % AE % 9A % E4 % B9 % 89% E8 % 8F % 9C % E5 % 8D % 95% E5 % 88% 9B % E5 % BB % BA % E6 % 8E % A5 % E5 % 8F % A3
    • GetMenu ()
    • DeleteMenu () delete menu
    • GetMedia () obtains the received audio and video media files.
    • GetQRCode ($ scene_id, $ type = 0, $ expire = 1800)
    • GetQRUrl ($ ticket)
    • GetUserList ($ next_openid)
    • GetUserInfo ($ openid) obtains the detailed information of the publisher.
    • GetGroup ()
    • CreateGroup ($ name) adds a custom Group
    • UpdateGroup ($ groupid, $ name) changes the group name
    • UpdateGroupMembers ($ groupid, $ openid) Mobile User Group
    • SendCustomMessage ($ data) sends customer service messages
    • GetOauthRedirect ($ callback, $ state, $ scope) Get the webpage authorization oAuth jump address
    • GetOauthAccessToken () obtains the webpage authorization access_token through the callback code
    • GetOauthRefreshToken ($ refresh_token) is renewed through refresh_token on access_token
    • GetOauthUserinfo ($ access_token, $ openid) obtains user information through the access_token authorized by the webpage
    • GetSignature ($ arrdata, 'sha1') generates a signature string
    • GenerateNonceStr ($ length) to obtain a random string
    • CreatePackage ($ out_trade_no, $ body, $ total_fee, $ category_url, $ spbill_create_ip, $ fee_type = 1, $ bank_type = "WX", $ input_charset = "UTF-8 ", $ time_start = "", $ time_expire = "", $ transport_identifier = "", $ product_identifier = "", $ goods_tag = "", $ attach = ") generate the order package string
    • GetPaySign ($ package, $ timeStamp, $ nonceStr) Payment signature (paySign) Generation Method
    • CheckOrderSignature ($ orderxml = '') callback notification Signature Verification
    • SendPayDeliverNotify ($ openid, $ transid, $ out_trade_no, $ status = 1, $ msg = 'OK') Delivery Notification
    • GetPayOrder ($ out_trade_no) query order information
    • GetAddrSign ($ url, $ timeStamp, $ nonceStr, $ user_token = '') obtains the signature of the Receiving address JS.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.