feat: support external CardView submission - #1201
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for external submission of the CardView component in the Adyen React Native SDK. It adds a showSubmitButton configuration option to hide the native submit button, exposes a submit() method via a CardViewHandle ref, and implements the native bridging logic on both Android and iOS. The review feedback highlights two critical issues: a thread-safety concern in Android's CardComponentManager where UI-bound components are interacted with on a background thread instead of the Main thread, and a potential infinite render loop in React Native's CardView due to onReadyChange being used as a dependency in useEffect.
|
@descorp Could you help me with the fork-only Sonar failure? The job never analyzes the PR: the fork run has no |
|
No worries @PrinceD96 , we can ignore Sonar for now. Thank you for such outstanding PR! I will evaluate it thoroughly first thing next week 👌 |
|
Looks like e2e tests are also not fork-friendly.. |
Summary
card.showSubmitButtonfor iOS and Android while preserving the existing defaultCardViewHandle.submit(): voidfor merchant-owned CTAs, matching Adyen Web's imperative submit patternhide(false)Testing
yarn typecheckyarn test --runInBand(27 suites, 272 tests)testDebugUnitTest(96 tests)ktlintApplePayConfiguration.ts(and locally generated Android test reports match its broad glob)No simulator or emulator was used.
Closes #1200