$91 GRAYBYTE WORDPRESS FILE MANAGER $20

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

/home/bravetechrwanda/itiministry.org/plugins/give/src/Donors/resources/hooks/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/Donors/resources/hooks//useDonorDonations.ts
/**
 * @since 4.4.0
 */
import {useEntityRecords} from '@wordpress/core-data';

/**
 * @since 4.13.0 updated the date and amount types
 * @since 4.4.0
 */
export interface DonationResponse {
    id: number;
    formTitle: string;
    createdAt: string;
    status: string;
    amount: {
        value: string;
        valueInMinorUnits: string;
        currency: string;
    };
}

/**
 * @since 4.4.0
 */
interface DonationsQueryParams {
    donorId: number;
    page?: number;
    perPage?: number;
    mode?: 'test' | 'live';
    status?: 'any' | 'publish' | 'give_subscription' | 'pending' | 'processing' | 'refunded' | 'revoked' | 'failed' | 'cancelled' | 'abandoned' | 'preapproval';
    sort?: 'id' | 'createdAt' | 'updatedAt' | 'status' | 'amount' | 'feeAmountRecovered' | 'donorId' | 'firstName' | 'lastName';
    direction?: 'ASC' | 'DESC';
}

/**
 * @since 4.4.0
 */
export function useDonorDonations({donorId, page = 1, perPage = 5, mode = 'live', status = 'any', sort = 'createdAt', direction = 'DESC'}: DonationsQueryParams) {
    const query = {
        page,
        per_page: perPage,
        mode,
        donorId: donorId,
        status,
        sort,
        direction
    };

    const {records, hasResolved, isResolving} = useEntityRecords<DonationResponse>('givewp', 'donation', query);

    return {
        donations: records,
        hasResolved,
        isResolving
    };
}


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
useDonorDonations.ts
1.369 KB
5 Nov 2025 7.00 PM
bravetechrwanda / bravetechrwanda
0644
useDonorStatistics.ts
1.56 KB
18 Jun 2025 7.01 PM
bravetechrwanda / bravetechrwanda
0644

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