PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 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 All 256 releases
give / src / PaymentGateways / Gateways / PayPalStandard / Actions / GenerateDonationReceiptPageUrl.php

GenerateDonationReceiptPageUrl.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/PaymentGateways/Gateways/PayPalStandard/Actions/GenerateDonationReceiptPageUrl.php

32 lines 768 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways\Gateways\PayPalStandard\Actions;
4
5 use Give\Helpers\Form\Utils;
6 use Give\Session\SessionDonation\DonationAccessor;
7
8 /**
9 * This class use to generate receipt page url.
10 *
11 * @since 2.19.0
12 */
13 class GenerateDonationReceiptPageUrl
14 {
15
16 /**
17 * @since 2.19.0
18 *
19 * @return string
20 */
21 public function __invoke($donationId)
22 {
23 $formId = give_get_payment_form_id($donationId);
24 $isEmbedDonationForm = ! Utils::isLegacyForm($formId);
25 $donationFormPageUrl = (new DonationAccessor())->get()->formEntry->currentUrl ?: get_permalink($formId);
26
27 return $isEmbedDonationForm ?
28 Utils::createSuccessPageURL($donationFormPageUrl) :
29 give_get_success_page_url();
30 }
31 }
32