Fix digital product detection in crypto payment status views
- Replace non-existent download_instructions attribute with proper is_physical check - Assume digital by default and only mark as non-digital if any product is physical - Fixes AttributeError during crypto payment finalization for both XMR and DOGE
This commit is contained in:
parent
7885ed5d76
commit
62e098a131
1 changed files with 6 additions and 6 deletions
|
|
@ -760,11 +760,11 @@ def crypto_xmr_status(request):
|
|||
)
|
||||
elif current_status == "confirmed":
|
||||
# Check if it's a digital product by looking at line items
|
||||
has_digital = False
|
||||
has_digital = True
|
||||
if crypto_payment.invoice:
|
||||
for line_item in crypto_payment.invoice.line_items:
|
||||
if line_item.product and line_item.product.download_instructions:
|
||||
has_digital = True
|
||||
if line_item.product and line_item.product.is_physical:
|
||||
has_digital = False
|
||||
break
|
||||
|
||||
if has_digital:
|
||||
|
|
@ -856,11 +856,11 @@ def crypto_doge_status(request):
|
|||
)
|
||||
elif current_status == "confirmed":
|
||||
# Check if it's a digital product by looking at line items
|
||||
has_digital = False
|
||||
has_digital = True
|
||||
if crypto_payment.invoice:
|
||||
for line_item in crypto_payment.invoice.line_items:
|
||||
if line_item.product and line_item.product.download_instructions:
|
||||
has_digital = True
|
||||
if line_item.product and line_item.product.is_physical:
|
||||
has_digital = False
|
||||
break
|
||||
|
||||
if has_digital:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue