WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal::can_refund_order() public WC 1.0

Can the order be refunded via PayPal?

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

No Hooks.

Return

true|false.

Usage

$WC_Gateway_Paypal = new WC_Gateway_Paypal();
$WC_Gateway_Paypal->can_refund_order( $order );
$order(WC_Order) (required)
Order object.

Code of WC_Gateway_Paypal::can_refund_order() WC 5.6.0

public function can_refund_order( $order ) {
	$has_api_creds = false;

	if ( $this->testmode ) {
		$has_api_creds = $this->get_option( 'sandbox_api_username' ) && $this->get_option( 'sandbox_api_password' ) && $this->get_option( 'sandbox_api_signature' );
	} else {
		$has_api_creds = $this->get_option( 'api_username' ) && $this->get_option( 'api_password' ) && $this->get_option( 'api_signature' );
	}

	return $order && $order->get_transaction_id() && $has_api_creds;
}