Reputation: 8322
In the paypal IPN system, paypal will make a request on your server with many parameters in the URL using curl. I'm wondering if I'm supposed to store each key/value in a separate field in the database, or if I should store the whole request as a string in a single field.
Which is the preferred or common method?
The main thing which is concerning me is, if later paypal decide to add more variables or deprecate old ones then the database would need to be altered. Storing values in separate fields also makes it a lot more difficult to store the order data when you have item_name# (an unknown number of variables) to store.
Is there any reason I should create a separate field in my database for each variable paypal will return?
Upvotes: 0
Views: 237
Reputation: 454
I would store the least amount of information as possible. Don't store what you dont need. Also, I would recommend creating fields for each thing you want to store because this way later down the road if paypal does change their api all you have to change is your mapper between the database and paypal and not the string value you are parsing for each time.
Upvotes: 1