-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(events): Refactor PayInAdvance Billable Metric validation (#2143)
## Description Whenever a event associated with PayInAdvance charge is recieved, we create a Fee for this event. The validation was performed only after we create the Fee for `invoiceable: false` charges creating some disparities if the charge is invoiceable or not. I realized that there is already a validation on the aggregation in the Charge model, which I refactored. ~I have removed all the validation in the PostProcess events because, you're not supposed to be able to create invalid charge (see Charge model validation) and if you send events without the `properties[bm.field_name]`, I'm not sure it should fail silently.~ It creates a fee even without valid properties so I'm keeping the condition as-is, but earlier in the function.
- Loading branch information
1 parent
833d80f
commit 4144983
Showing
5 changed files
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters