Do not add pay later button in editor

This commit is contained in:
Alex P. 2024-09-05 10:45:54 +03:00
parent db05ae973d
commit bffcf74c1c
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -657,7 +657,7 @@ const PayPalComponent = ( {
);
};
const BlockEditorPayPalComponent = () => {
const BlockEditorPayPalComponent = ( fundingSource ) => {
const urlParams = {
clientId: 'test',
...config.scriptData.url_params,
@ -670,6 +670,7 @@ const BlockEditorPayPalComponent = () => {
onClick={ ( data, actions ) => {
return false;
} }
fundingSource={ fundingSource }
/>
</PayPalScriptProvider>
);
@ -758,7 +759,7 @@ if ( block_enabled && config.enabled ) {
name: config.id,
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
content: <PayPalComponent isEditing={ false } />,
edit: <BlockEditorPayPalComponent />,
edit: <BlockEditorPayPalComponent fundingSource={ 'paypal' }/>,
ariaLabel: config.title,
canMakePayment: () => {
return true;
@ -784,7 +785,9 @@ if ( block_enabled && config.enabled ) {
fundingSource={ fundingSource }
/>
),
edit: <BlockEditorPayPalComponent />,
edit: <BlockEditorPayPalComponent
fundingSource={ fundingSource }
/>,
ariaLabel: config.title,
canMakePayment: async () => {
if ( ! paypalScriptPromise ) {