T
T
Tikhon Ermakov2020-07-09 18:26:13
Database design
Tikhon Ermakov, 2020-07-09 18:26:13

Is it necessary to create an Orders table?

Good afternoon!

I connect Internet acquiring, and during initialization, we need to send OrderId.

I want to implement a subscription system. There are following tables - Memberships, Purchases .

In the Memberships table we store the data that is shown to the user, we will also receive from this table a cell where the subscription cost is recorded. In the Purchases

table - I'm going to store the response from the bank. Example:

{
    "Success": true,
    "ErrorCode": "0",
    "TerminalKey": "77700011123DEMO",
    "Status": "NEW",
    "PaymentId": "560500412",
    "OrderId": "2",
    "Amount": 350000,
    "PaymentURL": "https://securepay.tinkoff.ru/new/7RajYo0X"
}


Also in this table there will be a field where I will store the subscription expiration date.

Is there a need to create an Orders table and what should be stored in this table?
Is it the right decision if I store the subscription expiration date in the Purchases table, or is it better to store it in the user table?

I will be very glad to detailed answers! I need advice from you if you have already dealt with payment systems, also subscriptions. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-07-09
@firedragon

One of the rules is fixing the amount with all discounts in the table of orders, without the ability to change.
So think right.
expand ubuntu_lts , not really clear. They already store data, why did a separate table with transactions not please?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question