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

Sync changes from 1.3.0 to master #890

Merged
merged 22 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
33fe141
BATM-5625: fix Coinbase Wallet response
drocek Nov 14, 2023
49c114a
BATM-5625: increase version to 1.2.3
drocek Nov 15, 2023
cbd7ca9
Merge branch 'release/patch_1.2.0' into bugfix/BATM-5625_fix_coinbase…
drocek Nov 15, 2023
d4d3f79
Merge pull request #863 from drocek/bugfix/BATM-5625_fix_coinbase_wal…
Houskov Nov 15, 2023
74882c5
Merge pull request #864 from drocek/bugfix/BATM-5625_fix_coinbase_wal…
Houskov Nov 16, 2023
6cb2ffa
BATM-5013 - LND sendpayment should contain remote transaction id - Fix
Nov 28, 2023
93bd0c9
BATM-5013 - LND sendpayment should contain remote transaction id - Fi…
Nov 28, 2023
d952ba6
BATM-5013 - BATM-5013 - LND sendpayment should contain remote transac…
Nov 29, 2023
c575e2a
Merge pull request #872 from SMaros/BATM-5013---LND-sendpayment-shoul…
Houskov Nov 29, 2023
a8d1b1f
BATM-5515: added DATE Custom Field
drocek Dec 19, 2023
7e01efe
Merge pull request #878 from drocek/feature/BATM-5515_and_BATM-5699_a…
Houskov Dec 19, 2023
12345a5
BATM-5730: sending Custom Field ID to extension (#879)
drocek Dec 20, 2023
802ef44
BATM-5742 added overrideTransactionRequest method to the API (#881)
filipocelka Dec 22, 2023
716fb0d
BATM-5722: added Quiz Results to ITransactionPreparation (#884)
drocek Jan 8, 2024
29d365e
LC-301 - remove AU- prepend to australian states (#886)
SMaros Jan 9, 2024
f9a3511
Increased project version
filipocelka Jan 9, 2024
aa966d5
Increased gradle version from 6.5 to 6.8.2 (#887)
filipocelka Jan 9, 2024
3a4636c
Merge branch 'release/patch_1.2.0' into 0110sync1.1.16.1to1.2.0
Jan 10, 2024
66c29ac
Sync changes from 1.1.16.1 to 1.2.0
filipocelka Jan 10, 2024
855c1c3
Merge branch 'release/patch_1.3.0' into 0110sync1.2.0to1.3.0
Jan 10, 2024
c7ae4d8
Sync changes from 1.2.0 to 1.3.0
filipocelka Jan 10, 2024
94e20c4
Merge branch 'master' into 0110sync1.3.0toMaster
Jan 10, 2024
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# buildscript - project id
projectGroup=com.generalbytes.batm.public
projectVersion=1.4.0
projectVersion=1.4.1

# buildscript - common dependency versions
bitrafaelVersion=1.0.44
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* Australia province identifiers.
* <p>
* Usage e.g.:
* CountryAustralia.AU-NSW.getProvinceName()
* CountryAustralia.valueOf("AU-NSW").getProvinceName()
* CountryAustralia.NSW.getProvinceName()
* CountryAustralia.valueOf("NSW").getProvinceName()
*/
public enum CountryAustralia {

AU_NSW("AU-NSW", "New South Wales"),
AU_QLD("AU-QLD", "Queensland"),
AU_SA("AU-SA", "South Australia"),
AU_TAS("AU-TAS", "Tasmania"),
AU_VIC("AU-VIC", "Victoria"),
AU_WA("AU-WA", "Western Australia"),
AU_ACT("AU-ACT", "Australian Capital Territory"),
AU_NT("AU-NT", "Northern Territory");
NSW("NSW", "New South Wales"),
QLD("QLD", "Queensland"),
SA("SA", "South Australia"),
TAS("TAS", "Tasmania"),
VIC("VIC", "Victoria"),
WA("WA", "Western Australia"),
ACT("ACT", "Australian Capital Territory"),
NT("NT", "Northern Territory");

private final String iso;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ default ITransactionPreparation overrideTransactionPreparation(ITransactionPrepa
return preparation;
}

/**
* Allows the operator to override following values in {@link ITransactionRequest}.
* <ul>
* <li>cryptoAmount</li>
* </ul>
* This method is called for both BUY and SELL transactions.
*
* @param request The transaction request initialized by server
* @return {@link ITransactionRequest} that may contain modified transaction request.
*/
default ITransactionRequest overrideTransactionRequest(ITransactionRequest request) {
return request;
}

/**
* Callback method that is called by server before transaction is executed - however the cash is already inserted in machine in case of buy transaction.
* If your method returns false than transaction will not take place and will fail with error ERROR_NOT_APPROVED.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************************
* Copyright (C) 2014-2020 GENERAL BYTES s.r.o. All rights reserved.
* Copyright (C) 2014-2024 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
Expand All @@ -18,8 +18,11 @@

package com.generalbytes.batm.server.extensions;

import com.generalbytes.batm.server.extensions.quiz.QuizResult;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ITransactionPreparation {
Expand Down Expand Up @@ -201,5 +204,11 @@ public interface ITransactionPreparation {
*/
void setWithdrawalReason(int reason);

/**
* Returns quiz results if any quiz has been activated.
*
* @return List of {@link QuizResult}. Can be null.
*/
List<QuizResult> getQuizResults();

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
************************************************************************************/
package com.generalbytes.batm.server.extensions;

import com.generalbytes.batm.server.extensions.quiz.QuizResult;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface ITransactionRequest {

Expand Down Expand Up @@ -156,8 +159,11 @@ public interface ITransactionRequest {
*/
BigDecimal getDiscountQuotient();




/**
* Returns quiz results if any quiz has been activated.
*
* @return List of {@link QuizResult}. Can be null.
*/
List<QuizResult> getQuizResults();

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.generalbytes.batm.server.extensions.customfields.value.ChoiceCustomFieldValue;
import com.generalbytes.batm.server.extensions.customfields.value.CustomFieldValue;
import com.generalbytes.batm.server.extensions.customfields.value.FileCustomFieldValue;
import com.generalbytes.batm.server.extensions.customfields.value.LocalDateCustomFieldValue;
import com.generalbytes.batm.server.extensions.customfields.value.StringCustomFieldValue;

/**
Expand Down Expand Up @@ -39,7 +40,12 @@ public enum CustomFieldDefinitionType {
/**
* Document scan or other file
*/
DOCUMENT(FileCustomFieldValue.class);
DOCUMENT(FileCustomFieldValue.class),
/**
* A date value.
* Presented as date picker.
*/
DATE(LocalDateCustomFieldValue.class);

private final Class<? extends CustomFieldValue> allowedValueType;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.generalbytes.batm.server.extensions.customfields.value;

import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinitionType;

import java.time.LocalDate;

/**
* used with {@link CustomFieldDefinitionType#DATE}
*/
public class LocalDateCustomFieldValue implements CustomFieldValue {
private final LocalDate localDateValue;

public LocalDateCustomFieldValue(LocalDate localDateValue) {
this.localDateValue = localDateValue;
}

public LocalDate getLocalDateValue() {
return localDateValue;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*************************************************************************************
* Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
* -------------------
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************/
package com.generalbytes.batm.server.extensions.quiz;

import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinition;
import com.generalbytes.batm.server.extensions.customfields.CustomFieldDefinitionType;

/**
* An object representing the question and answer data in the {@link QuizResult}.
*/
public class QuestionAnswer {

/**
* ID of {@link CustomFieldDefinition} representing a question.
* May be null if the Custom Field has been deleted on the server.
*/
private Long customFieldDefinitionId;

private String question;

/**
* ID of {@link CustomFieldDefinition.Element} representing an answer for a type {@link CustomFieldDefinitionType#DROPDOWN} and {@link CustomFieldDefinitionType#RADIO_BTN}.
* May be null if it is not one of the above types or if the Custom Field Element has been deleted on the server.
*/
private Long customFieldElementId;

private String answer;

public QuestionAnswer() {

}

public QuestionAnswer(Long customFieldDefinitionId, String question, Long customFieldElementId, String answer) {
this.customFieldDefinitionId = customFieldDefinitionId;
this.question = question;
this.customFieldElementId = customFieldElementId;
this.answer = answer;
}

public Long getCustomFieldDefinitionId() {
return customFieldDefinitionId;
}

public void setCustomFieldDefinitionId(Long customFieldDefinitionId) {
this.customFieldDefinitionId = customFieldDefinitionId;
}

public String getQuestion() {
return question;
}

public void setQuestion(String question) {
this.question = question;
}

public Long getCustomFieldElementId() {
return customFieldElementId;
}

public void setCustomFieldElementId(Long customFieldElementId) {
this.customFieldElementId = customFieldElementId;
}

public String getAnswer() {
return answer;
}

public void setAnswer(String answer) {
this.answer = answer;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*************************************************************************************
* Copyright (C) 2014-2023 GENERAL BYTES s.r.o. All rights reserved.
*
* This software may be distributed and modified under the terms of the GNU
* General Public License version 2 (GPL2) as published by the Free Software
* Foundation and appearing in the file GPL2.TXT included in the packaging of
* this file. Please note that GPL2 Section 2[b] requires that all works based
* on this software must also be made publicly available under the terms of
* the GPL2 ("Copyleft").
*
* Contact information
* -------------------
*
* GENERAL BYTES s.r.o.
* Web : http://www.generalbytes.com
*
************************************************************************************/
package com.generalbytes.batm.server.extensions.quiz;

import java.util.List;

/**
* An object representing data about quiz result.
*/
public class QuizResult {

private String quizName;

private List<QuestionAnswer> answers;

public QuizResult() {

}

public QuizResult(String quizName, List<QuestionAnswer> answers) {
this.quizName = quizName;
this.answers = answers;
}

public String getQuizName() {
return quizName;
}

public void setQuizName(String quizName) {
this.quizName = quizName;
}

public List<QuestionAnswer> getAnswers() {
return answers;
}

public void setAnswers(List<QuestionAnswer> answers) {
this.answers = answers;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public void isValueTypeAllowed() {
assertFalse(CustomFieldDefinitionType.CHECKBOX.isValueTypeAllowed(str.getClass()));
assertFalse(CustomFieldDefinitionType.IMAGE.isValueTypeAllowed(str.getClass()));
assertFalse(CustomFieldDefinitionType.DOCUMENT.isValueTypeAllowed(str.getClass()));
assertFalse(CustomFieldDefinitionType.DATE.isValueTypeAllowed(str.getClass()));
}
}
Loading