Acceptance criteria:
- All URL generators have a method that accepts "context" data structure (containing data from donation/membership bounded contexts) and returns a URL
- Create four implementations
- PayPal
- Micropayment (credit card)
- Sofort
- A "Null" implementation (just returns null) for internal payments
- There is a factory class that returns a fully configured URL generator for each payment type
- The "Create Payment" use case output DTO contains the URL generator for the payment.
Implementation details:
Create a PaymentProviderUrlGenerator interface. It should have a method for getting a nullable URL string, with a context parameter that contains all possible data
Suggested fields for "context" DTO:
- itemId (donation or membership id)
- invoiceId (unique ID, currently derived from donation/membership ID)
- updateToken
- accessToken
- description ("Ihre Spende für Freies Wissen", etc)
Specific implementations of URL generators might ignore some of the context fields.
The factory will receive the configuration options for the generators as constructor dependencies.
The factory function for the generators needs the payment id and might need payment-specific information (e.g. Sofort needs the bank transfer code).
Add Tests for the different payment types