# Transaction fee calculation

## Recommended Posts

Looking to do a calculation of a transaction fee that is based on a fixed percent plus \$0.11.  This is determined by the date the transaction comes through one.  So registrants are paying \$325 initially which gets broken up in the database as \$75 registration fee and  \$250 tuition, both on the same date.  I can easily add those together and calculate one transaction fee, but there will be separate payments coming in the future that are on a different date and need to get assesses the transaction fee separately.   Right now there is a transaction table and a student table that are joined by an ID.  Any thoughts about how best to proceed?

Thanks,

Dan

##### Share on other sites

This is a bit difficult to understand. Do you mean that if there are multiple transactions on the same day, the fee should be added only to one of them? That would be possible, but not simple.

Could there be another way to distinguish between them, for example by type? Apart from the first two (registration fee and  tuition), will there really be multiple transactions on the same day? If yes, will there be anything common to these transactions that ties them together?

##### Share on other sites

Thanks for the questions,  this is a new interface so haven't worked through all of the particulars for the future but I think I have a sense how this will be working:

On the initial registration day a person pays a lump sum of \$325 and agrees to pay an installment payment on April 1st that is the balance due.  The initial lump sum is actually a combo of a \$75 registration fee and a \$250 tuition balance, but that combo is what gets assessed the 2.1% plus \$.11

So in the end the transactions might look like the following and what I need to do is to do a calculation of (grouped_transaction*.021)+.11 but do that calc by coming up with a grouped/summed transaction based on the date.  Hope that makes more sense

1/13/19     \$75

1/13/19   \$250

4/1/19     \$1000

##### Share on other sites

Yes, that is more or less what I understood. But my suggestion was to look at the problem from a different perspective - if possible.

For example, you could not add the \$0.11 fee when the type of the transaction is registration fee. That would make the fee depend solely on the data in the same record - thus save you the complications of testing for the existence of other records for the same person on the same date.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

×
×
• Create New...