diff --git a/modules/ppcp-button/package.json b/modules/ppcp-button/package.json index a103e0958..d6690efcd 100644 --- a/modules/ppcp-button/package.json +++ b/modules/ppcp-button/package.json @@ -11,7 +11,7 @@ "Edge >= 14" ], "dependencies": { - "@paypal/paypal-js": "^6.0.0", + "@paypal/paypal-js": "^8.1.2", "core-js": "^3.39", "deepmerge": "^4.3", "formdata-polyfill": "^4.0.10" diff --git a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js index 005ee6248..264d2972c 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js @@ -189,6 +189,10 @@ class Renderer { }; } + if ( hasEnabledSeparateGateways && options.fundingSource === 'card' ) { + options.expandCardForm = true; + } + return options; }; diff --git a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php index 868f9bf6c..4daf7a6cf 100644 --- a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php +++ b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php @@ -294,7 +294,7 @@ public function handle_request(): bool { if ( $this->early_validation_enabled && $this->form && 'checkout' === $data['context'] - && in_array( $payment_method, array( PayPalGateway::ID, CardButtonGateway::ID, CreditCardGateway::ID ), true ) + && in_array( $payment_method, array( PayPalGateway::ID, CreditCardGateway::ID ), true ) ) { $this->validate_form( $this->form ); } diff --git a/modules/ppcp-button/webpack.config.js b/modules/ppcp-button/webpack.config.js index 8e02ccaa5..577da2a12 100644 --- a/modules/ppcp-button/webpack.config.js +++ b/modules/ppcp-button/webpack.config.js @@ -14,6 +14,9 @@ module.exports = { path: path.resolve(__dirname, 'assets/'), filename: 'js/[name].js', }, + watchOptions: { + ignored: /node_modules/ + }, module: { rules: [{ test: /\.js?$/, diff --git a/modules/ppcp-button/yarn.lock b/modules/ppcp-button/yarn.lock index d3bd24d66..bfcfbdea0 100644 --- a/modules/ppcp-button/yarn.lock +++ b/modules/ppcp-button/yarn.lock @@ -935,10 +935,10 @@ "@parcel/watcher-win32-ia32" "2.5.0" "@parcel/watcher-win32-x64" "2.5.0" -"@paypal/paypal-js@^6.0.0": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@paypal/paypal-js/-/paypal-js-6.0.1.tgz#5d68d5863a5176383fee9424bc944231668fcffd" - integrity sha512-bvYetmkg2GEC6onsUJQx1E9hdAJWff2bS3IPeiZ9Sh9U7h26/fIgMKm240cq/908sbSoDjHys75XXd8at9OpQA== +"@paypal/paypal-js@^8.1.2": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@paypal/paypal-js/-/paypal-js-8.1.2.tgz#3b6199e1c9e3b2a3e444309e0d0ff63556e3ef86" + integrity sha512-EKshGSWRxLWU1NyPB9P1TiOkPajVmpTo5I9HuZKoSv8y2uk0XIskXqMkAJ/Y9qAg9iJyP102Jb/atX63tTy24w== dependencies: promise-polyfill "^8.3.0"