WC_Gateway_Paypal::can_refund_order( WC_Order $order )

Can the order be refunded via PayPal?


Description Description


Parameters Parameters

$order

(Required) Order object.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/gateways/paypal/class-wc-gateway-paypal.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.