Fix the fundingSource is not defined error on Block Checkout

This commit is contained in:
Daniel Dudzic 2024-04-26 16:55:02 +02:00
parent 92a7747ae0
commit 85d721abdb
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -508,9 +508,7 @@ const PayPalComponent = ({
);
}
const BlockEditorPayPalComponent = ({
fundingSource,
}) => {
const BlockEditorPayPalComponent = () => {
const urlParams = {
clientId: 'test',
@ -523,7 +521,6 @@ const BlockEditorPayPalComponent = ({
options={urlParams}
>
<PayPalButtons
fundingSource={fundingSource}
onClick={(data, actions) => {
return false;
}}
@ -596,7 +593,7 @@ if (block_enabled) {
name: config.id,
label: <div dangerouslySetInnerHTML={{__html: config.title}}/>,
content: <PayPalComponent isEditing={false}/>,
edit: <BlockEditorPayPalComponent fundingSource={fundingSource} />,
edit: <BlockEditorPayPalComponent />,
ariaLabel: config.title,
canMakePayment: () => {
return true;
@ -612,7 +609,7 @@ if (block_enabled) {
paymentMethodId: config.id,
label: <div dangerouslySetInnerHTML={{__html: config.title}}/>,
content: <PayPalComponent isEditing={false} fundingSource={fundingSource}/>,
edit: <BlockEditorPayPalComponent fundingSource={fundingSource} />,
edit: <BlockEditorPayPalComponent />,
ariaLabel: config.title,
canMakePayment: async () => {
if (!paypalScriptPromise) {