woocommerce_webhook_hash_algorithm

woocommerce_webhook_hash_algorithm

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_webhook_hash_algorithm') is found 1 times:

  • /includes/class-wc-webhook.php line 453
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    * @param  string $payload Payload data to hash.
     * @return string
     */
    public function generate_signature( $payload ) {
        $hash_algo = apply_filters( 'woocommerce_webhook_hash_algorithm', 'sha256', $payload, $this->get_id() );
     
        // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
        return base64_encode( hash_hmac( $hash_algo, $payload, wp_specialchars_decode( $this->get_secret(), ENT_QUOTES ), true ) );
    }
     
    /**