Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BATM-6033 Add ITransactionListener#onDepositCreated method #912

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading