Fix user-defined donation prices being saved with zero value #1363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
After updating my alf.io instance from
2.0-M4-2304
to2.0-M4-2402-3
I noticed donation fields with user-defined # no longer work properly.Here is an example of a ticket which costs $5.50 with an attached donation of $7.00:

When I reach the summary screen you can see the donation value in the table is $0.00:

Upon investigating I found this is being caused by the incorrect field being inserted into additional_service_item.src_price_cts. When the
event/{eventName}/reserve-tickets
endpoint is called, eventually we get to the 'AdditionalServiceManager.bookAdditionalServiceItems' method where we are inserting the additional_service_item rows to the database. For the src_price_cts column we are inserting as.getSrcPriceCts() which when the price is NOT fixed has a value of 0. When calling 'AdditionalServicePriceContainer.getSrcPriceCts' it already has it's own method of dealing with this issue by checking whether the price is fixed:Because of this it seemed appropriate to just substitute the call to as.getSrcPriceCts() with pc.getSrcPriceCts(). If you could please let me know if this is something you would be interested in merging. I am not very familiar with the codebase but would be happy to look at implementing further required changes if necessary.
Thank you.