Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
<?php
declare( strict_types = 1 );
namespace WMDE\Fundraising\Frontend\Presentation\Presenters;
use WMDE\Fundraising\DonationContext\UseCases\CancelDonation\CancelDonationResponse;
use WMDE\Fundraising\Frontend\Presentation\TwigTemplate;
/**
* Present the result of the donation cancellation request
*
* @license GPL-2.0-or-later
* @author Kai Nissen < kai.nissen@wikimedia.de >
*/
class CancelDonationHtmlPresenter {
private $template;
public function __construct( TwigTemplate $template ) {
$this->template = $template;
}
public function present( CancelDonationResponse $response ): string {
return $this->template->render( [
'donationId' => $response->getDonationId(),
'cancellationSuccessful' => $response->cancellationSucceeded(),
'mailDeliveryFailed' => $response->mailDeliveryFailed()
] );
}
}