You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #10043 we found out that there was issues when trying to render the Stripe payment elements in the site editor. This is because the site editor is using an iframe to render the preview of the page, this is causing conflicts with the current implementation of stripe elements, causing the components to never load.
As a workaround, we implemented button previews using Google's and Apple's libraries directly instead of relying on Stripe.
However, for the longer term, we'd prefer to use the Stripe library in all places so we don't duplicate the implementation and also to make sure that the previews are 100% equal to the live mode.
The first step to reach the long term solution it is to validate that the following PR fixes the issue of the iframe protocol: WordPress/gutenberg#55152 Since it may take time for this change to be merged, we'll need to setup a local Gutenberg development environment.
The following commands can also be used in the console to see if the Stripe elements render properly within the page (Make sure you are using the editor-canvas console context):
if Stripe is not present you may need to add this action to the backend
add_action(
'enqueue_block_assets',
function () {
wp_enqueue_script( 'stripe' );
}
);
If manually mounting the components work, then we need to figure out what changes are required in the Stripe react library in order to make it work as expected, or estimate the effort required to change the blocks implementation so it uses the regular js library instead.
Acceptance criteria
Define what the next steps will be to be able to use the Stripe elements library in the Site Editor.
Description
In #10043 we found out that there was issues when trying to render the Stripe payment elements in the site editor. This is because the site editor is using an iframe to render the preview of the page, this is causing conflicts with the current implementation of stripe elements, causing the components to never load.
As a workaround, we implemented button previews using Google's and Apple's libraries directly instead of relying on Stripe.
However, for the longer term, we'd prefer to use the Stripe library in all places so we don't duplicate the implementation and also to make sure that the previews are 100% equal to the live mode.
The first step to reach the long term solution it is to validate that the following PR fixes the issue of the iframe protocol: WordPress/gutenberg#55152 Since it may take time for this change to be merged, we'll need to setup a local Gutenberg development environment.
The following commands can also be used in the console to see if the Stripe elements render properly within the page (Make sure you are using the
editor-canvas
console context):if
Stripe
is not present you may need to add this action to the backendIf manually mounting the components work, then we need to figure out what changes are required in the Stripe react library in order to make it work as expected, or estimate the effort required to change the blocks implementation so it uses the regular js library instead.
Acceptance criteria
Testing instructions
git checkout 1dfacfe3d88a7346a951bf35444b5f0a8eff6870
The text was updated successfully, but these errors were encountered: