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