Restfull Micro-Service to support general commerce above TodaQ block-chain technology.
- Support general commerce payment based on TodaQ API
- Ready to deploy in AWS Cloud in 3 minutes.
- Provide a web based admin console for payment management.
- Agent module in nodejs, python for developer.
- TYPE:
ACCOUNT
- Master information about user(or company), which is copied via RDB.
- Encrypt TODAQ's Account Information like
<account-id>
. (Onlysuper
user can see). - Can be synchronized with TODAQ Accounts.
total
has total amount of value of conins belonged to user.
-
연결(link)
: Connect current user with TODAQ's Account (or create new one)Account Type
: BIZ/INVAccount ID
: save the encrypted todaq's account-id into KMS.
-
활성(activate)
: Changeactive
state in TODAQ.Active State
: ...
-
동기화(sync)
: Synchronize information, and aggregate total value of coins.Balance
: total balance of coins.Sync Date
: timestamp of synchronization (including webhook callback).
-
패스코드(passcode)
: Confirm the transaction per account/enterprise.Digit Code
: 4~6 digits number.
- save in encrypted string by KMS
- TYPE:
COIN
- Like coins in real-world, it has value estimation as 10 KRW, 100 KRW
- Can be matched with TODAQ's
<file-type-id>
attribute => only possible to have hash-key. - Only define the specifications (like 10KRW) about each coin.
-
정의(define)
: define root/child type of coin. (role:admin
)file-type-id
: for root. for childs.file-type
:COIN
initial-owner
: enterprise id (or bank of coin).coin-code
: code like USD/SOM/KRW/... (inherit from root)coin-name
: readable name. (inherit from root)coin-note
: like 10/100/500/1000. (only for child)hash-code
: = hash(code + intial-owner + name + note)
-
발행(issue)
: Generate coins like exchange-bank in real world (but, enterprisor has ownership)id
: same as<file-id>
file-type-id
: id ofCOIN
.file-type
:COIN
initial-owner
: enterprise id (or bank of coin).coin-code
: code like USD/SOM/... (inherit from file-type-id)coin-note
: note value (inherit from file-type-id)issue-date
:issue-reason
: ...hash-code
: = hash(type-id + intial-owner + type + code + node + date)
-
폐기(trash)
: Trash coins only by Owner.Trash Account
: ...
-
교환(exchange)
: Exchange between different conins with same value. (Use transaction api internally)Exchange Rate
: 10 SOM = 10 KRW.Exchange Cost
: as tax per exchange (or zero) to enterprise.
-
전달(transfer)
: Transfer coins to other account w/ transaction.Transfer Rate
: Y := X + aTransfer Cost
: as tax per transfer. (or zero) to enterprise.
- TYPE:
PAYMENT
- Use coins to buy something. (and get some changes)
- Make transaction, and make sure settlement in seconds. (TBD)
-
결제(pay)
: Transfer coins in total cost of product to seller, then get the changes.meta
: save product's id.transaction-id
: keep track of transaction-id in database (will be synced with todaq-api)
-
취소(cancel)
: Cancel payment, then returns back product/coins.transaction-id
: keep the original transaction-id.
-
충전(charge)
: Buying coins with PG payment from enterprise.Payment Code
: ...
-
환불(refund)
: Refund to credit.
- TYPE:
COUPON
- Like coins in real-world, it has the benefit like 10% discount if total > 1000.
- Rule based definitions.
-
발행(issue)
: Provider could generate.Serial Code
: ...
-
수락(accept)
: Provider could generate.- ``: ...
- search files by
<file-type-id>
? or scan all files per acount in order to aggregate?- 'Accounts - Get File Types' -> 'Accounts - Get Files by Type'
- define each state of
file(coin)
,transaction
. - size of meta data in file. purpose of meta history? -> 4MB limit of payload, or use payload-hash.
- every transation, each meta data will be appended to file's meta.
- use-case of 'Files Proofs'
- implementing of TodaQ app -> cupcake
- search maximum limit/page number -> see
total-results
. - common error handling
- duplicated-file: fileid = Hash(payload-hash, merckle-root, first owner)
- de-nomination will come in soon.git
- synchronization concern in queue order.
- how many of available files?
- open-source and magic-key -> no way.
{ type: "transaction-update", transaction-id: ..., }
STATUS | description | state |
---|---|---|
PENDING | after 0~30s -> SUBMITTED | in-flight |
SUBMITTED | in 30s -> SENDER_COMPLETE | in-flight |
SENDER-COMPLETE | in 1s -> RECEPIENT-COMPLETE | gone |
RECIPIENT-COMPLETE | completed tx | spendable |
INCOMPLETE | need to re-submit transaction with same tid? | - |
- possible to add webhook in future upon request.