# give/4.18.0/src/DonationForms/Actions/GenerateDonationConfirmationReceiptUrl.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 25 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/DonationForms/Actions/GenerateDonationConfirmationReceiptUrl.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/DonationForms/Actions/GenerateDonationConfirmationReceiptUrl.php
- Modified: 2023-10-16T17:55: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.18.0/code/src/DonationForms/Actions/GenerateDonationConfirmationReceiptUrl.php#L10-L20`.

```php
<?php

namespace Give\DonationForms\Actions;

use Give\Donations\Models\Donation;
use Give\Framework\Routes\RouteListener;

class GenerateDonationConfirmationReceiptUrl
{
    /**
     * @since 3.0.0
     */
    public function __invoke(Donation $donation, string $originUrl, string $embedId = ''): string
    {
        $routeListener = new RouteListener(
            'donation-completed',
            'show-donation-confirmation-receipt'
        );

        return $routeListener->toUrl($originUrl, [
            'givewp-receipt-id' => $donation->purchaseKey,
            'givewp-embed-id' => $embedId,
        ]);
    }
}
```
