WC_Gateway_Paypal_Request::authorize_or_capture_payment │ public │ WC 1.0

Устарела с версии 0.5.0. Больше не поддерживается и может быть удалена. Используйте Automattic\WooCommerce\Gateways\PayPal\Request::authorize_or_capture_payment().

This method authorizes or captures a PayPal payment and updates the order status.

Метод класса: WC_Gateway_Paypal_Request{}

Хуков нет.

Возвращает

void. Ничего (null).

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

$WC_Gateway_Paypal_Request = new WC_Gateway_Paypal_Request();
$WC_Gateway_Paypal_Request->authorize_or_capture_payment( $order, $action_url, $action );
$order(WC_Order) (обязательный)
Order object.
$action_url(строка|null) (обязательный)
The URL to authorize or capture the payment.
$action(строка)
The action to perform. Either 'authorize' or 'capture'.
По умолчанию: PayPalConstants::PAYMENT_ACTION_CAPTURE

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

Устарела с 10.5.0 Use Automattic\WooCommerce\Gateways\PayPal\Request::authorize_or_capture_payment() instead.

Код WC_Gateway_Paypal_Request::authorize_or_capture_payment() WC 11.2.2

public function authorize_or_capture_payment( $order, $action_url, $action = PayPalConstants::PAYMENT_ACTION_CAPTURE ) {
	wc_deprecated_function( __METHOD__, '10.5.0', 'Automattic\WooCommerce\Gateways\PayPal\Request::authorize_or_capture_payment()' );
	if ( ! $this->request ) {
		$this->request = new PayPalRequest( $this->gateway );
	}
	$this->request->authorize_or_capture_payment( $order, $action_url, $action );
}