-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix api Payment.create to support overpayments #15909
Conversation
We've discussed this before - it's OK to add a payment to a fully paid contribution because ... life. When this happens there should be no financial items linked to the over payment
(Standard links)
|
@kcristiano any chance you can take a look at this or @mattwire - it's only api accessible as yet but is a necessary step towards permitting 'add payment' regardless of contribution status |
@eileenmcnaughton I've done an I can add a new payment to an existing contribution id. If I just create the payment, the financial type is not set (not visible in UI or bookkeeping report. That can be set manually, But
{
"is_error": 0,
"version": 3,
"count": 1,
"id": 99,
"values": [
{
"id": "99",
"from_financial_account_id": "7",
"to_financial_account_id": "6",
"trxn_date": "2019-11-26 00:00:00",
"total_amount": "3000.00",
"currency": "USD",
"is_payment": "1",
"status_id": "1",
"payment_instrument_id": "4"
}
]
} Is this the expected behavior? With No UI, putting the onus on those using would be acceptable. However, without the PR we get |
@kcristiano so the earlier discussion with @lcdservices & @JoeMurray was that if a payment is received we should record it. We don't allocate it to line items - hence the lack of financial types but it has been received so it exists. I'm not too worried about calling code relying on the exception - it's not as widely used as we would like and the fact remains that if a payment has been received it should be recorded |
@eileenmcnaughton in that case this PR does exactly what it intends to. Targeting master/5.21 (I hope) I'd prefer it in master as it's targeted and not backported to 5.20 as I am doing a good deal of testing on that and would like to see this drop separately. |
@kcristiano yes it's against master |
Thanks for confirm. I think this is good to merge |
OK I'll merge this but @JoeMurray & @lcdservices might want to check in - I'm going off previous comments by them (will link when I find them) |
Overview
Fix api Payment.create to support overpayments
Before
Calling Payment.create api to add a payment to a fully paid order results in an error
After
Payment is created. Status remains at 'Completed' and no related entities are updated. No financial items are linked to the new payment
Technical Details
We've discussed this before - it's OK to add a payment to a fully paid contribution because ... life. Arguably we could make this more obvious in the UI when it happens but it's an edge case so let's not go there on a 'this might be useful'. Adding another 'should be calculated really' status would not be helpful but it would add complexity- Completed is fine.
When this happens there should be no financial items linked to the over payment
Comments
@lcdservices @JoeMurray @kcristiano @monishdeb @mattwire @magnolia61