Page MenuHomePhabricator

Monthly Convert variant on a recurring donation is pausing on the modal
Closed, ResolvedPublic


When recurring=1 and variant=monthlyConvert_011 the page does nothing when the donate button is clicked. Then when you click donate you see a session expired message.

Found in: T310915

Event Timeline

Hi all!

OK figured out what's going on here...

In summary, this is a due to a disconnect between client-side and server-side logic to determine whether or not we'll show the monthly convert modal.

On the server, if this is a recurring donation, we never consider monthly convert should display. This is in GatewayAdapter::showMonthlyConvert().

When monthly convert is triggered via the server-side MonthlyConvertCountries setting, then we call that method to decide whether or not to load the ext.donationInterface.monthlyConvert.js script.

That same method is also used to determine whether or not mustache will add DOM elements for the modal.

On the other hand, if we trigger a monthly convert variant on the URL using the variant param, and we also specify recurring=0, things also work fine, since the variant config from ui_modules.yaml will load the required JS modules and GatewayAdapter::showMonthlyConvert() will detect that the string "monthlyConvert" is in the variant param and will detect that recurring is false, so it will return true, triggering Mustache to add the required DOM elements.

However... if we trigger a monthly convert variant on the URL using the variant param, and we specify recurring=1 on the URL... then the variant config will cause the monthly covnert UI modules to load, but the DOM elements won't be present, because the recurring flag will cause the PHP logic to decide that we shouldn't show monthly convert, so Mustache won't add them. Then, finally, on Adyen the JS side, the only way we check whether or not to show monthly convert is by the presence of the JS module.

So, in that case, the Adyen JS sees the UI module, tries to show monthly convert, but that fails, since the required DOM elements were never added, and the redirect is never triggered.

Change 813583 had a related patch set uploaded (by AndyRussG; author: AndyRussG):

[mediawiki/extensions/DonationInterface@master] Check for monthly convert DOM elements in Adyen

Change 813583 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Check for monthly convert DOM elements in Adyen

Hi @Pcoombe or @AndyRussG could you confirm:

Are we ok to use variant:'monthlyConvert_011' in banners again? and would you recommend we do that for next week's 6C pre-test? (Evelyn would like Adyen w/ post-payment for 6C)

@HNordeenWMF Yes, we should be okay to include that variant. As well as the change above being deployed, I edited the banner CoreJS so that it will automatically drop any monthlyConvert variant if the donation is already recurring

I'm not sure if we need to include the variant in the banner code or whether it will be shown by default in Adyen/6C. Probably safest to include it just in case.

XenoRyet set Final Story Points to 2.