Skip to content

Prototype: Connect support for CheckoutSession#13081

Draft
cttsai-stripe wants to merge 3 commits into
masterfrom
cttsai/checkout-session-connect-prototype
Draft

Prototype: Connect support for CheckoutSession#13081
cttsai-stripe wants to merge 3 commits into
masterfrom
cttsai/checkout-session-connect-prototype

Conversation

@cttsai-stripe
Copy link
Copy Markdown
Contributor

Summary

Prototype verifying that the Android SDK supports all three Connect charge types for CheckoutSession with zero production code changes.

What was tested E2E

Connect Flow How it works SDK changes needed Status
On Behalf Of payment_intent_data.on_behalf_of on session None Verified working
Destination payment_intent_data.transfer_data + application_fee_amount None Verified working
Direct Stripe-Account header on all API calls None (wiring already exists via PaymentConfiguration.stripeAccountId) Verified working

Key finding

The SDK already wires stripeAccount through all CheckoutSession API calls (init, confirm, update) via ApiRequest.Options. The on_behalf_of field is parsed from server_built_elements_session_params and propagated to ElementsSession.onBehalfOf. No production code changes were required.

Changes in this PR (all playground/test only)

  • Playground UI: New "Checkout Connect Mode" dropdown (None / OBO / Destination / Direct), visible when CheckoutSession is selected
  • PlaygroundCheckoutModel.kt: Added transferDataDestination, applicationFeeAmount, stripeAccountId fields to CheckoutRequest
  • PlaygroundRequester.kt: Pass stripeAccountId to PaymentConfiguration.init for direct charges
  • CheckoutSessionRepositoryTest.kt: 3 new tests verifying Stripe-Account header flows through init, confirm, and update API calls
  • CheckoutSessionResponseJsonParserTest.kt: 2 new tests verifying on_behalf_of parsing and ElementsSession.onBehalfOf for Connect OBO

Notes

  • Uses France connected account (acct_1SGP1sPvdtoA7EjP) since the US one (acct_1SG4B2LapbQGsfjG) was deleted
  • Backend changes (playground backend) are on a separate branch
  • The payment_intent_data.transfer_data and application_fee_amount are server-side params not visible in the payment_pages confirm response, but confirmed present on the underlying PaymentIntent via Dashboard

Test plan

  • Unit tests pass (64/64: 6 repository + 58 parser)
  • E2E: OBO flow completes payment successfully
  • E2E: Destination flow completes payment, transfer_data on PI confirmed in Dashboard
  • E2E: Direct flow completes payment on connected account

🤖 Generated with Claude Code

cttsai-stripe and others added 3 commits May 11, 2026 14:30
- Add Connect mode toggle to playground (None / OBO / Destination)
- Add transfer_data_destination and application_fee_amount to CheckoutRequest
- Add tests verifying Stripe-Account header on init, confirm, and update calls
- Add tests verifying on_behalf_of parsing and ElementsSession.onBehalfOf for OBO

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
The US connected account (acct_1SG4B2LapbQGsfjG) was deleted. Use the
France one (acct_1SGP1sPvdtoA7EjP) which is still active under the
platform account.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
- Add DIRECT option to Connect mode toggle
- Add stripeAccountId field to CheckoutRequest for backend
- Pass stripeAccountId to PaymentConfiguration.init for direct charges
  so all SDK API calls include the Stripe-Account header

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Committed-By-Agent: claude
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.

1 participant