PHPackages                             tourze/wechat-official-account-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tourze/wechat-official-account-bundle

ActiveSymfony-bundle[API Development](/categories/api)

tourze/wechat-official-account-bundle
=====================================

微信公众号基础能力支持，提供账号管理、消息处理等核心功能

0.1.4(6mo ago)01.8k8MITPHPCI passing

Since Apr 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/wechat-official-account-bundle)[ Packagist](https://packagist.org/packages/tourze/wechat-official-account-bundle)[ RSS](/packages/tourze-wechat-official-account-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (43)Versions (8)Used By (8)

WeChat Official Account Bundle
==============================

[](#wechat-official-account-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![PHP Version](https://camo.githubusercontent.com/407cae97f462622b426bac8a038a78696841ce2f26cf8caaf5059c90b8f729b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e7376673f7374796c653d666c61742d737175617265)](https://www.php.net/)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/1e0bffae0a8db48f57c473d0bbd4d9ea3316e372276ee2ec61f3ed81e3944788/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f7765636861742d6f6666696369616c2d6163636f756e742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-official-account-bundle)[![Build Status](https://camo.githubusercontent.com/5267932f507fddc0a5be85d622432194cf1a82bc166c2a375fb89c077043f7ad/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f75727a652f7765636861742d6f6666696369616c2d6163636f756e742d62756e646c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/tourze/wechat-official-account-bundle)[![Quality Score](https://camo.githubusercontent.com/e981d13990b624d0c4a937369342a1e9ea063aadb45855c4990d552bea6374e4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f75727a652f7765636861742d6f6666696369616c2d6163636f756e742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tourze/wechat-official-account-bundle)[![Code Coverage](https://camo.githubusercontent.com/17f0dbfede77a4a9cbd37ddff2d9d20ec440f593d23c2cca55773db1844f7e97/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f7765636861742d6f6666696369616c2d6163636f756e742d62756e646c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/wechat-official-account-bundle)[![Total Downloads](https://camo.githubusercontent.com/7c3cfc7e747a9357fdc39a53272246317ce11cad68296ad6e32fb87b6df3a12d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f7765636861742d6f6666696369616c2d6163636f756e742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-official-account-bundle)

A comprehensive Symfony bundle for WeChat Official Account API integration. This bundle provides essential functionalities for managing WeChat Official Account operations including access token management, account configuration, and API requests with automatic token refresh and comprehensive error handling.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Advanced Usage](#advanced-usage)
- [API Reference](#api-reference)
- [Testing](#testing)
- [Contributing](#contributing)
- [Security](#security)
- [License](#license)

Features
--------

[](#features)

- **Account Management**: Store and manage multiple WeChat Official Account configurations
- **Access Token Handling**: Automatic access token refresh and caching with expiration management
- **API Client**: Pre-configured HTTP client for WeChat Official Account API requests
- **Callback IP Management**: Manage and validate callback IP addresses
- **Doctrine Integration**: Full ORM support with repositories and entities
- **Symfony Bundle**: Native Symfony integration with dependency injection
- **Error Handling**: Comprehensive error handling and retry mechanisms

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM 3.0 or higher

Installation
------------

[](#installation)

```
composer require tourze/wechat-official-account-bundle
```

Quick Start
-----------

[](#quick-start)

### 1. Bundle Registration

[](#1-bundle-registration)

The bundle should be automatically registered. If not, add it to your `bundles.php`:

```
