billing and paymetn methods

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-07 04:28:46 +00:00
parent 31c06d032c
commit 4e764e208d
11 changed files with 1010 additions and 349 deletions

View File

@@ -94,9 +94,10 @@ class CreditPackageAdmin(admin.ModelAdmin):
@admin.register(PaymentMethodConfig)
class PaymentMethodConfigAdmin(admin.ModelAdmin):
list_display = ['country_code', 'payment_method', 'is_enabled', 'display_name', 'sort_order']
list_display = ['country_code', 'payment_method', 'display_name', 'is_enabled', 'sort_order', 'updated_at']
list_filter = ['payment_method', 'is_enabled', 'country_code']
search_fields = ['country_code', 'display_name', 'payment_method']
list_editable = ['is_enabled', 'sort_order']
readonly_fields = ['created_at', 'updated_at']

View File

@@ -19,6 +19,21 @@ urlpatterns = [
path('billing/pending_payments/', BillingAdminViewSet.as_view({'get': 'pending_payments'}), name='admin-billing-pending-payments'),
path('billing/<int:pk>/approve_payment/', BillingAdminViewSet.as_view({'post': 'approve_payment'}), name='admin-billing-approve-payment'),
path('billing/<int:pk>/reject_payment/', BillingAdminViewSet.as_view({'post': 'reject_payment'}), name='admin-billing-reject-payment'),
path('billing/payment-method-configs/', BillingAdminViewSet.as_view({'get': 'payment_method_configs', 'post': 'payment_method_configs'}), name='admin-billing-payment-method-configs'),
path('billing/payment-method-configs/<int:pk>/', BillingAdminViewSet.as_view({
'get': 'payment_method_config',
'patch': 'payment_method_config',
'put': 'payment_method_config',
'delete': 'payment_method_config',
}), name='admin-billing-payment-method-config'),
path('billing/account-payment-methods/', BillingAdminViewSet.as_view({'get': 'account_payment_methods', 'post': 'account_payment_methods'}), name='admin-billing-account-payment-methods'),
path('billing/account-payment-methods/<int:pk>/', BillingAdminViewSet.as_view({
'get': 'account_payment_method',
'patch': 'account_payment_method',
'put': 'account_payment_method',
'delete': 'account_payment_method',
}), name='admin-billing-account-payment-method'),
path('billing/account-payment-methods/<int:pk>/set_default/', BillingAdminViewSet.as_view({'post': 'set_default_account_payment_method'}), name='admin-billing-account-payment-method-set-default'),
]
urlpatterns += router.urls