Skip to main content

Version Docs Updated

Purpose

This page describes the technical operation and data security rules of the PayoutCsvExporter component, which enables bulk export of financial Payout records.

πŸ“Š Payout CSV Exporter

PayoutCsvExporter is a utility class used by administrators to audit Payout history or retrieve bulk data for bank integrations. It streams data directly to the browser without loading it into memory, ensuring high performance.


πŸ› οΈ Technical Operation​

1. Access and Security​

The export operation runs through a standard WordPress admin_post hook:

  • Endpoint: /wp-admin/admin-post.php?action=mhm_export_payouts
  • Capability Check: Only users with manage_options (Administrator) capability can access this.
  • Nonce Verification: The validity of the request is verified via a WP Nonce keyed with mhm_export_payouts.

2. Data Format (Excel Compatibility)​

The system uses UTF-8 with BOM (Byte Order Mark) to ensure CSV files open correctly in Excel:

  • BOM: The \xEF\xBB\xBF character sequence is prepended to the file.
  • Delimiter: Standard comma (,) is used as the delimiter.

πŸ“‹ CSV Column Structure (Mapping)​

The columns in the exported file and their sources are as follows:

Column NameData SourceDescription
Payout IDPost IDSystem-assigned unique identifier.
Vendor NameWP_User Display NameFull name of the vendor being paid.
Amount_mhm_payout_amountPayout amount (Decimal format).
CurrencyWC CurrencyWooCommerce base currency.
CPT Statuspost_statusWordPress-side status (Pending, Approved, etc.).
Processor Status_mhm_payout_statusStatus code returned from the payment processor (n/a if pending).
Requested Atpost_date_gmtUTC timestamp of the request.

πŸ”’ Security Protocols​

PII (Personal Data) Masking​

Since CSV outputs are designed for financial auditing, sensitive vendor information (IBAN, Tax ID) is not included in this export by default. This data is only accessible through the encrypted meta layer within the Payout record.

Logging​

Every export operation is recorded in the mhm_rentiva_payout_audit table with an "export_triggered" action. Who downloaded data, and when, is traceable in the forensics system.


πŸ’‘ Developer Notes​

Use the following method on the PHP side to dynamically generate the export link:

// Get a secure (Nonce-protected) Export URL
$export_url = \MHMRentiva\Admin\PostTypes\Payouts\PayoutCsvExporter::get_export_url();

Section Summary​

  • PayoutCsvExporter uses the Streaming method for high data volumes.
  • The entire operation is protected by Nonce and Capability checks.
  • Outputs are in Excel-Ready (UTF-8 BOM) format.

Changelog​

DateVersionNote
23.04.20264.27.2English translation added.
19.03.20264.21.2Page updated to reflect streaming logic and Excel BOM structure in PayoutCsvExporter.