Skip to content
Open
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
Expand Up @@ -540,6 +540,7 @@ class AsyncCheckProvider(private val config: ConfigStore, private val dataStore:
type: TicketCheckProvider.CheckInType,
nonce: String?,
allowQuestions: Boolean,
useOrderLocale: Boolean
): TicketCheckProvider.CheckResult {
val ticketid_cleaned = cleanInput(ticketid, source_type)

Expand Down Expand Up @@ -680,6 +681,7 @@ class AsyncCheckProvider(private val config: ConfigStore, private val dataStore:
res.variation = variation.stringValue
}

res.locale = position.getOrder().locale
res.attendee_name = position.attendee_name
res.seat = position.seatName
res.orderCode = position.getOrder().getCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class OnlineCheckProvider(
with_badge_data: Boolean,
type: TicketCheckProvider.CheckInType,
nonce: String?,
allowQuestions: Boolean
allowQuestions: Boolean,
useOrderLocale: Boolean
): TicketCheckProvider.CheckResult {
val ticketid_cleaned = cleanInput(ticketid, source_type)
val nonce_cleaned = nonce ?: NonceGenerator.nextNonce()
Expand Down Expand Up @@ -187,6 +188,9 @@ class OnlineCheckProvider(
}
res.orderCode = posjson.optString("order")
res.positionId = posjson.optLong("positionid")
if (posjson.has("order__locale")) {
res.locale = posjson.getString("order__locale")
}
res.position = posjson
val checkins = posjson.getJSONArray("checkins")
for (i in 0 until checkins.length()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ class ProxyCheckProvider(private val config: ConfigStore, httpClientFactory: Htt
with_badge_data: Boolean,
type: TicketCheckProvider.CheckInType,
nonce: String?,
allowQuestions: Boolean
allowQuestions: Boolean,
useOrderLocale: Boolean
): TicketCheckProvider.CheckResult {
val data: MutableMap<String, Any> = HashMap()
data["events_and_checkin_lists"] = eventsAndCheckinLists
Expand All @@ -115,6 +116,7 @@ class ProxyCheckProvider(private val config: ConfigStore, httpClientFactory: Htt
data["source_type"] = source_type
data["type"] = type
data["allowQuestions"] = allowQuestions
data["useOrderLocale"] = useOrderLocale
if (nonce != null) {
data["nonce"] = nonce
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ interface TicketCheckProvider {
var position: JSONObject? = null
var eventSlug: String? = null
var offline: Boolean = false
var locale: String? = null

constructor(type: Type?, message: String?, offline: Boolean = false) {
this.type = type
Expand Down Expand Up @@ -131,7 +132,7 @@ interface TicketCheckProvider {
class StatusResult(var eventName: String?, var totalTickets: Int, var alreadyScanned: Int, var currentlyInside: Int?, var items: List<StatusResultItem>?) {
}

fun check(eventsAndCheckinLists: Map<String, Long>, ticketid: String, source_type: String, answers: List<Answer>?, ignore_unpaid: Boolean, with_badge_data: Boolean, type: CheckInType, nonce: String? = null, allowQuestions: Boolean = true): CheckResult
fun check(eventsAndCheckinLists: Map<String, Long>, ticketid: String, source_type: String, answers: List<Answer>?, ignore_unpaid: Boolean, with_badge_data: Boolean, type: CheckInType, nonce: String? = null, allowQuestions: Boolean = true, useOrderLocale: Boolean = false): CheckResult
fun check(eventsAndCheckinLists: Map<String, Long>, ticketid: String): CheckResult
@Throws(CheckException::class)
fun search(eventsAndCheckinLists: Map<String, Long>, query: String, page: Int): List<SearchResult>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ public boolean isValidStatus() {
return false;
}

public String getLocale() {
try {
return getJSON().getString("locale");
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}

public String getPaymentProvider() {
try {
return getJSON().getString("payment_provider");
Expand Down