-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Display donation receipt in Form Grid modal after offline gateway redirect #7672
base: develop
Are you sure you want to change the base?
Conversation
@JoshuaHungDinh did you see my note in Jira about the missing data attribute? i'm curious if you looked into that and if going that route would simplify this. |
@jonwaldstein I looked into the I was looking into some information that suggests we might be able to intercept the redirect & localize it within a container but ultimately put this PR together based off the |
4810b5a
to
053c721
Compare
@JoshuaHungDinh okay, sounds like the form grid is built differently than our form block. One more thing to test would be the form grid alongside a donation form block on a page to make sure the modal is opening the correctly submitted form. The gateway api provides a success url with params to notify the page of a completed donation, show the confirmation page and which element/embed was used to donate. Some other params you might also want to check for:
|
Resolves: GIVE-931
Description
DonationFormBlock
Reference: https://github.com/impress-org/givewp/blob/develop/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsxProblem:
The issue occurs when offline gateways (e.g., Stripe Payment Element) trigger a page refresh after a donation is processed. This refresh happens when the gateway redirects the user back to the initial page, causing any open modals (including the modal rendering the donation receipt) to close.
Solution:
To resolve this, the PR introduces the following approach:
An event listener that checks the redirect/donation completed status on page load via the URL search params was included. If the user is coming from a redirected gateway (e.g., after completing the donation), the appropriate modal is programmatically re-opened by matching
givewp-embed-id
from the url params.Affects
Donation Form Grid.
Visuals
https://www.loom.com/share/66a45b64fa2c4e31bbf9280acfc2458d?sid=f63b847a-097f-4a28-9bf5-6f242da06184
Testing Instructions
Pre-review Checklist