Skip to content

Commit

Permalink
Merge pull request #49 from pretix/source_type_for_lists_rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
pc-coholic authored Nov 7, 2024
2 parents c2b8367 + 46c44de commit d4e31ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ open class PretixApi(url: String, key: String, orgaSlug: String, version: Int, h
}

@Throws(ApiException::class, JSONException::class)
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 {
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 {
var dt: String? = null
if (datetime != null) {
dt = QueuedCheckIn.formatDatetime(datetime)
}
return redeem(lists, secret, dt, force, nonce, answers, ignore_unpaid, pdf_data, type, callTimeout, questions_supported)
return redeem(lists, secret, dt, force, nonce, answers, ignore_unpaid, pdf_data, type, source_type, callTimeout, questions_supported)
}

@Throws(ApiException::class, JSONException::class)
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 {
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 {
val body = JSONObject()
if (datetime != null) {
body.put("datetime", datetime)
Expand All @@ -108,6 +108,7 @@ open class PretixApi(url: String, key: String, orgaSlug: String, version: Int, h
body.put("ignore_unpaid", ignore_unpaid)
body.put("nonce", nonce)
body.put("type", type)
body.put("source_type", source_type ?: "barcode")
val answerbody = JSONObject()
if (answers != null) {
for (a in answers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class OnlineCheckProvider(
ignore_unpaid,
with_badge_data,
type.toString().lowercase(Locale.getDefault()),
source_type,
callTimeout = if (fallback != null) fallbackTimeout.toLong() else null,
questions_supported = allowQuestions,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class FakePretixApi : PretixApi("http://1.1.1.1/", "a", "demo", 1, DefaultHttpCl
ignore_unpaid: Boolean,
pdf_data: Boolean,
type: String?,
source_type: String?,
callTimeout: Long?,
questions_supported: Boolean
): ApiResponse {
Expand Down

0 comments on commit d4e31ce

Please sign in to comment.