feat: Implement PAY_NL_KAARTDIRECT in CheckoutComponents#1685
Draft
borisprimer wants to merge 2 commits intobn/feature/checkout-componentsfrom
Draft
feat: Implement PAY_NL_KAARTDIRECT in CheckoutComponents#1685borisprimer wants to merge 2 commits intobn/feature/checkout-componentsfrom
borisprimer wants to merge 2 commits intobn/feature/checkout-componentsfrom
Conversation
Contributor
|
Appetize link: https://appetize.io/app/kv43qm4k76oth6drkhoq3hoga4 |
This was referenced Apr 14, 2026
4 tasks
e2faf9c to
c0d7ce4
Compare
borisprimer
added a commit
that referenced
this pull request
Apr 21, 2026
CheckoutComponents test classes write into the global `DIContainer.shared` but do not reset it between tests, so singleton registrations and resolution state leak across tests. Under varying test-run orderings this manifests as `circularDependency`, stale mock call counts, and tests asserting against state left by a previous class. Four recent PRs (#1685, #1686, #1691, #1705) have been flaking on this. Changes: - Add `ContainerTestHelpers.resetSharedContainer()` and call it from `setUp` and `tearDown` of the 12 test files that use `DIContainer.shared`. - Add `ContainerTestHelpers.createSettledCheckoutScope()` — creates a `DefaultCheckoutScope` with a pre-wired test container and returns only after its async init leaves `.initializing`. Use in the three `DefaultPaymentMethodSelectionScope*Tests` classes so downstream `loadPaymentMethods()` no longer waits forever on a scope stuck in `.initializing`. - Fix `test_onDismiss_setsNavigationStateToDismissed` race: build the SUT with `isInitScreenEnabled: false` so the async init task cannot overwrite `.dismissed` with `.loading`; drop the 500 ms sleep and the `|| == .loading` hedge — both `updateState` calls on the dismiss path are synchronous. - Fix `test_deleteVaultedPaymentMethod_whenDeleteThrows_propagatesErrorWithoutRefresh`: capture a post-init baseline of `fetchVaultedPaymentMethodsCallCount` and assert the failed delete did not increment it, instead of asserting the absolute count is zero (the settled scope now legitimately refreshes once during init).
Register Kaartdirect as a WebRedirect payment method. The backend returns NATIVE_SDK implementation type (due to custom drop-in button) but the actual flow is a standard redirect to Pay.nl's hosted page. This mirrors the WEB SDK approach (mergeConfigWithLocalDefinitions) by including NATIVE_SDK redirect types alongside WEB_REDIRECT types during payment method registration.
DefaultCheckoutScope.init calls registerPaymentMethods() which calls reset(), wiping test-registered payment methods. Move .register() calls to after scope creation.
c0d7ce4 to
f29a585
Compare
nquinn-primer
approved these changes
Apr 21, 2026
nquinn-primer
approved these changes
Apr 21, 2026
|
Contributor
Author
|
Converting to draft. Replaced by platform PR https://github.com/primer-io/platform/pull/7250, which adds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
PAY_NL_KAARTDIRECTas a WebRedirect payment method in CheckoutComponentsNATIVE_SDKimplementation type (due to custom drop-in button styling), but the actual flow is a standard redirect to Pay.nl's hosted gift card pagemergeConfigWithLocalDefinitions) by including known NATIVE_SDK redirect types during WebRedirect registrationChanges
payNLKaartdirectcase toPrimerPaymentMethodTypeenum withPAY_NLprovider mappingDefaultCheckoutScope.registerPaymentMethods()MOLLIE_GIFTCARD)UserInterfaceModulefor DropIn supportKaartdirectRegistrationTests(11 tests covering enum, encoding, registration, scope creation)PrimerPaymentMethodTypeImageNameTestsJira
ACC-7015
Test plan