Skip to content

Commit b5a4fa1

Browse files
authored
Merge branch 'code/cash' into feat/phantom-sdk-migration
2 parents 1a14b2b + a261291 commit b5a4fa1

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/flipcash/shared/onramp/coinbase/src/main/kotlin/com/flipcash/app/onramp/CoinbaseOnRampWebview.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fun CoinbaseOnRampWebview(
4343
url = paymentLinkUrl,
4444
factoryExtension = {
4545
cleanup = configureForCoinbaseOnRamp(
46+
orderId = orderId,
4647
onPaymentSuccess = { onPaymentSuccess(orderId) },
4748
onPaymentFailure = onPaymentFailure,
4849
onCancel = onCancel,
@@ -54,6 +55,7 @@ fun CoinbaseOnRampWebview(
5455

5556
@SuppressLint("SetJavaScriptEnabled")
5657
private fun WebView.configureForCoinbaseOnRamp(
58+
orderId: String,
5759
onPaymentSuccess: () -> Unit,
5860
onPaymentFailure: (CoinbaseOnRampWebError) -> Unit,
5961
onCancel: () -> Unit,
@@ -162,6 +164,7 @@ private fun WebView.configureForCoinbaseOnRamp(
162164
settings.setSupportMultipleWindows(false)
163165

164166
val eventHandler = CoinbaseOnRampEventHandler(
167+
orderId = orderId,
165168
startMark = startMark,
166169
webViewVersion = webViewVersion,
167170
gmsVersion = gmsVersion,

apps/flipcash/shared/onramp/coinbase/src/main/kotlin/com/flipcash/app/onramp/internal/CoinbaseOnRampEventHandler.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ internal object CoinbaseOnRampScripts {
130130
}
131131

132132
internal class CoinbaseOnRampEventHandler(
133+
private val orderId: String,
133134
private val startMark: TimeMark,
134135
private val webViewVersion: String,
135136
private val gmsVersion: String,
@@ -185,6 +186,7 @@ internal class CoinbaseOnRampEventHandler(
185186
error = if (isFirstError) error else null,
186187
type = TraceType.Error,
187188
metadata = {
189+
"orderId" to orderId
188190
"webViewVersion" to webViewVersion
189191
"gmsVersion" to gmsVersion
190192
if (errorCode == CoinbaseOnRampWebError.CODE_GOOGLE_PAY_BUTTON_NOT_FOUND && data != null) {

apps/flipcash/shared/onramp/coinbase/src/test/kotlin/com/flipcash/app/onramp/internal/CoinbaseOnRampEventHandlerTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class CoinbaseOnRampEventHandlerTest {
5050
private var lastError: CoinbaseOnRampWebError? = null
5151

5252
private val handler = CoinbaseOnRampEventHandler(
53+
orderId = "test-order-id",
5354
startMark = TimeSource.Monotonic.markNow(),
5455
webViewVersion = "1.0.0",
5556
gmsVersion = "24.0.0",

0 commit comments

Comments
 (0)