woocommerce_agentic_webhook_refund_type
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.
Usage
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(string)
- The refund type ('store_credit' or 'original_payment').
- $refund(WC_Order_Refund)
- The refund object.
Changelog
| Since 10.4.0 | Introduced. |
Where the hook is called
woocommerce_agentic_webhook_refund_type
woocommerce/src/Internal/Admin/Agentic/AgenticWebhookPayloadBuilder.php 177
return apply_filters( 'woocommerce_agentic_webhook_refund_type', $refund_type, $refund );