# give/4.16.9/src/DonationForms/Actions/ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 26 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/DonationForms/Actions/ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/DonationForms/Actions/ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php
- Modified: 2024-08-28T18:13:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/DonationForms/Actions/ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php#L10-L20`.

```php
<?php

namespace Give\DonationForms\Actions;

use Give\DonationForms\DataTransferObjects\DonationConfirmationReceiptViewRouteData;

class ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe
{
    /**
     * Replace the give_receipt shortcode with the v3 confirmation page iframe.
     *
     * @since 3.16.0
     */
    public function __invoke(string $view): string
    {
        $data = DonationConfirmationReceiptViewRouteData::fromRequest(give_clean($_GET));

        if ($data->receiptId) {
            $viewUrl = (new GenerateDonationConfirmationReceiptViewRouteUrl())($data->receiptId);
            return "<iframe style='width: 1px;min-width: 100%;border: 0;' data-givewp-embed src='$viewUrl'></iframe>";
        }

        return $view;
    }
}

```
