woocommerce_rest_checkout_process_payment_with_context
Process payment with context.
Использование
add_action( 'woocommerce_rest_checkout_process_payment_with_context', 'wp_kama_woocommerce_rest_checkout_process_payment_with_context_action', 10, 2 ); /** * Function for `woocommerce_rest_checkout_process_payment_with_context` action-hook. * * @param PaymentContext $context Holds context for the payment, including order ID and payment method. * @param PaymentResult $payment_result Result object for the transaction. * * @return void */ function wp_kama_woocommerce_rest_checkout_process_payment_with_context_action( $context, $payment_result ){ // action... }
- $context(PaymentContext)
- Holds context for the payment, including order ID and payment method.
- $payment_result(PaymentResult)
- Result object for the transaction.
Где вызывается хук
woocommerce_rest_checkout_process_payment_with_context
woocommerce/src/StoreApi/Utilities/CheckoutTrait.php 83
do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ $context, &$payment_result ] );
Где используется хук в WooCommerce
woocommerce/src/StoreApi/Legacy.php 17
add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'process_legacy_payment' ), 999, 2 );