ServerEnv().json_reponse does not exist, causing 'NoneType' object
is not callable. Align with alipay_notify pattern: use aiohttp Response
directly with JSON string body.
API v3 key is only needed for callback verification, not payment creation.
- Remove init-time validation (was blocking all wechat payments)
- Gracefully degrade: set api_v3_key=None if invalid, warn at startup
- Raise clear error at callback time if key still missing
AES-256-GCM requires 32-byte key. 'None' placeholder is only 4 bytes,
causing ValueError during callback decryption instead of at startup.
Now fails fast with clear error if key is missing/invalid.
- Change API endpoint from /v3/pay/transactions/h5 to /v3/pay/transactions/native
- Remove scene_info (not needed for native mode)
- Return code_url instead of h5_url
- recharge.dspy: display QR code image via api.qrserver.com
- user_recharge.dspy: return both code_url and qr_url
- Check HTTP status code, raise exception on non-200
- Raise exception if h5_url missing from response
- Fix description field to use .get() instead of direct key access
- Remove unreachable return None
Previously WeChat API errors (param errors, amount issues, etc.)
would return None, causing the frontend to show:
https://token.opencomputing.cn/null
Now errors are properly raised and shown to the user.
- Move env var reading and key file open() from import-time CONF dict
into _build_provider_conf() called during load_unipay()
- Each provider is wrapped in try/except — if env vars are missing,
key files don't exist, or instantiation fails, the provider is
set to None (disabled) and a warning is printed
- Program continues to start even if all payment channels fail
- Existing code already checks PROVIDERS[name] is None in all
business functions (create_payment, notify handlers, etc.)
- Existing get_provider() in notify.py already returns None on
instantiation error