WC_Gateway_Paypal::can_refund_order
Can the order be refunded via PayPal?
Method of the class: WC_Gateway_Paypal{}
No Hooks.
Returns
true|false.
Usage
$WC_Gateway_Paypal = new WC_Gateway_Paypal(); $WC_Gateway_Paypal->can_refund_order( $order );
- $order(WC_Order) (required)
- Order object.
WC_Gateway_Paypal::can_refund_order() WC Gateway Paypal::can refund order code WC 10.4.3
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;
}