PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / DonationForms / Controllers / DonationConfirmationReceiptViewController.php

DonationConfirmationReceiptViewController.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/DonationForms/Controllers/DonationConfirmationReceiptViewController.php

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\DonationForms\Controllers;
4
5 use Give\DonationForms\DataTransferObjects\DonationConfirmationReceiptViewRouteData;
6 use Give\DonationForms\ViewModels\DonationConfirmationReceiptViewModel;
7 use Give\Donations\Models\Donation;
8
9 class DonationConfirmationReceiptViewController
10 {
11 /**
12 * This renders the donation confirmation receipt view.
13 *
14 * @since 3.0.0
15 */
16 public function show(DonationConfirmationReceiptViewRouteData $data): string
17 {
18 if (!$data->receiptId) {
19 return '';
20 }
21
22 $donation = give()->donations->getByReceiptId($data->receiptId);
23
24 if (!$donation) {
25 return '';
26 }
27
28 /**
29 * Fires before the donation confirmation receipt view is rendered.
30 *
31 * @since 3.4.0
32 *
33 * @param Donation $donation
34 */
35 do_action('givewp_donation_confirmation_receipt_showing', $donation);
36
37 ob_clean();
38 return (new DonationConfirmationReceiptViewModel($donation))->render();
39 }
40 }
41