forum
This commit is contained in:
Binary file not shown.
@@ -54,20 +54,28 @@ class ProductFeatureInline(TabularInline):
|
|||||||
|
|
||||||
@admin.register(WeChatPayConfig)
|
@admin.register(WeChatPayConfig)
|
||||||
class WeChatPayConfigAdmin(ModelAdmin):
|
class WeChatPayConfigAdmin(ModelAdmin):
|
||||||
list_display = ('app_id', 'mch_id', 'is_active', 'notify_url')
|
list_display = ('app_id', 'mch_id', 'is_active', 'notify_url', 'updated_at_display')
|
||||||
list_filter = ('is_active',)
|
list_filter = ('is_active',)
|
||||||
search_fields = ('app_id', 'mch_id')
|
search_fields = ('app_id', 'mch_id')
|
||||||
|
|
||||||
|
def updated_at_display(self, obj):
|
||||||
|
# 假设模型没有 updated_at,如果有可以显示,这里仅作占位或移除
|
||||||
|
return "N/A"
|
||||||
|
updated_at_display.short_description = "更新时间"
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('基本配置', {
|
('核心配置 (登录与支付)', {
|
||||||
'fields': ('app_id', 'mch_id', 'is_active')
|
'fields': ('app_id', 'app_secret', 'mch_id', 'is_active'),
|
||||||
|
'description': 'AppID 和 AppSecret 是小程序登录和支付的基础凭证。请确保 AppID 与小程序后台一致 (项目中优先使用 wxdf2ca73e6c0929f0)。'
|
||||||
}),
|
}),
|
||||||
('微信支付 V3 安全配置 (推荐)', {
|
('微信支付 V3 安全配置 (推荐)', {
|
||||||
'fields': ('apiv3_key', 'mch_cert_serial_no', 'mch_private_key'),
|
'fields': ('apiv3_key', 'mch_cert_serial_no', 'mch_private_key'),
|
||||||
'description': '使用 Native 支付必须配置这些项。私钥可以粘贴在这里,或者放在 backend/certs/apiclient_key.pem 文件中。'
|
'description': '使用 Native 支付必须配置这些项。私钥可以粘贴在这里,或者放在 backend/certs/apiclient_key.pem 文件中。'
|
||||||
}),
|
}),
|
||||||
('微信支付 V2 安全配置 (旧版)', {
|
('微信支付 V2 安全配置 (旧版)', {
|
||||||
'fields': ('api_key', 'app_secret'),
|
'fields': ('api_key',),
|
||||||
'classes': ('collapse',),
|
'classes': ('collapse',),
|
||||||
|
'description': '仅旧版支付接口需要 API Key (V2)。'
|
||||||
}),
|
}),
|
||||||
('回调配置', {
|
('回调配置', {
|
||||||
'fields': ('notify_url',)
|
'fields': ('notify_url',)
|
||||||
|
|||||||
Reference in New Issue
Block a user