mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Do not add pay later button in editor
This commit is contained in:
parent
db05ae973d
commit
bffcf74c1c
1 changed files with 6 additions and 3 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue