开发者

Is it good to have two separate tables in database for user information and other for Paypal user?

开发者 https://www.devze.com 2023-03-04 09:00 出处:网络
I\'m a new programmer. I\'m working on a project where I need to integrate Paypal in my website. I\'m confused: why we are saving use开发者_JS百科r information twice in database?

I'm a new programmer. I'm working on a project where I need to integrate Paypal in my website.

I'm confused: why we are saving use开发者_JS百科r information twice in database? First I collect information from the user and then through Paypal button.


In general, you only want to have information once in a database. However, there may be a case where you want to separate out certain data. For example, if the PayPal data was different than the data you were given directly (first name different, etc.), you might want to store all PayPal data separately. However, if you are just getting duplicate data, I would suggest merging the two tables into one where possible. Maybe you could create a second table that links to the user table that would store the extra PayPal info (PayPal ID or whatever else is new information to you that would be related to the account, not to the user).

You also need to consider information change. If the user is going to change their name, is that going to be OK if the two tables are merged? Will it matter to PayPal if you try to ask for Jon Doe and PayPal is expecting Jonathan? Probably not since I doubt PayPal is doing a name lookup. However, you do need to look at these types of possibilities. You also need to consider the idea of a user having multiple PayPal accounts (personal and work for example). In that case, will your structure (whatever you decide on) handle that?


Why are you asking for information if you are getting information from Paypal? Perhaps you don't even need to gather information from the customer. Does the customer have to sign up for some sort of an account?

Seems redundant.

0

精彩评论

暂无评论...
验证码 换一张
取 消