dev/financial#153 Fix redirect to PayPal #18993
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes problem where PayPal redirects to https://cgi-bin/webscr after it's captcha page.
Before
If you clicked on the PayPal button on a donate or event registration form and then PayPal decides to give you it's captcha, PayPal would redirect you to https://cgi-bin/webscr after the captcha.
After
The redirect after filling out PayPal's captcha continues to the next page in PayPal's payment process.
Technical Details
If you put in double slashes in the path part of the PayPal URL and then PayPal asks you to do their captcha, they have some sort of bug where they do the wrong redirect after the captcha to https://cgi-bin/webscr. The URL that CiviCRM uses to send you to PayPal is made up of the configured "url_site" for the PaymentProcess plus a hardcoded path starting with "/cgi-bin/webscr". This change removes the trailing slash from the url_site string if it's there before combining it with the rest of the path.
https://lab.civicrm.org/dev/financial/-/issues/153