STripe Paymen and PK payemtns and many othe rbacekd and froentened issues

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-07 05:51:36 +00:00
parent 87d1662a18
commit 0386d4bf33
24 changed files with 1079 additions and 174 deletions

View File

@@ -578,8 +578,10 @@ class CreditPackage(models.Model):
class PaymentMethodConfig(models.Model):
"""
Configure payment methods availability per country
Allows enabling/disabling manual payments by region
Configure payment methods availability per country.
For online payments (stripe, paypal): Credentials stored in IntegrationProvider.
For manual payments (bank_transfer, local_wallet): Bank/wallet details stored here.
"""
# Use centralized choices
PAYMENT_METHOD_CHOICES = PAYMENT_METHOD_CHOICES
@@ -587,7 +589,7 @@ class PaymentMethodConfig(models.Model):
country_code = models.CharField(
max_length=2,
db_index=True,
help_text="ISO 2-letter country code (e.g., US, GB, IN)"
help_text="ISO 2-letter country code (e.g., US, GB, PK) or '*' for global"
)
payment_method = models.CharField(max_length=50, choices=PAYMENT_METHOD_CHOICES)
is_enabled = models.BooleanField(default=True)
@@ -596,21 +598,17 @@ class PaymentMethodConfig(models.Model):
display_name = models.CharField(max_length=100, blank=True)
instructions = models.TextField(blank=True, help_text="Payment instructions for users")
# Manual payment details (for bank_transfer/local_wallet)
# Manual payment details (for bank_transfer only)
bank_name = models.CharField(max_length=255, blank=True)
account_number = models.CharField(max_length=255, blank=True)
routing_number = models.CharField(max_length=255, blank=True)
swift_code = models.CharField(max_length=255, blank=True)
account_title = models.CharField(max_length=255, blank=True, help_text="Account holder name")
routing_number = models.CharField(max_length=255, blank=True, help_text="Routing/Sort code")
swift_code = models.CharField(max_length=255, blank=True, help_text="SWIFT/BIC code for international")
iban = models.CharField(max_length=255, blank=True, help_text="IBAN for international transfers")
# Additional fields for local wallets
wallet_type = models.CharField(max_length=100, blank=True, help_text="E.g., PayTM, PhonePe, etc.")
wallet_id = models.CharField(max_length=255, blank=True)
# Webhook configuration (Stripe/PayPal)
webhook_url = models.URLField(blank=True, help_text="Webhook URL for payment gateway callbacks")
webhook_secret = models.CharField(max_length=255, blank=True, help_text="Webhook secret for signature verification")
api_key = models.CharField(max_length=255, blank=True, help_text="API key for payment gateway integration")
api_secret = models.CharField(max_length=255, blank=True, help_text="API secret for payment gateway integration")
wallet_type = models.CharField(max_length=100, blank=True, help_text="E.g., JazzCash, EasyPaisa, etc.")
wallet_id = models.CharField(max_length=255, blank=True, help_text="Mobile number or wallet ID")
# Order/priority
sort_order = models.IntegerField(default=0)