Skip to content
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

Browser Switch Bugfix #281

Merged
merged 15 commits into from
Nov 8, 2024
Merged

Conversation

sshropshire
Copy link
Collaborator

Summary of changes

  • This PR udpates :CardPayments and :PayPalPayments to use the latest version of Browser Switch

Checklist

  • Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

@@ -150,6 +151,10 @@ class CardClient internal constructor(

is CardStatus.ApproveOrderSuccess -> notifyApproveOrderSuccess(status.result)
is CardStatus.ApproveOrderCanceled -> notifyApproveOrderCanceled(status.orderId)
is CardStatus.UnknownError -> {
Log.d("PayPalSDK", "An unknown error occurred: ${status.error.message}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it's unclear which listener should receive this error message.

This should only occur when the authState variable sent to the client is tampered with. Once listeners are removed from the API, this will no longer be an issue.

@@ -98,6 +99,9 @@ class PayPalWebCheckoutClient internal constructor(
is PayPalWebStatus.VaultSuccess -> notifyVaultSuccess(status.result)
is PayPalWebStatus.VaultError -> notifyVaultFailure(status.error)
PayPalWebStatus.VaultCanceled -> notifyVaultCancelation()
is PayPalWebStatus.UnknownError -> {
Log.d("PayPalSDK", "An unknown error occurred: ${status.error.message}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as seen here in CardClient.

@sshropshire sshropshire changed the title Browser Switch Bugfix and Use Weak Refs for Listeners Browser Switch Bugfix Nov 5, 2024
@sshropshire sshropshire marked this pull request as ready for review November 5, 2024 21:34
@sshropshire sshropshire requested a review from a team as a code owner November 5, 2024 21:34
@KunJeongPark
Copy link
Collaborator

Steven, is this the fix for the GitHub inbound #282?

@sshropshire
Copy link
Collaborator Author

It might fix #282 but technically it's unrelated. This PR migrates us to the new browser switch.

@sshropshire sshropshire merged commit dc0e1ef into v2_beta Nov 8, 2024
6 checks passed
@sshropshire sshropshire deleted the v2_beta__browser_switch_enhancements branch November 8, 2024 18:00
sshropshire added a commit that referenced this pull request Nov 19, 2024
* Remove PayPalNativePayments (#275)

* Remove PayPalNativePayments module from project.

* Remove Cardinal from build.gradle.

* Bump to latest version of actions/download-artifact in GitHub Actions workflow.

* Remove native checkout references.

* Remove additional Native XO referenced classes from Demo app.

* Fix lint errors.

* Migrate all GitHub actions to v4.

* Bump gson version.

* Fix versions after rebasing.

* Fix dependency error.

* Fix rebase CHANGELOG merge error.

* Add CHANGELOG update.

* V2 Beta Auth Challenge Migration (#276)

* Migrate CardClient away from observers.

* Remove activity from constructor parameters.

* Update Card and PayPal browser switch flows to include auth challenge types.

* Remove commented code.

* Remove commented code.

* Move CardPresentAuthChallengeResult to its own file.

* Move PayPalPresentAuthChallengeResult into its own file.

* Migrate all activity reference types to ComponentActivity.

* Fix compilation error.

* Modify tests to use new BrowserSwitch methods.

* Fix :Card module unit tests after refactoring.

* Fix PayPalWebCheckoutClient unit tests.

* Update PayPalWeb module unit tests.

* Fix detekt errors.

* Refactor Demo app method naming.

* Update gradle build plugin.

* Fix versions after rebasing.

* Fix detekt version catalog errors.

* Outline table of contents.

* Update migration guide with summary block.

* Update MIGRATION_GUIDE for CardClient.

* Try details region for v2/v1 snippets.

* Update markdown.

* Tweak formatting.

* Tweak formatting again.

* Make diff.

* Implement CardClient migration guide on constructor.

* Update migration guide.

* Try adding collapsable section.

* Add addtional expandable sections.

* Try h5.

* Update styling again.

* Tweak styling agaaain.

* Re-word docs.

* Re-arrange sections.

* Reword migration guide content.

* Update migration guide wording.

* Rephrase card client migration again.

* Lead with code in the migration guide.

* Use diff syntax.

* Add collapsable sections.

* Add collapsable sections.

* Reduce collapsable title verbosity.

* Update migration guide.

* Tweak collapsed layout.

* Simplify collapsed state in migration guide.

* Add approve order details to MIGRATION_GUIDE.

* Clean up migration guide.

* Update docs.

* Adjust comment again.

* Add sample activity callout.{

* Adjust naming.

* Add additional information on the approve order flow.

* Add additional information to migration guide on approve order.

* Rephrase approve order v1 details.

* Add TODO to migration guide.

* Add hyper links to table of contents.

* Update CHANGELOG.

* Browser Switch Bugfix (#281)

* Add browser switch request codes to launcher logic.

* Update Browser switch code.

* Update CardAuthLauncher to use request codes to differentiate browser switch results.

* Add request codes to browser switch requests.

* Fix build error with new CardStatus and PayPalWebStatus.

* Update BOM for Jetpack Compose.

* Update unit tests for CardAuthLauncher to include request code.

* Update unit test for browser switch options.

* Update PayPalWebLauncherUnitTest.

* Implement test for when browser switch fails.

* Add additional tests to PayPalWebLauncherUnitTest.

* Fix detekt lint errors.

* Update CHANGELOG.

* Remove metadata that's no longer needed.

* Remove request type from metadata.

* [V2 Beta] Migration Guide and Card Vault API Cleanup (#290)

* Tweak v2_MIGRATION_GUIDE table of contents.

* Remove redundant word Module in section headings.

* Tweak MIGRATION_GUIDE.

* Update wording.

* Update MIGRATION_GUIDE.

* Add additional comments.

* Update v2_MIGRATION_GUIDE format.

* Tweak migration guide formatting.

* Tweak migration guide.

* Tweak verbosity of migration guide.

* Update migration guide.

* Clean up comments.

* Update details header.

* Remove unecessary punctuation.

* Update title description.

* Rename onAuthorizationRequired to onApproveAuthorizationRequired.

* Update vault card integration.

* Update MIGRATION_GUIDE with latest interface.

* Add remove observers reference to MIGRATION_GUIDE.

* Add vault method reference in MIGRATION_GUIDE and co-locate Android lifecycle methods.

* Update migration guide for PayPal migration.

* Update CHANGELOG.

* Add to migration guide.

* Fix broken unit test.

* Fix lint errors.

* Update migration guide with PayPalWebCheckoutClient details.

* Add emoji to section headers.

* Fix section header font format.

* Fix wording.

* Update CHANGELOG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants