WeChat open platform public account third platform class library
wx_component 2.0 WeChat public account third platform class library, PHP version.
wx_component 2.0 is a PHP class library developed based on the documents provided by the WeChat official open platform. Third-party platforms use this type of library to make it easier and more convenient to deploy code and implement business on behalf of public accounts. wx_component 2.0 adds support for WeChat payment on behalf of public accounts
download
You can clone this repository and download it yourself.
Implement function
- Implement official account authorization and binding
- Implement business on behalf of public accounts
- Use JS SDK on behalf of the official account
- Third-party platform event notification processing
- Realize the automated test code for public account publishing and access detection across the entire network
- Implement support for WeChat payment on behalf of public accounts, including:
- WeChat payment was scanned
- WeChat scan code payment
- WeChat JSAPI payment
- WeChat address book
- WeChat order inquiry
- WeChat order refund
- WeChat order refund inquiry
- WeChat statement download
- Added WeChat open platform website application WeChat code scanning login support
- Add the overall implementation of the WeChat open platform official JS SDK DEMO
- Add support for composer
Simple instructions for use
- Assume that the root directory of the configured website is /data/wx_component/
- The website directory structure is /data/wx_component/example/ and /data/wx_component/src/
- Assume that the website domain name is www.xxx.com
- Configure public account third-party platform parameters
- Authorization event receiving URL: http://www.xxx.com/example/component_event.php
- Official account message and event receiving URL: http://www.xxx.com/example/appevent/$APPID$
- Configure other parameters as needed
- Configure the configured third-party platform parameters in /example/config.php
- After the configuration is completed, wait for the component_verify_ticket message (once every 10 minutes) to arrive, and then perform network-wide release access detection.
- If unsuccessful, check the following items
- Check if the /example/ directory is writable
- Check the log files in the /example/cache/ directory to see the reason
- Check whether the apache rewrite module is enabled and whether it supports .htaccess
- After the release is successful, use a browser to open the example PHP sample and check the authorization and js_sdk functions.
Composer installation instructions
- composer require lv_fan2008/wx_component
- Composer Chinese documentation reference http://docs.phpcomposer.com/
my test environment
- Alibaba Cloud host is used
- The operating system is Debian 8.0 64Bits
- Apache/2.4.10 (Debian) PHP 5.6.27
- The php extension module has curl openssl
Suggestions and questions
If you have any good suggestions or questions, please feel free to submit an issue or pull request to me, or send an email to [email protected]. You can also join the QQ group 519270384 for discussion.
LICENSE
MIT, enjoy open source code.