Skip to content

Conversation

@spencerstock
Copy link
Collaborator

@spencerstock spencerstock commented Nov 13, 2025

What changed? Why?

This PR introduces embedded mode for the SDK and external correlation ID tracking to support payment link features.

External Correlation ID Support

  • Added store for managing external correlation IDs
  • Correlation IDs are appended to popup/iframe URLs for tracking
  • Enables associating SDK requests with external payment links

Embedded Mode with iframe

  • Alternative to popup windows using embedded iframes
  • Full-screen iframe overlay with proper z-index (1000)
  • Smooth fade-in/fade-out transitions for better UX
  • Timeout handling to prevent hanging iframe operations
  • Telemetry events for iframe lifecycle (create, destroy, timeout)

Additional Improvements

  • Test coverage for external correlation ID and embedded mode
  • Logging for iframe operations to aid debugging
  • Proper cleanup on iframe close with fade-out animation

How was this tested?

  • Test coverage for external correlation ID store operations
  • Test coverage for iframe creation and destruction
  • Test coverage for timeout handling in Communicator
  • Test coverage for externalCorrelationId query parameter in URLs
  • All existing tests pass

How can reviewers manually test these changes?

  1. External Correlation ID: Call SDK with an external correlation ID and verify it appears in the popup/iframe URL query parameters
  2. Embedded Mode: Initialize SDK with embedded mode preference and verify iframe is created instead of popup
  3. Timeout Handling: Test iframe timeout scenarios to verify proper error handling and cleanup
  4. Z-index: Verify iframe appears above other page elements

Demo/screenshots

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Nov 13, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

- Add PaymentSDKConfig type for advanced SDK configuration
- Remove redundant walletUrl from PaymentOptions and SubscriptionOptions
- Update pay() and subscribe() to accept sdkConfig parameter
- Update createEphemeralSDK to merge sdkConfig with defaults
- Update executePaymentWithSDK signature to accept sdkConfig
- Add test coverage for sdkConfig parameter
- Fix existing tests to match new function signatures
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