Skip to content

Add JetPack Compose To Pay Later Button - #1733

Merged
agedd merged 44 commits into
pay-later-button-featurefrom
add-jetpack-compose-to-pay-later
Nov 3, 2026
Merged

agedd merged 44 commits into
pay-later-button-featurefrom
add-jetpack-compose-to-pay-later

Conversation

@agedd

@agedd agedd commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

  • Add a Compose equivalent of the Pay Later button so Compose merchants don't need a View interop wrapper.
composable-pay-later-demo.webm

AI Usage

Which AI Agent Was Used?

  • Copilot
  • Claude
  • Other (Type Name Here)

How was AI used?
learn compose framework and apply changes in accordance to our other composable buttons, refactoring

Estimated AI Code Contribution

  • less than 30%
  • 30 - 60%
  • 60 - 100%

Checklist

  • [ ] Added a changelog entry
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

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

agedd and others added 20 commits October 13, 2026 12:45
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agedd
agedd requested a review from a team as a code owner October 22, 2026 15:11
@agedd
agedd added this pull request to stack #1724 October 22, 2026 15:11
@saralvasquez

Copy link
Copy Markdown
Contributor

Looks like the linter is mad about something 🙃

agedd and others added 7 commits October 22, 2026 15:36
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
agedd and others added 5 commits October 27, 2026 11:46
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agedd
agedd force-pushed the add-jetpack-compose-to-pay-later branch from 156b932 to ea14496 Compare October 27, 2026 16:46
@noguier

noguier commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

will you be able to add the video of the flow, since I see you added a new fragment to demo?

agedd and others added 5 commits October 28, 2026 14:58
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…edEffect

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agedd

agedd commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

will you be able to add the video of the flow, since I see you added a new fragment to demo?

yes, added a demo video above!

@noguier

noguier commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

hey there please see the video below, I am not able to get the nonce back. Am I testing it wrong?

EDIT: this behavior only happens if i have "do not keep activities" enabled - it is a setting on the physical phone that imitates low memory device. I think we should still fix it however

Screen.Recording.2026-10-29.at.1.26.14.PM.mov

@saralvasquez

Copy link
Copy Markdown
Contributor

I'll definitely leave a more detailed review, but I think upon first look the biggest question I have is similar to the XML version, which is whether some of the duplicate code can be pulled out into a new class since the compose PayPalButton and PayLateButton are so similar

…buttons

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@saralvasquez saralvasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for refactoring all of that! I think this generally looks good, but it looks like there aren't any tests for any of these changes. I know I have a UI test ticket, but could we make sure any functionality needing unit tests is addressed in this PR?

agedd and others added 2 commits November 2, 2026 08:29
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agedd

agedd commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for refactoring all of that! I think this generally looks good, but it looks like there aren't any tests for any of these changes. I know I have a UI test ticket, but could we make sure any functionality needing unit tests is addressed in this PR?

yep good call, addressed this in d87ccf9! the shared flow now lives in an internal PayPalButtonFlow composable. PayPalButtonandPayLaterButton` only provide their button view, request, and analytics.

@agedd

agedd commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

hey there please see the video below, I am not able to get the nonce back. Am I testing it wrong?

EDIT: this behavior only happens if i have "do not keep activities" enabled - it is a setting on the physical phone that imitates low memory device. I think we should still fix it however

Screen.Recording.2026-10-29.at.1.26.14.PM.mov

@noguier thanks for catching this! you weren't testing it wrong, and it also happens on main with the existing XML and Compose PayPal buttons.

i think the cause is when the Activity is destroyed while PayPal is open, browser-switch registers its launcher under a random key, so the result never reaches the rebuilt Activity and the flow is reported as a cancel.

for the fix: XML button in #1748, browser-switch in braintree/browser-switch-android#140. the compose change is ready locally and tested on an emulator, and i'll push it here once browser-switch is released.

if the release takes a while, is it ok to merge this first and add the compose change as a follow-up?

@saralvasquez saralvasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding those tests! Could you do me a favor and send this through one additional pass with Claude to add any missing test coverage for the compose PayPalButton. I realized this branch had some big refactors so I didn't include those tests in my unit test PR, but still wanna make sure there's coverage there. Otherwise this looks great

@saralvasquez

Copy link
Copy Markdown
Contributor

Also since the problem you uncovered with the nonce not getting returned for "do not keep activities" is a pre-existing issue I'd be fine merging this and following up with the fix later

agedd and others added 2 commits November 3, 2026 11:06
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agedd
agedd merged commit 99bdbf6 into pay-later-button-feature Nov 3, 2026
9 checks passed
@agedd
agedd deleted the add-jetpack-compose-to-pay-later branch November 3, 2026 21:35
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.

4 participants