woocommerce_agentic_webhook_refund_type хук-фильтрWC 10.4.0

Filter the refund type for Agentic webhooks.

This allows extensions to specify when a refund is store credit. By default, all refunds are assumed to be original payment method.

Использование

add_filter( 'woocommerce_agentic_webhook_refund_type', 'wp_kama_woocommerce_agentic_webhook_refund_type_filter', 10, 2 );

/**
 * Function for `woocommerce_agentic_webhook_refund_type` filter-hook.
 * 
 * @param string          $refund_type The refund type ('store_credit' or 'original_payment').
 * @param WC_Order_Refund $refund      The refund object.
 *
 * @return string
 */
function wp_kama_woocommerce_agentic_webhook_refund_type_filter( $refund_type, $refund ){

	// filter...
	return $refund_type;
}
$refund_type(строка)
The refund type ('store_credit' or 'original_payment').
$refund(WC_Order_Refund)
The refund object.

Список изменений

С версии 10.4.0 Введена.

Где вызывается хук

AgenticWebhookPayloadBuilder::determine_refund_type()
woocommerce_agentic_webhook_refund_type
woocommerce/src/Internal/Admin/Agentic/AgenticWebhookPayloadBuilder.php 177
return apply_filters( 'woocommerce_agentic_webhook_refund_type', $refund_type, $refund );

Где используется хук в WooCommerce

Использование не найдено.