Download the PHP package tourze/alipay-mini-program-bundle without Composer
On this page you can find all versions of the php package tourze/alipay-mini-program-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/alipay-mini-program-bundle
More information about tourze/alipay-mini-program-bundle
Files in tourze/alipay-mini-program-bundle
Package alipay-mini-program-bundle
Short Description 支付宝小程序集成模块,提供用户认证、模板消息等功能
License MIT
Informations about the package alipay-mini-program-bundle
AlipayMiniProgramBundle
中文
A comprehensive Symfony bundle for integrating Alipay Mini Program functionality, providing user authentication, form ID management, template message sending, and more.
Table of Contents
- Features
- Installation
- Configuration
- Database Setup
- Mini Program Configuration
- Quick Start
- Basic Configuration
- User Service Usage
- Form ID Management
- Template Message Service
- Console Commands
- Clean Expired Form IDs
- Send Pending Template Messages
- JSON-RPC Procedures
- Entities
- Admin Interface
- Advanced Usage
- Custom Event Listeners
- Background Processing
- Extending Services
- Events
- Security
- Key Management
- Data Protection
- Security Best Practices
- Vulnerability Reporting
- Requirements
- Testing
- Contributing
- Changelog
- License
Features
- User Management: Handle Alipay user authentication and information management
- Form ID Collection: Collect and manage form IDs for template message sending
- Template Messages: Send template messages with automatic queue processing
- Phone Number Management: Decrypt and manage user phone numbers
- Multi-App Support: Manage multiple Alipay mini programs in one application
- Admin Interface: EasyAdmin integration for managing users, messages, and configurations
- Background Processing: Symfony Messenger integration for asynchronous operations
- Automatic Cleanup: Commands for cleaning expired form IDs and sending pending messages
Installation
Configuration
Database Setup
Run the database migrations to create the necessary tables:
Mini Program Configuration
Configure your Alipay Mini Program settings in the admin interface or programmatically:
Quick Start
Basic Configuration
Register the bundle in your config/bundles.php:
User Service Usage
Form ID Management
Template Message Service
Console Commands
Clean Expired Form IDs
Command: alipay:mini-program:clean-expired-form-ids
Remove expired form IDs from the database:
Send Pending Template Messages
Command: alipay:template-message:send-pending
Process and send queued template messages:
Options:
--limit,-l: Number of messages to process per run (default: 10)
JSON-RPC Procedures
The bundle provides the following JSON-RPC procedures:
SaveAlipayMiniProgramFormId: Save form IDs from mini programUploadAlipayMiniProgramAuthCode: Upload authorization codesUploadAlipayMiniProgramPhoneNumber: Upload encrypted phone numbers
Entities
- User: Alipay user information including nickname, avatar, location
- MiniProgram: Mini program configuration with app ID and keys
- FormId: Form IDs for template message sending
- TemplateMessage: Template messages with status tracking
- Phone: Decrypted phone numbers
- AuthCode: Authorization codes from mini program
- AlipayUserPhone: User-phone relationships
Admin Interface
The bundle integrates with EasyAdmin and provides the following admin controllers:
UserCrudController: Manage Alipay usersMiniProgramCrudController: Configure mini programsTemplateMessageCrudController: View and manage template messagesFormIdCrudController: Monitor form ID collectionPhoneCrudController: Manage phone numbersAuthCodeCrudController: View authorization codesAlipayUserPhoneCrudController: Manage user-phone relationships
Advanced Usage
Custom Event Listeners
Create custom event listeners to handle template message processing:
Background Processing
Configure Symfony Messenger for asynchronous processing:
Extending Services
Extend the bundle services for custom functionality:
Events
The bundle dispatches events during template message processing:
- Before sending: Allows modification of message data
- After sending: For logging and post-processing
Security
Key Management
- Private Keys: Store your private keys securely using environment variables or secure key management systems
- Public Keys: Ensure Alipay public keys are properly configured for signature verification
- Encryption: Use the encrypt key for sensitive data decryption when provided by Alipay
Data Protection
- User Data: User information is encrypted and stored securely
- Form IDs: Form IDs are automatically cleaned up after expiration to prevent accumulation
- Logging: All external API calls are logged for audit purposes
Security Best Practices
Vulnerability Reporting
If you discover a security vulnerability, please send an email to [email protected]. All security vulnerabilities will be promptly addressed.
Requirements
- PHP 8.1 or higher
- Symfony 7.3 or higher
- Doctrine ORM 3.0 or higher
- OpenSSL extension
- EasyAdmin Bundle 4.0 or higher
Testing
Run the test suite:
Run static analysis:
Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes and add tests
- Run tests:
vendor/bin/phpunit - Run static analysis:
vendor/bin/phpstan analyse - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
Changelog
Please see CHANGELOG.md for details on version history.
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of alipay-mini-program-bundle with dependencies
ext-date Version *
ext-json Version *
ext-openssl Version *
ext-pcre Version *
alipaysdk/openapi Version ^3.0
doctrine/collections Version ^2.3
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
guzzlehttp/guzzle Version ^7.9.2
knplabs/knp-menu Version ^3.7
monolog/monolog Version ^3.1
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/config Version ^7.3
symfony/console Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/form Version ^7.3
symfony/http-client Version ^7.3
symfony/http-foundation Version ^7.4
symfony/http-kernel Version ^7.3
symfony/messenger Version ^7.3
symfony/property-access Version ^7.3
symfony/security-bundle Version ^7.3
symfony/security-core Version ^7.3
symfony/security-http Version ^7.3
tourze/access-token-bundle Version 1.1.*
tourze/bundle-dependency Version 1.*
tourze/doctrine-indexed-bundle Version 1.0.*
tourze/doctrine-ip-bundle Version 1.1.*
tourze/doctrine-random-bundle Version 1.0.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-user-bundle Version 1.0.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/enum-extra Version 1.0.*
tourze/json-rpc-core Version 2.0.*
tourze/json-rpc-lock-bundle Version 2.0.*
tourze/json-rpc-log-bundle Version 2.0.*
tourze/json-rpc-security-bundle Version 2.0.*
tourze/symfony-cron-job-bundle Version 1.1.*
tourze/symfony-dependency-service-loader Version 1.0.*