give
/
src
/
DonationForms
/
Actions
/
ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php
AddHoneyPotFieldToDonationForms.php
1 year ago
ConvertConsentBlockToFieldsApi.php
2 years ago
ConvertDonationAmountBlockToFieldsApi.php
2 years ago
ConvertDonationFormBlocksToFieldsApi.php
1 year ago
ConvertQueryDataToDonationForm.php
2 years ago
DispatchDonateControllerDonationCreatedListeners.php
1 year ago
DispatchDonateControllerSubscriptionCreatedListeners.php
2 years ago
GenerateAuthUrl.php
2 years ago
GenerateDonateRouteSignatureArgs.php
2 years ago
GenerateDonateRouteUrl.php
2 years ago
GenerateDonationConfirmationReceiptUrl.php
2 years ago
GenerateDonationConfirmationReceiptViewRouteUrl.php
2 years ago
GenerateDonationFormPreviewRouteUrl.php
2 years ago
GenerateDonationFormValidationRouteUrl.php
2 years ago
GenerateDonationFormViewRouteUrl.php
2 years ago
GetOrCreateDonor.php
2 years ago
PrintFormMetaTags.php
1 year ago
ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php
1 year ago
SanitizeDonationFormPreviewRequest.php
2 years ago
StoreBackwardsCompatibleFormMeta.php
2 years ago
ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\DonationForms\Actions; |
| 4 | |
| 5 | use Give\DonationForms\DataTransferObjects\DonationConfirmationReceiptViewRouteData; |
| 6 | |
| 7 | class ReplaceGiveReceiptShortcodeViewWithDonationConfirmationIframe |
| 8 | { |
| 9 | /** |
| 10 | * Replace the give_receipt shortcode with the v3 confirmation page iframe. |
| 11 | * |
| 12 | * @since 3.16.0 |
| 13 | */ |
| 14 | public function __invoke(string $view): string |
| 15 | { |
| 16 | $data = DonationConfirmationReceiptViewRouteData::fromRequest(give_clean($_GET)); |
| 17 | |
| 18 | if ($data->receiptId) { |
| 19 | $viewUrl = (new GenerateDonationConfirmationReceiptViewRouteUrl())($data->receiptId); |
| 20 | return "<iframe style='width: 1px;min-width: 100%;border: 0;' data-givewp-embed src='$viewUrl'></iframe>"; |
| 21 | } |
| 22 | |
| 23 | return $view; |
| 24 | } |
| 25 | } |
| 26 |