Skip to content
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

Add unit test for net_amount when fee_amount is set #14909

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 29, 2019

Overview

This just improves testing & ensures fee_amount is used to set net amount.

I got some odd results on financial_trxn & financial_item but just adding checks for
what I found atm

Before

Less tests, net_amount not calculated off fee_amount

After

More tests, net_amount calculated

Technical Details

Preliminary digging towards eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor#127

Comments

@mattwire I think this was something you were trying to tell me about - even though we say processors should only set fee_amount in this scenario that wasn't enough & without this patch they need to set net_amount too

@civibot
Copy link

civibot bot commented Jul 29, 2019

(Standard links)

@civibot civibot bot added the master label Jul 29, 2019
@seamuslee001
Copy link
Contributor

This looks good to me adding MOP

@mattwire
Copy link
Contributor

@eileenmcnaughton Yes, total_amount, fee_amount, tax_amount should all be "settable", net_amount should always be calculated so should never be set explicitly

This just improves testing & ensures fee_amount is used to set net amount.

I got some odd results on financial_trxn & financial_item but just adding checks for
what I found atm
@eileenmcnaughton eileenmcnaughton merged commit 73dbb38 into civicrm:master Jul 29, 2019
@eileenmcnaughton eileenmcnaughton deleted the net_amount branch July 29, 2019 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants