Jump to content

Normalizing a Payment DB?


justravis

Recommended Posts

I\'m confused on how to create a db that tracks recuring and one time charges. Just dont know where one time charges fits in the puzzle. Any help would be greatly appreciated.

 

Clients will be charged different prices for the same service. If prices go up, I want the db to still store fees paid in the past. That is why I did not combine the Subscrible & Transaction tables.

 

Heres is the structure thus far:

 

Organization

a) Id

B) name

 

Contact

a) Id

B) Org_id

c) Name

d) Phone

e) Email

f) Address

g) City

h) State

i) zip

 

mop (method of payment)

a) id

B) org_id

c) card_nbr

d) exp_date

e) verification_nbr

 

Service

a) Id

B) name

 

Subscribe

a) Id

B) Inactive

c) Org_ID

d) Serv_ID

e) cost

 

Transaction

a) id

B) Subscribe_id

c) date

Link to comment
Share on other sites

We can help you better if you can explain the purpouse of each table

 

Organization

a) Id - Primary key

B) name

 

Contact

a) Id - Foreign key to Organixation table

B) Org_id // Not needed you have the ID in org table which can be used

c) Name

d) Phone

e) Email

f) Address

g) City

h) State

i) zip

 

mop (method of payment)

a) id - Foreign key to Organixation table

B) org_id // Not needed

c) card_nbr

d) exp_date

e) verification_nbr

Link to comment
Share on other sites

You did fairly well. The only thing I see you missing is a column for the actual amount of the transaction in transaction. Transaction should be your \"actual\" table, where the amount is stored.

 

In that way, one time transactions and subscriptions can co-exist. If pricing changes over time, this won\'t matter, because the history of what was paid in the past will still be in The Transaction table. For one-time payments you can leave subscribe_id empty or better yet have a special Subscribe row (id 1 perhaps) that you use for all one time transactions.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.