Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically expand bcdc form fields upon selection when gateway is separated #2878

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/ppcp-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions modules/ppcp-button/resources/js/modules/Renderer/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ class Renderer {
};
}

if ( hasEnabledSeparateGateways && options.fundingSource === 'card' ) {
options.expandCardForm = true;
}

return options;
};

Expand Down
2 changes: 1 addition & 1 deletion modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
3 changes: 3 additions & 0 deletions modules/ppcp-button/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = {
path: path.resolve(__dirname, 'assets/'),
filename: 'js/[name].js',
},
watchOptions: {
ignored: /node_modules/
},
module: {
rules: [{
test: /\.js?$/,
Expand Down
8 changes: 4 additions & 4 deletions modules/ppcp-button/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading