/**
* Sanitize payment fields
* - some gateways include js in their payment fields
*
* @param WC_Payment_Gateway $gateway
* @return mixed|string
*/
protected function sanitize_payment_fields(WC_Payment_Gateway $gateway)
{
$html = '';
if ($gateway->has_fields() || $gateway->get_description()) {
ob_start();
$gateway->payment_fields();
$html = ob_get_contents();
ob_end_clean();
// remove script tags
$html = $this->removeDomNodes($html, '//script');
}
return self::trim_html_string($html);
}