Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Meta_Box_Order_Transactions::save_refund( int $post_id )

Save method, processes refunds


Description Description


Parameters Parameters

$post_id

(int) (Required) Post ID of the Order


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.order.transactions.php

	private function save_refund( $post_id ) {
		// can't proceed with a txn id
		if ( empty( $_POST['llms_refund_txn_id'] ) ) {
			return $this->add_error( __( 'Refund Error: Missing a transaction ID', 'lifterlms' ) );
		} elseif ( empty( $_POST['llms_refund_amount'] ) ) {
			return $this->add_error( __( 'Refund Error: Missing or invalid refund amount', 'lifterlms' ) );
		}

		$txn = new LLMS_Transaction( $_POST['llms_refund_txn_id'] );

		$refund = $txn->process_refund( $_POST['llms_refund_amount'], $_POST['llms_refund_note'], $_POST['llms_process_refund'] );

		if ( is_wp_error( $refund ) ) {
			$this->add_error( sprintf( _x( 'Refund Error: %s', 'admin error message', 'lifterlms' ), $refund->get_error_message() ) );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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