Acceptance criteria:
- "AddDonation" use case tests pass
- all PHPStan and PHPCS checks for "AddDonation" use case and tests pass
- Use case test is a unit test (instead of an integration test) that doesn't use the database.
- All notification-related classes use the payment ID from the donation to get the payment data for sending emails, instead of getting a payment object from the donation
Implementation details:
Add the "create payment" use case as a dependency of the "Add Donation" use case.
Call it inside the "AddDonation" use case and check for the return type (success / failure).
Change all payment data processing to create a PaymentCreationRequest instead of creating a payment directly
Remove BankDataValidator as a dependency from DonationValidator.
Call the UrlGenerator method of the CreatePayment return DTO to get a URL and pass it on in the output DTO.
Add an implementation of DomainSpecificPaymentValidator that checks the upper and lower bounds of donations (amounts configurable through constructor)
In the test environment, you'll need to instantiate the PaymentContextFactory, register its mapping driver with the entity manager (so that the automated schema creation can pick it up) and call its registration of the new data types.
Changes to the success response:
- Mark the donation property of the success response as deprecated
- add a donation id (will be later used instead of the donation entity)
- Add a nullable url to the success response