PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.4.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.4.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
← All changes | includes/Models/TransactionModel.php +14 -3 0.0.6 → 2.4.1 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2
3 3 namespace Better_Payment\Lite\Models;
4 4
5 -use Better_Payment\Lite\Admin\Better_Payment_DB;
5 +use Better_Payment\Lite\Admin\DB;
6 6 use Better_Payment\Lite\Model;
7 7
8 8 /**
9 9 * The Transaction handler database class
@@ -20,9 +20,20 @@
20 20 public function __construct( ) {
21 21 parent::__construct();
22 22 }
23 23
24 - public function get_transactions($per_page = '999999999') {
25 - $all_transactions = Better_Payment_DB::get_transactions(['per_page' => $per_page]);
24 + /**
25 + * Transactions for the CSV export.
26 + *
27 + * @param array $args DB::get_transactions() filters.
28 + * @param string $version 'v2' filters `status` by the admin list's tab buckets; 'v1' by raw status.
29 + * @return array
30 + */
31 + public function get_transactions($args = [], $version = 'v1') {
32 + // Set default per_page if not provided
33 + if (!isset($args['per_page'])) {
34 + $args['per_page'] = '999999999';
35 + }
36 + $all_transactions = DB::get_transactions($args, 0, $version);
26 37 return $all_transactions;
27 38 }
28 39 }