Transactions

The Dworkin transaction model usage varies depending on different card types involved in the payment transaction flow, but generally all system transactions can be divided into 3 subtypes:

  • Deposit
  • Transfer
  • Withdraw

The Dworkin transaction model consists of the following components:

  • Operation
  • Transaction
  • Fee

Operation entity defines all basic information regarding each particular payment transaction (order id, type and timestamp) and serves like a group for linked transaction entities.

Transaction entity represents the core of Dworkin’s transactional model and contains the following data:

Each transaction is linked to the operation group by operation_id, contains amount in smallest monetary unit and currency. Also it consists of IDs of sender and beneficiary merchant accounts and cards accounts  and currency exchange rates between merchant accounts and card accounts at payment transaction execution moment.

Using these data it is always possible to summarise all credit and debit transaction for each particular account.

The example above demonstrates credit card deposit to wallet operation in Dworkin demo wallet application performed for amount 100 USD. Operation is assigned to merchant account #45 and internally funds are deducted from pre filled merchant account wallet #123456713 and sent to customer wallet card #1. Card and merchant accounts have the same currency as deposit operation – USD, therefore currency exchange rates are equal to 1.0.

Transfer operations between cards contains two transactions in operation group and can be demonstrated with the following data:

In the example above, amount for 5 EUR is transferred between 2 cards with different native currency – EUR and USD with IDs #1 and #2. In opposite to deposit example system is not using merchant account that invoked the API, but uses internal system accounts – card account and transfer account, which are used for statistical calculation purposes.

Depending on card types account balance can be obtained using different approaches:

Virtual/Plastic card balances should be retrieved using Card Provider service interface invocation via external Card Processing system which manages the cards.

Dworkin wallet balance is dynamically calculated  inside Card Provider service using amount difference between incoming and outcoming transactions described in above transaction model.