File tree Expand file tree Collapse file tree 2 files changed +2
-25
lines changed
CorePayments/src/main/java/com/paypal/android/corepayments Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ inline fun <reified T : DeepLink> buildDeepLink(
9090 }
9191}
9292
93+ // TODO: see if we can resolve ReturnCount lint error instead of suppressing it
94+ @Suppress(" ReturnCount" )
9395inline fun <reified T : DeepLink > captureDeepLink (
9496 intent : Intent ,
9597 authState : String
Original file line number Diff line number Diff line change 11package com.paypal.android.corepayments.browserswitch
22
3- import android.content.Intent
43import android.util.Base64
54import androidx.annotation.RestrictTo
65import androidx.core.net.toUri
@@ -28,30 +27,6 @@ data class BrowserSwitchPendingState(val originalOptions: BrowserSwitchOptions)
2827 return Base64 .encodeToString(jsonBytes, flags)
2928 }
3029
31- // TODO: consider renaming this method; "match" sounds like it returns a boolean
32- fun match (
33- intent : Intent ,
34- requestCode : Int ,
35- ): BrowserSwitchFinishResult {
36- if (requestCode != originalOptions.requestCode) {
37- return BrowserSwitchFinishResult .RequestCodeDoesNotMatch
38- }
39-
40- val deepLinkUri = intent.data
41- if (deepLinkUri == null ) {
42- return BrowserSwitchFinishResult .DeepLinkNotPresent
43- }
44-
45- val deepLinkScheme = deepLinkUri.scheme.orEmpty()
46- val isMatchingDeepLink =
47- deepLinkScheme.equals(originalOptions.returnUrlScheme, ignoreCase = true )
48- return if (isMatchingDeepLink) {
49- BrowserSwitchFinishResult .Success (deepLinkUri = deepLinkUri)
50- } else {
51- BrowserSwitchFinishResult .DeepLinkDoesNotMatch
52- }
53- }
54-
5530 companion object {
5631 fun fromBase64 (base64EncodedJSON : String ): BrowserSwitchPendingState ? {
5732 val data = Base64 .decode(base64EncodedJSON, Base64 .DEFAULT )
You can’t perform that action at this time.
0 commit comments