Error when redirecting to external website after donation form completed
-
Hi
I have been using a code snippet based on the
conditional-successful-donation-redirect.php
snippet in the library to redirect the success page for our US donors to the online donation form of the intermediary we use to accept tax-deductible donations and all has worked well. We get a record of their pending donation; they make an online donation on the US site and we manually mark it complete when it arrives.We now have to change our US intermediary and the new url for the success page is causing issues. It gets to the page correctly but the form displayed lacks some fields. However, if I enter the url as the link for a button, it displays correctly.
Here’s the code I’m using to redirect the form success page:
function ou_give_usa_redirect( $success_page ) { $cafa_website_form_id = 7406; $form_id = isset( $_POST['give-form-id'] ) ? $_POST['give-form-id'] : 0; if ($form_id == $cafa_website_form_id ) { $success_page = esc_url( 'https://cafa.iphiview.com/cafa/GivingOpportunities/DonorAdvisedGiftForm/tabid/618/dispatch/dag_id$0_hash$39da10bf0100a8b755b74f3a27aa76d820aaf1f6/Default.aspx' ); } return $success_page; } add_filter( 'give_get_success_page_uri', 'ou_give_usa_redirect', 10, 1 );
I tried replacing
esc_url()
withesc_url_raw()
and also not cleaning the url at all but the same error occurs. I can’t find where in the code the success page is triggered to investigate what happens after the filter is applied to cause this issue. So any help will be greatly appreciated.Our development site is currently private – let me know if you need to log in and I can set it up for you.
Thanks
Julian
- The topic ‘Error when redirecting to external website after donation form completed’ is closed to new replies.