WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\Payments\Integrations

Stripe::add_payment_request_order_meta() public WC 1.0

Add payment request data to the order meta as hooked on the woocommerce_rest_checkout_process_payment_with_context action.

{} Это метод класса: Stripe{}

Хуков нет.

Возвращает

Null. Ничего.

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

$Stripe = new Stripe();
$Stripe->add_payment_request_order_meta( $context, $result );
$context(PaymentContext) (обязательный)
Holds context for the payment.
$result(PaymentResult) (обязательный)
Result object for the payment.

Код Stripe::add_payment_request_order_meta() WC 4.7.1

<?php
public function add_payment_request_order_meta( PaymentContext $context, PaymentResult &$result ) {
	$data = $context->payment_data;
	if ( ! empty( $data['payment_request_type'] ) && 'stripe' === $context->payment_method ) {
		// phpcs:ignore WordPress.Security.NonceVerification
		$post_data = $_POST;
		$_POST     = $context->payment_data;
		WC_Stripe_Payment_Request::add_order_meta( $context->order->id, $context->payment_data );
		$_POST = $post_data;
	}

	// hook into stripe error processing so that we can capture the error to
	// payment details (which is added to notices and thus not helpful for
	// this context).
	if ( 'stripe' === $context->payment_method ) {
		add_action(
			'wc_gateway_stripe_process_payment_error',
			function( $error ) use ( &$result ) {
				$payment_details                 = $result->payment_details;
				$payment_details['errorMessage'] = $error->getLocalizedMessage();
				$result->set_payment_details( $payment_details );
			}
		);
	}
}