Automattic\WooCommerce\Gateways\PayPal

Request::get_paypal_order_intentprivateWC 1.0

Get the value for the intent field in the create-order request.

Method of the class: Request{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_paypal_order_intent(): string;

Request::get_paypal_order_intent() code WC 10.7.0

private function get_paypal_order_intent(): string {
	$payment_action = $this->gateway->get_option( 'paymentaction' );
	if ( 'authorization' === $payment_action ) {
		return PayPalConstants::INTENT_AUTHORIZE;
	}

	return PayPalConstants::INTENT_CAPTURE;
}