$32 GRAYBYTE WORDPRESS FILE MANAGER $73

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//PaymentStatuses.php
<?php

/**
 * Reports base endpoint
 *
 * @package Give
 */

namespace Give\API\Endpoints\Reports;

class PaymentStatuses extends Endpoint
{

    public function __construct()
    {
        $this->endpoint = 'payment-statuses';
    }

    public function getReport($request)
    {
        $start = date_create($request->get_param('start'));
        $end = date_create($request->get_param('end'));

        $gatewayObjects = give_get_payment_gateways();
        $paymentModeKeyCompare = '!=';

        if ($this->testMode === false) {
            unset($gatewayObjects['manual']);
            $paymentModeKeyCompare = '=';
        }

        $gateway = array_keys($gatewayObjects);

        $args = [
            'number' => -1,
            'paged' => 1,
            'orderby' => 'date',
            'order' => 'DESC',
            'start_date' => $request->get_param('start'),
            'end_date' => $request->get_param('end'),
            'gateway' => $gateway,
            'meta_query' => [
                [
                    'key' => '_give_payment_currency',
                    'value' => $this->currency,
                    'compare' => '=',
                ],
                [
                    'key' => '_give_payment_mode',
                    'value' => 'live',
                    'compare' => $paymentModeKeyCompare,
                ],
            ],
        ];

        // Use give_count_payments logic to get payments
        $payments = give_count_payments($args);
        $completed = property_exists(
            $payments,
            'give_subscription'
        ) ? $payments->publish + $payments->give_subscription : $payments->publish;

        return [
            'labels' => [
                'Completed',
                'Pending',
                'Refunded',
                'Abandoned',
                'Cancelled',
                'Failed',
            ],
            'datasets' => [
                [
                    'data' => [
                        $completed,
                        $payments->pending,
                        $payments->refunded,
                        $payments->abandoned,
                        $payments->cancelled,
                        $payments->failed,
                    ],
                    'tooltips' => [
                        [
                            'title' => $completed . ' ' . __('Payments', 'give'),
                            'body' => __('Completed', 'give'),
                            'footer' => '',
                        ],
                        [
                            'title' => $payments->pending . ' ' . __('Payments', 'give'),
                            'body' => __('Pending', 'give'),
                            'footer' => '',
                        ],
                        [
                            'title' => $payments->refunded . ' ' . __('Payments', 'give'),
                            'body' => __('Refunded', 'give'),
                            'footer' => '',
                        ],
                        [
                            'title' => $payments->abandoned . ' ' . __('Payments', 'give'),
                            'body' => __('Abandoned', 'give'),
                            'footer' => '',
                        ],
                        [
                            'title' => $payments->cancelled . ' ' . __('Payments', 'give'),
                            'body' => __('Cancelled', 'give'),
                            'footer' => '',
                        ],
                        [
                            'title' => $payments->failed . ' ' . __('Payments', 'give'),
                            'body' => __('Failed', 'give'),
                            'footer' => '',
                        ],
                    ],
                ],
            ],
        ];
    }
}

Current_dir [ WRITEABLE ] Document_root [ 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