0

I have two payment gateways Paypal and Authorize.net on my website. There are following payment types:

  1. Paypal (One time payment)
  2. Paypal (Recurring Payment, charge every month)
  3. Authorize.net (One time payment)
  4. Authorize.net (Recurring Payment)

Can you guys help me out with the database design? I want to know what could be the best possible way to store such transactions (of different types and multiple payment gateways) so that it is clean and :

  1. Easy for generating reports
  2. Apply filters based upon payment types, filter recurring payments and check history of recurring payments etc.

Edit: It is an SQL database. I want to store most of the information provided by the payment gateway like transaction id, payment type, status, amount etc. And in case of recurring i want to store billing cycle for which payment has been made and information which is useful for tracking the information.

Thanks in Advance

Patrick S
  • 490
  • 5
  • 17
  • 2
    that's too broad. – Arpit Solanki Jun 27 '17 at 07:38
  • 1
    This is a pretty broad question. What information do you want to maintain. Hint: You probably don't need to duplicate data for things already stored at paypal and authorize. Focus on 1) the business' customers and 2) the business owner to see what data they will need to be stored. You also haven't begun to mention what type of database, sql or non-sql... – zipzit Jun 27 '17 at 07:38
  • I would suggest to take a look at NoSQL DBs, like Mongo or Cassandra, since you don't really know the concrete structure of your data and its going to be dynamic. As for generating reports, you can use Redis or any other in-memory data structure for faster read. – Tariq Albajjali Jun 27 '17 at 07:39
  • @zipzit Sorry for that. I will be using a SQL database. I want to store basic transaction information like Customer name, id, transaction id, payment type, amount, gateway, status, recurring period etc. – Patrick S Jun 27 '17 at 07:41
  • 1
    Patrick, Good choice. You will definitely want to start with MySQL (now called MariaDB). Start with a decent reference, something like [the books and tutorials referenced here.](https://stackoverflow.com/questions/377375/a-beginners-guide-to-sql-database-design) – zipzit Jun 27 '17 at 07:47

0 Answers0