$63 GRAYBYTE WORDPRESS FILE MANAGER $60

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/itiministry.org/plugins/give/src/API/Endpoints/Reports/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/API/Endpoints/Reports//RecentDonations.php
<?php

/**
 * Recent Donations endpoint
 *
 * @package Give
 */

namespace Give\API\Endpoints\Reports;

class RecentDonations extends Endpoint
{

    public function __construct()
    {
        $this->endpoint = 'recent-donations';
    }

    public function getReport($request)
    {
        $paymentObjects = $this->getPayments($request->get_param('start'), $request->get_param('end'), 'date', 50);

        // Populate $list with arrays in correct shape for frontend RESTList component
        $data = [];
        foreach ($paymentObjects as $paymentObject) {
            $amount = give_currency_symbol($paymentObject->currency, true) . give_format_amount($paymentObject->total,
                                                                                                ['sanitize' => false]);
            $status = null;
            switch ($paymentObject->status) {
                case 'publish':
                    $meta = $paymentObject->payment_meta;
                    $status = isset($meta['_give_is_donation_recurring']) && $meta['_give_is_donation_recurring'] ? 'first_renewal' : 'completed';
                    break;
                case 'give_subscription':
                    $status = 'renewal';
                    break;
                default:
                    $status = $paymentObject->status;
            }
            $url = admin_url(
                'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . absint(
                    $paymentObject->ID
                )
            );

            $data[] = [
                'type' => 'donation',
                'donation' => $paymentObject,
                'status' => $status,
                'amount' => $amount,
                'url' => $url,
                'time' => $paymentObject->date,
                'donor' => [
                    'name' => "{$paymentObject->first_name} {$paymentObject->last_name}",
                    'id' => $paymentObject->donor_id,
                ],
                'source' => $paymentObject->form_title,
            ];
        }

        // Return $list of donations for RESTList component
        return $data;
    }
}

Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
AverageDonation.php
6.889 KB
17 Jun 2022 4.03 AM
bravetechrwanda / bravetechrwanda
0644
DonationsVsIncome.php
2.99 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
Endpoint.php
11.735 KB
28 Jan 2026 8.00 PM
bravetechrwanda / bravetechrwanda
0644
FormPerformance.php
4.083 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
Income.php
4.313 KB
17 Jun 2022 4.03 AM
bravetechrwanda / bravetechrwanda
0644
IncomeBreakdown.php
4.339 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
PaymentMethods.php
2.419 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
PaymentStatuses.php
3.766 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
RecentDonations.php
2.134 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
TopDonors.php
2.963 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
TotalDonors.php
5.502 KB
17 Jun 2022 4.03 AM
bravetechrwanda / bravetechrwanda
0644
TotalIncome.php
6.009 KB
17 Jun 2022 4.03 AM
bravetechrwanda / bravetechrwanda
0644
TotalRefunds.php
5.35 KB
17 Jun 2022 4.03 AM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF