feat: Allow HTML in payment gateway descriptions

Enabled HTML rendering in payment gateway descriptions.

Changes:
- Manual payment methods: gateway.description now renders HTML
- Online payment methods: gateway.method_description now renders HTML
- Used dangerouslySetInnerHTML for both description fields

Result:
 Links in descriptions are now clickable
 Formatted text (bold, italic) displays correctly
 HTML entities render properly
 Maintains security (WooCommerce sanitizes on backend)

Note: GenericGatewayForm already had HTML support for field descriptions
This commit is contained in:
dwindown
2025-11-08 21:10:10 +07:00
parent db8378a01f
commit ab887f8f11

View File

@@ -311,9 +311,10 @@ export default function PaymentsPage() {
<div> <div>
<h3 className="font-medium">{gateway.method_title || gateway.title}</h3> <h3 className="font-medium">{gateway.method_title || gateway.title}</h3>
{gateway.description && ( {gateway.description && (
<p className="text-sm text-muted-foreground mt-1"> <p
{gateway.description} className="text-sm text-muted-foreground mt-1"
</p> dangerouslySetInnerHTML={{ __html: gateway.description }}
/>
)} )}
</div> </div>
</div> </div>
@@ -369,9 +370,10 @@ export default function PaymentsPage() {
</h3> </h3>
</div> </div>
{gateway.method_description && ( {gateway.method_description && (
<p className="text-sm text-muted-foreground mb-2"> <p
{gateway.method_description} className="text-sm text-muted-foreground mb-2"
</p> dangerouslySetInnerHTML={{ __html: gateway.method_description }}
/>
)} )}
{!gateway.requirements.met && ( {!gateway.requirements.met && (
<Alert variant="destructive" className="mt-2"> <Alert variant="destructive" className="mt-2">