From 487df858ddfe322dd307c0e9820afa4d29d404d6 Mon Sep 17 00:00:00 2001 From: Filip Ocelka Date: Mon, 27 May 2024 16:36:11 +0200 Subject: [PATCH] BATM-6033 Add ITransactionListener#onDepositCreated method --- .../server/extensions/IDepositDetails.java | 70 +++++++++++++++++++ .../extensions/ITransactionDetails.java | 12 ++++ .../extensions/ITransactionListener.java | 4 ++ 3 files changed, 86 insertions(+) create mode 100644 server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IDepositDetails.java diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IDepositDetails.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IDepositDetails.java new file mode 100644 index 000000000..f47bc27f1 --- /dev/null +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/IDepositDetails.java @@ -0,0 +1,70 @@ +package com.generalbytes.batm.server.extensions; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * Provides details about created deposit transaction. + */ +public interface IDepositDetails { + + /** + * Serial number of the GB safe where the deposit was made. + */ + String getSafeSerialNumber(); + + /** + * Status of the deposit transaction. + * + */ + int getStatus(); + + /** + * Server time of the deposit transaction. + */ + Date getServerTime(); + + /** + * GB Safe time of the deposit transaction. + */ + Date getSafeTime(); + + /** + * Deposit code of the related order transaction. + */ + String getDepositCode(); + + /** + * Identity of the customer who made the deposit. + */ + IIdentity getIdentity(); + + /** + * Amount of cash deposited. + */ + BigDecimal getCashAmount(); + + /** + * Fiat currency of the cash deposited. + */ + String getCashCurrency(); + + /** + * Remote transaction ID of the deposit. + */ + String getRemoteTransactionId(); + + /** + * Local transaction ID of the deposit. + */ + String getLocalTransactionId(); + + /** + * List of banknotes deposited in the transaction. + */ + List getBanknotes(); +} diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionDetails.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionDetails.java index df5c2c51b..5de9b6037 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionDetails.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionDetails.java @@ -30,6 +30,8 @@ public interface ITransactionDetails { int TYPE_SELL_CRYPTO = 1; int TYPE_WITHDRAW_CASH = 2; int TYPE_CASHBACK = 3; + int TYPE_ORDER_CRYPTO = 4; + int TYPE_DEPOSIT_CASH = 5; //Buy states int STATUS_BUY_IN_PROGRESS = 0; @@ -54,6 +56,16 @@ public interface ITransactionDetails { int STATUS_CASHBACK_COMPLETED = 0; int STATUS_CASHBACK_ERROR = 1; + // ORDER STATES + int STATUS_ORDER_IN_PROGRESS = 0; + int STATUS_ORDER_CASH_DEPOSITED = 1; + int STATUS_ORDER_COMPLETED = 2; + int STATUS_ORDER_ERROR = 3; + + // DEPOSIT STATES + int STATUS_DEPOSIT_COMPLETED = 0; + int STATUS_DEPOSIT_ERROR = 1; + //error codes int BUY_ERROR_NO_ERROR = 0; int BUY_ERROR_INVALID_PARAMETERS = 1; diff --git a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionListener.java b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionListener.java index e17d7cca3..cca8019a8 100644 --- a/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionListener.java +++ b/server_extensions_api/src/main/java/com/generalbytes/batm/server/extensions/ITransactionListener.java @@ -106,4 +106,8 @@ default Map onTransactionUpdated(ITransactionDetails transactionD */ default void receiptSent(IReceiptDetails receiptDetails) { } + + default Map onDepositCreated(IDepositDetails depositDetails) { + return null; + } }