This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Update payment registration config to include edit
components
#1928
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.
This extracts payment method registration configuration changes from #1780.
We won't want to load payment methods fully in the editor context because that will include unnecessary weight for the page when full payment functionality is not required. So payment method registration includes a configuration for
edit
that allows payment methods to registry components that are only loaded in the editor context.This allows for things like:
In this pull I implemented the configuration changes including updating our demos and the the checkout payment method components.
I also included updating the
CheckoutContextProvider
so it receives (and exposes) anisEditor
prop for indicating context in which the checkout is used. This, then will allow any child component to read this value from the checkout context and use it for determining alternative behaviour. In this particular pull, this is used to choose which payment method component is loaded from registered payment method configurations.To test
There is no new user facing functionality in this pull. It is all developer side focused. Testing simply verifies there are no errors when loading the checkout block in the frontend or the backend.