1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package net.taler.merchantpos.config
import android.util.ArrayMap
import com.android.volley.Response
import com.android.volley.toolbox.JsonObjectRequest
import org.json.JSONObject
class MerchantRequest(
method: Int,
private val merchantConfig: MerchantConfig,
endpoint: String,
params: Map<String, String>?,
jsonRequest: JSONObject?,
listener: Response.Listener<JSONObject>,
errorListener: Response.ErrorListener
) :
JsonObjectRequest(method, merchantConfig.urlFor(endpoint, params), jsonRequest, listener, errorListener) {
override fun getHeaders(): MutableMap<String, String> {
val headerMap = ArrayMap<String, String>()
headerMap["Authorization"] = "ApiKey " + merchantConfig.apiKey
return headerMap
}
}
|