WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_IPN_Handler::payment_status_refunded() protected WC 1.0

Handle a refunded order.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->payment_status_refunded( $order, $posted );
$order(WC_Order) (required)
Order object.
$posted(array) (required)
Posted data.

Code of WC_Gateway_Paypal_IPN_Handler::payment_status_refunded() WC 5.6.0

protected function payment_status_refunded( $order, $posted ) {
	// Only handle full refunds, not partial.
	if ( $order->get_total() === wc_format_decimal( $posted['mc_gross'] * -1, wc_get_price_decimals() ) ) {

		/* translators: %s: payment status. */
		$order->update_status( 'refunded', sprintf( __( 'Payment %s via IPN.', 'woocommerce' ), strtolower( $posted['payment_status'] ) ) );

		$this->send_ipn_email_notification(
			/* translators: %s: order link. */
			sprintf( __( 'Payment for order %s refunded', 'woocommerce' ), '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">' . $order->get_order_number() . '</a>' ),
			/* translators: %1$s: order ID, %2$s: reason code. */
			sprintf( __( 'Order #%1$s has been marked as refunded - PayPal reason code: %2$s', 'woocommerce' ), $order->get_order_number(), $posted['reason_code'] )
		);
	}
}