-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PaymentSheet] Fix issue when used with hyperion and mochi #5321
Conversation
…ment is not on the top of the stack.
@@ -20,12 +20,5 @@ | |||
"schema": { | |||
"nameType": "city" | |||
} | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THis is a duplicate field, removing the duplicate
@@ -163,7 +163,12 @@ internal class PaymentSheetActivity : BaseSheetActivity<PaymentSheetResult>() { | |||
if (config != null) { | |||
// We only want to do this if the loading fragment is shown. Otherwise this causes | |||
// a new fragment to be created if the activity was destroyed and recreated. | |||
if (supportFragmentManager.fragments.firstOrNull() is PaymentSheetLoadingFragment) { | |||
// If hyperion is an added dependency it is loaded on top of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix for when hyperion is a dependency
@@ -28,7 +28,7 @@ internal class LpmSerializer { | |||
emptyList() | |||
} else { | |||
try { | |||
format.decodeFromString<List<SharedDataSpec>>(serializer(), str) | |||
format.decodeFromString<ArrayList<SharedDataSpec>>(serializer(), str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArrayList works for finding the deserializer
Diffuse output:
APK
DEX
|
@@ -103,7 +103,10 @@ class LpmRepository constructor( | |||
serverLpmSpecs: String?, | |||
force: Boolean = false | |||
) { | |||
if (!isLoaded() || force) { | |||
// If the expectedLpms is different form last time, we still need to reload. | |||
var lpmsNotParsedFromServerSpec = expectedLpms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get passed two different PMs with different values, we might need to reparse in the library to deserialize the new LPMs that we need.
showOptionalLabel = !addressField.required | ||
val countryAddressElements = this | ||
.filterNot { | ||
it.type == FieldType.SortingCode || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are two new types that are valid, but we don't support showing.
import kotlinx.serialization.json.Json | ||
import java.io.InputStream | ||
import java.util.UUID | ||
|
||
@Serializable(with = FieldTypeAsStringSerializer::class) | ||
@Serializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this so we don't require a special deserializer.
Summary
When hyperion is present PaymentSheetLoading is not at the top of the stack. So instead of checking if it is at the top of the stack, check to see if it is anywhere in the stack.
Motivation
RUN_MOBILESDK-1268
Testing
Changelog
[FIXED] Fixed issue when PaymentSheet never finishes loading.