Skip to content

Commit d4e31ce

Browse files
authored
Merge pull request #49 from pretix/source_type_for_lists_rpc
2 parents c2b8367 + 46c44de commit d4e31ce

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

libpretixsync/src/main/java/eu/pretix/libpretixsync/api/PretixApi.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ open class PretixApi(url: String, key: String, orgaSlug: String, version: Int, h
9090
}
9191

9292
@Throws(ApiException::class, JSONException::class)
93-
fun redeem(lists: List<Long>, secret: String, datetime: Date?, force: Boolean, nonce: String?, answers: List<Answer>?, ignore_unpaid: Boolean, pdf_data: Boolean, type: String?, callTimeout: Long? = null, questions_supported: Boolean = true): ApiResponse {
93+
fun redeem(lists: List<Long>, secret: String, datetime: Date?, force: Boolean, nonce: String?, answers: List<Answer>?, ignore_unpaid: Boolean, pdf_data: Boolean, type: String?, source_type: String?, callTimeout: Long? = null, questions_supported: Boolean = true): ApiResponse {
9494
var dt: String? = null
9595
if (datetime != null) {
9696
dt = QueuedCheckIn.formatDatetime(datetime)
9797
}
98-
return redeem(lists, secret, dt, force, nonce, answers, ignore_unpaid, pdf_data, type, callTimeout, questions_supported)
98+
return redeem(lists, secret, dt, force, nonce, answers, ignore_unpaid, pdf_data, type, source_type, callTimeout, questions_supported)
9999
}
100100

101101
@Throws(ApiException::class, JSONException::class)
102-
open fun redeem(lists: List<Long>, secret: String, datetime: String?, force: Boolean, nonce: String?, answers: List<Answer>?, ignore_unpaid: Boolean, pdf_data: Boolean, type: String?, callTimeout: Long? = null, questions_supported: Boolean = true): ApiResponse {
102+
open fun redeem(lists: List<Long>, secret: String, datetime: String?, force: Boolean, nonce: String?, answers: List<Answer>?, ignore_unpaid: Boolean, pdf_data: Boolean, type: String?, source_type: String?, callTimeout: Long? = null, questions_supported: Boolean = true): ApiResponse {
103103
val body = JSONObject()
104104
if (datetime != null) {
105105
body.put("datetime", datetime)
@@ -108,6 +108,7 @@ open class PretixApi(url: String, key: String, orgaSlug: String, version: Int, h
108108
body.put("ignore_unpaid", ignore_unpaid)
109109
body.put("nonce", nonce)
110110
body.put("type", type)
111+
body.put("source_type", source_type ?: "barcode")
111112
val answerbody = JSONObject()
112113
if (answers != null) {
113114
for (a in answers) {

libpretixsync/src/main/java/eu/pretix/libpretixsync/check/OnlineCheckProvider.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class OnlineCheckProvider(
6969
ignore_unpaid,
7070
with_badge_data,
7171
type.toString().lowercase(Locale.getDefault()),
72+
source_type,
7273
callTimeout = if (fallback != null) fallbackTimeout.toLong() else null,
7374
questions_supported = allowQuestions,
7475
)

libpretixsync/src/testFixtures/java/eu/pretix/pretixscan/scanproxy/tests/test/FakePretixApi.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class FakePretixApi : PretixApi("http://1.1.1.1/", "a", "demo", 1, DefaultHttpCl
4040
ignore_unpaid: Boolean,
4141
pdf_data: Boolean,
4242
type: String?,
43+
source_type: String?,
4344
callTimeout: Long?,
4445
questions_supported: Boolean
4546
): ApiResponse {

0 commit comments

Comments
 (0)