@@ -4,19 +4,14 @@ import android.content.Context
44import android.content.pm.ActivityInfo
55import android.net.Uri
66import androidx.annotation.RestrictTo
7- import com.braintreepayments.api.sharedutils.HttpResponseCallback
87import com.braintreepayments.api.sharedutils.HttpResponseTiming
98import com.braintreepayments.api.sharedutils.ManifestValidator
109import kotlinx.coroutines.CoroutineDispatcher
1110import kotlinx.coroutines.CoroutineScope
1211import kotlinx.coroutines.Dispatchers
1312import kotlinx.coroutines.launch
14- import org.json.JSONException
1513import org.json.JSONObject
1614import java.io.IOException
17- import kotlin.coroutines.resume
18- import kotlin.coroutines.resumeWithException
19- import kotlin.coroutines.suspendCoroutine
2015
2116/* *
2217 * Core Braintree class that handles network requests.
@@ -173,16 +168,7 @@ class BraintreeClient internal constructor(
173168 * @suppress
174169 */
175170 suspend fun sendGraphQLPOST (json : JSONObject ): String {
176- val configuration = suspendCoroutine { continuation ->
177- getConfiguration { config, error ->
178- if (config != null ) {
179- continuation.resume(config)
180- } else {
181- continuation.resumeWithException(error ? : Exception (" Unknown configuration error" ))
182- }
183- }
184- }
185-
171+ val configuration = getConfiguration()
186172 val response = graphQLClient.post(
187173 data = json.toString(),
188174 configuration = configuration,
0 commit comments