Skip to content

Commit

Permalink
BATM-6033 Add ITransactionListener#onDepositCreated method
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Ocelka committed May 27, 2024
1 parent 5342e1e commit 487df85
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.
* <ul>
* <li>0 - completed</li>
* <li>1 - error</li>
* </ul>
*/
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<IBanknoteCounts> getBanknotes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ default Map<String,String> onTransactionUpdated(ITransactionDetails transactionD
*/
default void receiptSent(IReceiptDetails receiptDetails) {
}

default Map<String, String> onDepositCreated(IDepositDetails depositDetails) {
return null;
}
}

0 comments on commit 487df85

Please sign in to comment.