[WMDE-Fundraising] Cancel Donation
Closed, ResolvedPublic10 Story Points

Description

mark donation as canceled and send email confirming the cancellation.
Can only be called if utoken is not expired.
URL: https://test.wikimedia.de/spenden/storno.php
Request model parameters:

  • token
  • sid
  • utoken

Response model:

  • Cancellation status (currently it's 'ok', 'error', 'done' and 'echo'. What they mean needs more explanation). The status determines the result page.
  • donation ID
  • if status is 'ok', another field showing if sending the mail was successful (success page must be shown, even when the mail was not sent).
Tobi_WMDE_SW updated the task description. (Show Details)
Tobi_WMDE_SW raised the priority of this task from to Normal.
Tobi_WMDE_SW added subscribers: Tobi_WMDE_SW, Aklapper.
Tobi_WMDE_SW updated the task description. (Show Details)Jan 7 2016, 10:56 AM
Tobi_WMDE_SW set Security to None.
Tobi_WMDE_SW edited a custom field.

I'm, having trouble finding the old code doing this (been looking for 30 mins and still don't have it). The storno.php file just has require("index.php");. Also not finding the caller.

I've figured out that "storno" is cancellation and that the handling code is at https://github.com/wmde/fundraising/blob/ad9ba8e30429741691a025668954e007c492e0cc/src/DonationProcessing/SpendenProzessor.php#L828

Still can't find the calling code. Did a string search on "storno" and looked at all occurrences. Is the form perhaps defined in the CMS wiki?

JeroenDeDauw added a comment.EditedFeb 4 2016, 3:42 AM

Not understanding the difference between bestaetigungsseite.inc.php and stornobestaetigung.inc.php. Too much spaghetti and germanness :)

I'm trying to figure out what the result of this action is, further than updating the donation status and confirmation email sending when cancellation is possible.

Still can't find the calling code. Did a string search on "storno" and looked at all occurrences. Is the form perhaps defined in the CMS wiki?

Yes, there is a link on the page that confirms the docation, which passes action=storno as a parameter. The confirmation pages are stored in the CMWiki.

Not understanding the difference between bestaetigungsseite.inc.php and stornobestaetigung.inc.php. Too much spaghetti and germanness :)

I'm trying to figure out what the result of this action is, further than updating the donation status and confirmation email sending when cancellation is possible.

bestaetigungsseite.inc.php confirms the donation whereas stornobestaetigung.inc.php confirms its cancellation. Apart from updating the status and sending an email there's a log message stored in spenden.data['log'] and the timestamp in the donation cookie gets reset, because it would prevent users from making a new donation.

WMDE-leszek added a comment.EditedFeb 5 2016, 11:39 AM

Still can't find the calling code. Did a string search on "storno" and looked at all occurrences. Is the form perhaps defined in the CMS wiki?

Cancellation code is here: https://github.com/wmde/fundraising/blob/master/spenden/spendenverarbeitung.inc.php#L589-L619 with actual method being called at https://github.com/wmde/fundraising/blob/master/spenden/spendenverarbeitung.inc.php#L597
But figuring out how it actually gets there might require getting through all the spaghetti in spendenverarbeitung.inc.php and knowing what Kai said above.

Things that still need to be done:

  • finish the confirmation email template
  • add log message to spenden.data['log']
Restricted Application added a project: WMDE-Fun-Team. · View Herald TranscriptApr 7 2017, 11:25 AM
Tobi_WMDE_SW closed this task as Resolved.Apr 7 2017, 11:26 AM
Tobi_WMDE_SW claimed this task.