WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_API_Handler::do_capture() public WC 1.0

Capture an authorization.

{} It's a method of the class: WC_Gateway_Paypal_API_Handler{}

No Hooks.

Return

Object. Either an object of name value pairs for a success, or a WP_ERROR object.

Usage

$result = WC_Gateway_Paypal_API_Handler::do_capture( $order, $amount );
$order(WC_Order) (required)
Order object.
$amount(float)
Amount.
Default: null

Code of WC_Gateway_Paypal_API_Handler::do_capture() WC 5.6.0

public static function do_capture( $order, $amount = null ) {
	$raw_response = wp_safe_remote_post(
		self::$sandbox ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp',
		array(
			'method'      => 'POST',
			'body'        => self::get_capture_request( $order, $amount ),
			'timeout'     => 70,
			'user-agent'  => 'WooCommerce/' . WC()->version,
			'httpversion' => '1.1',
		)
	);

	WC_Gateway_Paypal::log( 'DoCapture Response: ' . wc_print_r( $raw_response, true ) );

	if ( is_wp_error( $raw_response ) ) {
		return $raw_response;
	} elseif ( empty( $raw_response['body'] ) ) {
		return new WP_Error( 'paypal-api', 'Empty Response' );
	}

	parse_str( $raw_response['body'], $response );

	return (object) $response;
}