WC_Gateway_Paypal::can_refund_order()publicWC 1.0

Can the order be refunded via PayPal?

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

Хуков нет.

Возвращает

true|false.

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

$WC_Gateway_Paypal = new WC_Gateway_Paypal();
$WC_Gateway_Paypal->can_refund_order( $order );
$order(WC_Order) (обязательный)
Order object.

Код WC_Gateway_Paypal::can_refund_order() WC 8.7.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;
}