# give/4.16.7.2/src/PaymentGateways/Gateways/PayPalStandard/Actions/GenerateDonationReceiptPageUrl.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.7.2. 32 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.7.2/code/src/PaymentGateways/Gateways/PayPalStandard/Actions/GenerateDonationReceiptPageUrl.php
- Raw: https://pluginprobe.com/plugins/give/4.16.7.2/raw/src/PaymentGateways/Gateways/PayPalStandard/Actions/GenerateDonationReceiptPageUrl.php
- Modified: 2022-02-25T01:33:58+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.7.2/code/src/PaymentGateways/Gateways/PayPalStandard/Actions/GenerateDonationReceiptPageUrl.php#L10-L20`.

```php
<?php

namespace Give\PaymentGateways\Gateways\PayPalStandard\Actions;

use Give\Helpers\Form\Utils;
use Give\Session\SessionDonation\DonationAccessor;

/**
 * This class use to generate receipt page url.
 *
 * @since 2.19.0
 */
class GenerateDonationReceiptPageUrl
{

    /**
     * @since 2.19.0
     *
     * @return string
     */
    public function __invoke($donationId)
    {
        $formId = give_get_payment_form_id($donationId);
        $isEmbedDonationForm = ! Utils::isLegacyForm($formId);
        $donationFormPageUrl = (new DonationAccessor())->get()->formEntry->currentUrl ?: get_permalink($formId);

        return $isEmbedDonationForm ?
            Utils::createSuccessPageURL($donationFormPageUrl) :
            give_get_success_page_url();
    }
}

```
