From 6875bde9b826bb6f96e91a1552b9390695f9716c Mon Sep 17 00:00:00 2001 From: Sanket Chodavadiya <21277725+SanketChodavadiya@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:01:49 +0530 Subject: [PATCH] Update PayPal integration (#372) * Upgrade PHP CKO SDK to 3.0.20 and update code to use new namespace * WIP: PayPal Integration updates * Update PayPal integration with new method --- assets/js/cko-google-pay-integration.js | 8 +- composer.json | 2 +- composer.lock | 621 ++++++++++++------ .../api/class-wc-checkoutcom-api-request.php | 28 +- includes/api/class-wc-checkoutcom-utility.php | 70 +- ...lass-wc-gateway-checkout-com-apple-pay.php | 1 - .../class-wc-gateway-checkout-com-cards.php | 11 +- .../class-wc-gateway-checkout-com-paypal.php | 405 ++++++++++++ .../class-wc-checkoutcom-cards-settings.php | 26 +- .../class-wc-checkoutcom-subscription.php | 7 +- lib/class-checkout-sdk.php | 7 +- 11 files changed, 946 insertions(+), 240 deletions(-) diff --git a/assets/js/cko-google-pay-integration.js b/assets/js/cko-google-pay-integration.js index f2506215..adab51ef 100644 --- a/assets/js/cko-google-pay-integration.js +++ b/assets/js/cko-google-pay-integration.js @@ -21,14 +21,20 @@ jQuery( function ( $ ) { if ( jQuery( this ).val() === DOMStrings.paymentMethodName ) { // Google Pay selected. jQuery( '#ckocom_googlePay' ).show(); + jQuery( '#paypal-button-container' ).hide(); jQuery( DOMStrings.placeOrder ).hide() jQuery( '#place_order' ).prop( "disabled", true ); } else if ( 'wc_checkout_com_apple_pay' === this.value ) { + jQuery( '#paypal-button-container' ).hide(); jQuery( '#ckocom_googlePay' ).hide(); jQuery( "#place_order" ).hide(); - } else { + } else if ( 'wc_checkout_com_paypal' === this.value ) { + jQuery( '#ckocom_googlePay' ).hide(); + jQuery( '#ckocom_applePay' ).hide(); + jQuery( "#place_order" ).hide(); + } else { jQuery( '#ckocom_googlePay' ).hide(); jQuery( '#place_order' ).prop( "disabled", false ); diff --git a/composer.json b/composer.json index a9015740..b8c32bdd 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ }, "require": { "php": ">=7.3", - "checkout/checkout-sdk-php": "3.0.20" + "checkout/checkout-sdk-php": "3.0.*" }, "require-dev": { "squizlabs/php_codesniffer": "^3.6", diff --git a/composer.lock b/composer.lock index 54f95f6c..f406105f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e4f110562364d68b5e7b4c31c6293758", + "content-hash": "ee281303a843c6827d22a1909e823d8d", "packages": [ { "name": "checkout/checkout-sdk-php", - "version": "3.0.20", + "version": "3.0.21", "source": { "type": "git", "url": "https://github.com/checkout/checkout-sdk-php.git", - "reference": "4310ef994a663b925d1209f8c579f0965f5e14f8" + "reference": "0195aa0153b79b3f8350509e54a5654e57f62bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/4310ef994a663b925d1209f8c579f0965f5e14f8", - "reference": "4310ef994a663b925d1209f8c579f0965f5e14f8", + "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/0195aa0153b79b3f8350509e54a5654e57f62bd3", + "reference": "0195aa0153b79b3f8350509e54a5654e57f62bd3", "shasum": "" }, "require": { @@ -70,9 +70,9 @@ ], "support": { "issues": "https://github.com/checkout/checkout-sdk-php/issues", - "source": "https://github.com/checkout/checkout-sdk-php/tree/3.0.20" + "source": "https://github.com/checkout/checkout-sdk-php/tree/3.0.21" }, - "time": "2024-01-10T13:50:01+00:00" + "time": "2024-02-08T17:30:23+00:00" }, { "name": "guzzlehttp/guzzle", @@ -879,16 +879,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.4.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "b66d11b7479109ab547f9405b97205640b17d385" + "reference": "18fc0ab083a48f85bfee31f3786537353b8a8403" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b66d11b7479109ab547f9405b97205640b17d385", - "reference": "b66d11b7479109ab547f9405b97205640b17d385", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/18fc0ab083a48f85bfee31f3786537353b8a8403", + "reference": "18fc0ab083a48f85bfee31f3786537353b8a8403", "shasum": "" }, "require": { @@ -935,7 +935,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.4.0" + "source": "https://github.com/composer/ca-bundle/tree/1.4.2" }, "funding": [ { @@ -951,43 +951,125 @@ "type": "tidelift" } ], - "time": "2023-12-18T12:05:55+00:00" + "time": "2024-03-14T13:20:33+00:00" + }, + { + "name": "composer/class-map-generator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/class-map-generator.git", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", + "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", + "shasum": "" + }, + "require": { + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/filesystem": "^5.4 || ^6", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\ClassMapGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-06-30T13:58:57+00:00" }, { "name": "composer/composer", - "version": "2.2.22", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "fedc76ee3f3e3d57d20993b9f4c5fcfb2f8596aa" + "reference": "b826edb791571ab1eaf281eb1bd6e181a1192adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/fedc76ee3f3e3d57d20993b9f4c5fcfb2f8596aa", - "reference": "fedc76ee3f3e3d57d20993b9f4c5fcfb2f8596aa", + "url": "https://api.github.com/repos/composer/composer/zipball/b826edb791571ab1eaf281eb1bd6e181a1192adc", + "reference": "b826edb791571ab1eaf281eb1bd6e181a1192adc", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", + "composer/class-map-generator": "^1.0", "composer/metadata-minifier": "^1.0", - "composer/pcre": "^1.0", - "composer/semver": "^3.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^2.0 || ^3.0", + "composer/pcre": "^2.1 || ^3.1", + "composer/semver": "^3.2.5", + "composer/spdx-licenses": "^1.5.7", + "composer/xdebug-handler": "^2.0.2 || ^3.0.3", "justinrainbow/json-schema": "^5.2.11", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0 || ^2.0", - "react/promise": "^1.2 || ^2.7", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "react/promise": "^2.8 || ^3", "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", - "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + "seld/phar-utils": "^1.2", + "seld/signal-handler": "^2.0", + "symfony/console": "^5.4.11 || ^6.0.11 || ^7", + "symfony/filesystem": "^5.4 || ^6.0 || ^7", + "symfony/finder": "^5.4 || ^6.0 || ^7", + "symfony/polyfill-php73": "^1.24", + "symfony/polyfill-php80": "^1.24", + "symfony/polyfill-php81": "^1.24", + "symfony/process": "^5.4 || ^6.0 || ^7" }, "require-dev": { - "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + "phpstan/phpstan": "^1.9.3", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1", + "phpstan/phpstan-symfony": "^1.2.10", + "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -1000,12 +1082,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.2-dev" + "dev-main": "2.7-dev" + }, + "phpstan": { + "includes": [ + "phpstan/rules.neon" + ] } }, "autoload": { "psr-4": { - "Composer\\": "src/Composer" + "Composer\\": "src/Composer/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1034,7 +1121,8 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.2.22" + "security": "https://github.com/composer/composer/security/policy", + "source": "https://github.com/composer/composer/tree/2.7.2" }, "funding": [ { @@ -1050,7 +1138,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T08:53:46+00:00" + "time": "2024-03-11T16:12:18+00:00" }, { "name": "composer/metadata-minifier", @@ -1123,30 +1211,30 @@ }, { "name": "composer/pcre", - "version": "1.0.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "02b8774a434b1b71edd8824440ceac1e3e49ee2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/composer/pcre/zipball/02b8774a434b1b71edd8824440ceac1e3e49ee2b", + "reference": "02b8774a434b1b71edd8824440ceac1e3e49ee2b", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "2.x-dev" } }, "autoload": { @@ -1174,7 +1262,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/2.1.2" }, "funding": [ { @@ -1190,7 +1278,7 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2024-03-07T14:52:56+00:00" }, { "name": "composer/semver", @@ -1779,16 +1867,16 @@ }, { "name": "mck89/peast", - "version": "v1.16.0", + "version": "v1.16.2", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", - "reference": "63dee902bd281c792f1dd760b6df268682032ed0" + "reference": "2791b08ffcc1862fe18eef85675da3aa58c406fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/63dee902bd281c792f1dd760b6df268682032ed0", - "reference": "63dee902bd281c792f1dd760b6df268682032ed0", + "url": "https://api.github.com/repos/mck89/peast/zipball/2791b08ffcc1862fe18eef85675da3aa58c406fe", + "reference": "2791b08ffcc1862fe18eef85675da3aa58c406fe", "shasum": "" }, "require": { @@ -1801,7 +1889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16.0-dev" + "dev-master": "1.16.2-dev" } }, "autoload": { @@ -1822,9 +1910,9 @@ "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.16.0" + "source": "https://github.com/mck89/peast/tree/v1.16.2" }, - "time": "2024-01-11T14:36:12+00:00" + "time": "2024-03-05T09:16:03+00:00" }, { "name": "mustache/mustache", @@ -2033,23 +2121,24 @@ }, { "name": "react/promise", - "version": "v2.11.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831" + "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/1a8460931ea36dc5c76838fec5734d55c88c6831", - "reference": "1a8460931ea36dc5c76838fec5734d55c88c6831", + "url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", + "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", "autoload": { @@ -2093,7 +2182,7 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.11.0" + "source": "https://github.com/reactphp/promise/tree/v3.1.0" }, "funding": [ { @@ -2101,20 +2190,20 @@ "type": "open_collective" } ], - "time": "2023-11-16T16:16:50+00:00" + "time": "2023-11-16T16:21:57+00:00" }, { "name": "seld/jsonlint", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "76d449a358ece77d6f1d6331c68453e657172202" + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/76d449a358ece77d6f1d6331c68453e657172202", - "reference": "76d449a358ece77d6f1d6331c68453e657172202", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", "shasum": "" }, "require": { @@ -2153,7 +2242,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.1" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" }, "funding": [ { @@ -2165,7 +2254,7 @@ "type": "tidelift" } ], - "time": "2023-12-18T13:03:25+00:00" + "time": "2024-02-07T12:57:50+00:00" }, { "name": "seld/phar-utils", @@ -2215,6 +2304,67 @@ }, "time": "2022-08-31T10:31:18+00:00" }, + { + "name": "seld/signal-handler", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/signal-handler.git", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", + "psr/log": "^1 || ^2 || ^3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\Signal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", + "keywords": [ + "posix", + "sigint", + "signal", + "sigterm", + "unix" + ], + "support": { + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" + }, + "time": "2023-09-03T09:24:00+00:00" + }, { "name": "sirbrillig/phpcs-variable-analysis", "version": "v2.11.17", @@ -2275,16 +2425,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.1", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", - "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -2351,20 +2501,20 @@ "type": "open_collective" } ], - "time": "2024-01-11T20:47:48+00:00" + "time": "2024-02-16T15:06:51+00:00" }, { "name": "symfony/console", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931" + "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dbdf6adcb88d5f83790e1efb57ef4074309d3931", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931", + "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", + "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", "shasum": "" }, "require": { @@ -2434,7 +2584,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.35" + "source": "https://github.com/symfony/console/tree/v5.4.36" }, "funding": [ { @@ -2450,7 +2600,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:28:09+00:00" + "time": "2024-02-20T16:33:57+00:00" }, { "name": "symfony/filesystem", @@ -2581,16 +2731,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -2604,9 +2754,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2643,7 +2790,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -2659,20 +2806,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -2683,9 +2830,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2724,7 +2868,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -2740,20 +2884,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -2764,9 +2908,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2808,7 +2949,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -2824,20 +2965,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -2851,9 +2992,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2891,7 +3029,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -2907,20 +3045,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", "shasum": "" }, "require": { @@ -2928,9 +3066,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2970,7 +3105,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" }, "funding": [ { @@ -2986,20 +3121,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -3007,9 +3142,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3053,7 +3185,83 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -3069,20 +3277,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "cbc28e34015ad50166fc2f9c8962d28d0fe861eb" + "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cbc28e34015ad50166fc2f9c8962d28d0fe861eb", - "reference": "cbc28e34015ad50166fc2f9c8962d28d0fe861eb", + "url": "https://api.github.com/repos/symfony/process/zipball/4fdf34004f149cc20b2f51d7d119aa500caad975", + "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975", "shasum": "" }, "require": { @@ -3115,7 +3323,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.35" + "source": "https://github.com/symfony/process/tree/v5.4.36" }, "funding": [ { @@ -3131,7 +3339,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-12T15:49:53+00:00" }, { "name": "symfony/service-contracts", @@ -3218,16 +3426,16 @@ }, { "name": "symfony/string", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2" + "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c209c4d0559acce1c9a2067612cfb5d35756edc2", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2", + "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b", + "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b", "shasum": "" }, "require": { @@ -3284,7 +3492,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.35" + "source": "https://github.com/symfony/string/tree/v5.4.36" }, "funding": [ { @@ -3300,20 +3508,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-01T08:49:30+00:00" }, { "name": "wp-cli/cache-command", - "version": "v2.1.1", + "version": "v2.1.2", "source": { "type": "git", "url": "https://github.com/wp-cli/cache-command.git", - "reference": "5a74fa042ecaeff93f149b08a279730c69b1b448" + "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/5a74fa042ecaeff93f149b08a279730c69b1b448", - "reference": "5a74fa042ecaeff93f149b08a279730c69b1b448", + "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/205c004ce6127c605e4a71840a6f0b5be72b0517", + "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517", "shasum": "" }, "require": { @@ -3373,9 +3581,9 @@ "homepage": "https://github.com/wp-cli/cache-command", "support": { "issues": "https://github.com/wp-cli/cache-command/issues", - "source": "https://github.com/wp-cli/cache-command/tree/v2.1.1" + "source": "https://github.com/wp-cli/cache-command/tree/v2.1.2" }, - "time": "2023-08-30T14:34:01+00:00" + "time": "2024-01-11T14:00:20+00:00" }, { "name": "wp-cli/checksum-command", @@ -3512,16 +3720,16 @@ }, { "name": "wp-cli/core-command", - "version": "v2.1.16", + "version": "v2.1.17", "source": { "type": "git", "url": "https://github.com/wp-cli/core-command.git", - "reference": "9d6ebb4545df0b8bc7e688a49910ddcdd86dbe93" + "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/core-command/zipball/9d6ebb4545df0b8bc7e688a49910ddcdd86dbe93", - "reference": "9d6ebb4545df0b8bc7e688a49910ddcdd86dbe93", + "url": "https://api.github.com/repos/wp-cli/core-command/zipball/dcac4c36a3c596f1c81779bdbaa0c5f508f14075", + "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075", "shasum": "" }, "require": { @@ -3577,9 +3785,9 @@ "homepage": "https://github.com/wp-cli/core-command", "support": { "issues": "https://github.com/wp-cli/core-command/issues", - "source": "https://github.com/wp-cli/core-command/tree/v2.1.16" + "source": "https://github.com/wp-cli/core-command/tree/v2.1.17" }, - "time": "2023-11-10T23:54:33+00:00" + "time": "2024-01-11T11:03:57+00:00" }, { "name": "wp-cli/cron-command", @@ -3793,20 +4001,20 @@ }, { "name": "wp-cli/entity-command", - "version": "v2.5.6", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/wp-cli/entity-command.git", - "reference": "45d4f3a77b7977fee4b4f7e183e692ab84bf7dd8" + "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/45d4f3a77b7977fee4b4f7e183e692ab84bf7dd8", - "reference": "45d4f3a77b7977fee4b4f7e183e692ab84bf7dd8", + "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", + "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.5" + "wp-cli/wp-cli": "^2.10" }, "require-dev": { "wp-cli/cache-command": "^1 || ^2", @@ -3879,6 +4087,8 @@ "option patch", "option pluck", "option update", + "option set-autoload", + "option get-autoload", "post", "post create", "post delete", @@ -3902,6 +4112,7 @@ "post term remove", "post term set", "post update", + "post url-to-id", "post-type", "post-type get", "post-type list", @@ -3998,9 +4209,9 @@ "homepage": "https://github.com/wp-cli/entity-command", "support": { "issues": "https://github.com/wp-cli/entity-command/issues", - "source": "https://github.com/wp-cli/entity-command/tree/v2.5.6" + "source": "https://github.com/wp-cli/entity-command/tree/v2.6.2" }, - "time": "2023-10-13T13:38:49+00:00" + "time": "2024-02-06T13:38:03+00:00" }, { "name": "wp-cli/eval-command", @@ -4125,21 +4336,21 @@ }, { "name": "wp-cli/extension-command", - "version": "v2.1.17", + "version": "v2.1.19", "source": { "type": "git", "url": "https://github.com/wp-cli/extension-command.git", - "reference": "955bd947d95ef91da501179c7e561d229ab3cc19" + "reference": "80713703e090fbc74926af6f75bf963619f76fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/955bd947d95ef91da501179c7e561d229ab3cc19", - "reference": "955bd947d95ef91da501179c7e561d229ab3cc19", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/80713703e090fbc74926af6f75bf963619f76fdb", + "reference": "80713703e090fbc74926af6f75bf963619f76fdb", "shasum": "" }, "require": { "composer/semver": "^1.4 || ^2 || ^3", - "wp-cli/wp-cli": "^2.5.1" + "wp-cli/wp-cli": "^2.10" }, "require-dev": { "wp-cli/cache-command": "^2.0", @@ -4217,22 +4428,22 @@ "homepage": "https://github.com/wp-cli/extension-command", "support": { "issues": "https://github.com/wp-cli/extension-command/issues", - "source": "https://github.com/wp-cli/extension-command/tree/v2.1.17" + "source": "https://github.com/wp-cli/extension-command/tree/v2.1.19" }, - "time": "2024-01-11T11:03:21+00:00" + "time": "2024-02-05T14:53:09+00:00" }, { "name": "wp-cli/i18n-command", - "version": "v2.5.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "9cf9b40f6bad64ade8660cc26bf1f28f2d223268" + "reference": "7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/9cf9b40f6bad64ade8660cc26bf1f28f2d223268", - "reference": "9cf9b40f6bad64ade8660cc26bf1f28f2d223268", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1", + "reference": "7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1", "shasum": "" }, "require": { @@ -4260,6 +4471,7 @@ "i18n make-pot", "i18n make-json", "i18n make-mo", + "i18n make-php", "i18n update-po" ] }, @@ -4285,9 +4497,9 @@ "homepage": "https://github.com/wp-cli/i18n-command", "support": { "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/v2.5.0" + "source": "https://github.com/wp-cli/i18n-command/tree/2.6.1" }, - "time": "2023-11-16T17:09:37+00:00" + "time": "2024-02-28T11:27:34+00:00" }, { "name": "wp-cli/import-command", @@ -4351,16 +4563,16 @@ }, { "name": "wp-cli/language-command", - "version": "v2.0.18", + "version": "v2.0.19", "source": { "type": "git", "url": "https://github.com/wp-cli/language-command.git", - "reference": "24f76e35f477887d09f1fd40a60d9011a6da18bf" + "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/language-command/zipball/24f76e35f477887d09f1fd40a60d9011a6da18bf", - "reference": "24f76e35f477887d09f1fd40a60d9011a6da18bf", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/4d0a2e58f8c48772e0a85a3b25f413ef240c212a", + "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a", "shasum": "" }, "require": { @@ -4424,9 +4636,9 @@ "homepage": "https://github.com/wp-cli/language-command", "support": { "issues": "https://github.com/wp-cli/language-command/issues", - "source": "https://github.com/wp-cli/language-command/tree/v2.0.18" + "source": "https://github.com/wp-cli/language-command/tree/v2.0.19" }, - "time": "2023-11-10T13:27:16+00:00" + "time": "2024-02-01T14:28:11+00:00" }, { "name": "wp-cli/maintenance-mode-command", @@ -4925,16 +5137,16 @@ }, { "name": "wp-cli/search-replace-command", - "version": "v2.1.4", + "version": "v2.1.5", "source": { "type": "git", "url": "https://github.com/wp-cli/search-replace-command.git", - "reference": "88c9f23eda4eff4803a3eeeabd46d1a99cd17340" + "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/88c9f23eda4eff4803a3eeeabd46d1a99cd17340", - "reference": "88c9f23eda4eff4803a3eeeabd46d1a99cd17340", + "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/f6c828abc6d5054d5bbf202b917d2a3b38abed84", + "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84", "shasum": "" }, "require": { @@ -4979,9 +5191,9 @@ "homepage": "https://github.com/wp-cli/search-replace-command", "support": { "issues": "https://github.com/wp-cli/search-replace-command/issues", - "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.4" + "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.5" }, - "time": "2023-12-19T12:41:53+00:00" + "time": "2024-01-09T00:29:39+00:00" }, { "name": "wp-cli/server-command", @@ -5100,16 +5312,16 @@ }, { "name": "wp-cli/super-admin-command", - "version": "v2.0.12", + "version": "v2.0.13", "source": { "type": "git", "url": "https://github.com/wp-cli/super-admin-command.git", - "reference": "9a1932d8f19a1464d27cb1b08fa21aa62d349e0b" + "reference": "9d91c131ad814f9bcec313c3877e8348622720d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/9a1932d8f19a1464d27cb1b08fa21aa62d349e0b", - "reference": "9a1932d8f19a1464d27cb1b08fa21aa62d349e0b", + "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/9d91c131ad814f9bcec313c3877e8348622720d5", + "reference": "9d91c131ad814f9bcec313c3877e8348622720d5", "shasum": "" }, "require": { @@ -5155,9 +5367,9 @@ "homepage": "https://github.com/wp-cli/super-admin-command", "support": { "issues": "https://github.com/wp-cli/super-admin-command/issues", - "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.12" + "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.13" }, - "time": "2023-08-30T14:46:22+00:00" + "time": "2024-01-08T12:21:39+00:00" }, { "name": "wp-cli/widget-command", @@ -5228,16 +5440,16 @@ }, { "name": "wp-cli/wp-cli", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "8a3befba2d947fbf5cc6d1941edf2dd99da4d4b7" + "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/8a3befba2d947fbf5cc6d1941edf2dd99da4d4b7", - "reference": "8a3befba2d947fbf5cc6d1941edf2dd99da4d4b7", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/a339dca576df73c31af4b4d8054efc2dab9a0685", + "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685", "shasum": "" }, "require": { @@ -5267,7 +5479,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.9.x-dev" + "dev-main": "2.10.x-dev" } }, "autoload": { @@ -5294,24 +5506,23 @@ "issues": "https://github.com/wp-cli/wp-cli/issues", "source": "https://github.com/wp-cli/wp-cli" }, - "time": "2023-10-25T09:06:37+00:00" + "time": "2024-02-08T16:52:43+00:00" }, { "name": "wp-cli/wp-cli-bundle", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli-bundle.git", - "reference": "3512737e69e55507172e8dce400e09231ba95919" + "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli-bundle/zipball/3512737e69e55507172e8dce400e09231ba95919", - "reference": "3512737e69e55507172e8dce400e09231ba95919", + "url": "https://api.github.com/repos/wp-cli/wp-cli-bundle/zipball/b795ca19f12bf9605dc8d85235d55a721b43064c", + "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c", "shasum": "" }, "require": { - "composer/composer": "^1.10.23 || ~2.2.17", "php": ">=5.6", "wp-cli/cache-command": "^2", "wp-cli/checksum-command": "^2.1", @@ -5338,7 +5549,7 @@ "wp-cli/shell-command": "^2", "wp-cli/super-admin-command": "^2", "wp-cli/widget-command": "^2", - "wp-cli/wp-cli": "^2.9.0" + "wp-cli/wp-cli": "^2.10.0" }, "require-dev": { "roave/security-advisories": "dev-latest", @@ -5368,7 +5579,7 @@ "issues": "https://github.com/wp-cli/wp-cli-bundle/issues", "source": "https://github.com/wp-cli/wp-cli-bundle" }, - "time": "2023-10-25T09:28:58+00:00" + "time": "2024-02-08T17:05:33+00:00" }, { "name": "wp-cli/wp-config-transformer", diff --git a/includes/api/class-wc-checkoutcom-api-request.php b/includes/api/class-wc-checkoutcom-api-request.php index 06c4aec4..ddbf4a31 100644 --- a/includes/api/class-wc-checkoutcom-api-request.php +++ b/includes/api/class-wc-checkoutcom-api-request.php @@ -13,7 +13,6 @@ use Checkout\Common\CustomerRequest; use Checkout\Payments\Product; use Checkout\Payments\BillingDescriptor; -//use Checkout\Payments\PaymentRequest; use Checkout\Payments\PaymentType; use Checkout\Payments\PreferredSchema; use Checkout\Payments\ProcessingSettings; @@ -65,11 +64,13 @@ public static function create_payment( WC_Order $order, $arg, $subscription = nu $checkout = new Checkout_SDK(); try { + $three_ds_action_id = ( ! empty( WC()->session ) ) ? WC()->session->get( '3ds_action_id' ) : null; + $cko_idempotency_key = sprintf( '%s-%s-%s', $request_param->metadata['order_id'], $order->get_order_key(), - WC()->session->get( '3ds_action_id' ) + $three_ds_action_id ); // Append time. @@ -304,7 +305,7 @@ private static function get_request_param( WC_Order $order, $arg, $subscription // Check for the subscription flag. if ( ! is_null( $subscription ) ) { $payment->merchant_initiated = true; - $payment->payment_type = 'Recurring'; + $payment->payment_type = PaymentType::$recurring; $payment->capture = true; if ( 'wc_checkout_com_alternative_payments_sepa' !== $order->get_payment_method() ) { @@ -314,7 +315,7 @@ private static function get_request_param( WC_Order $order, $arg, $subscription } elseif ( function_exists( 'wcs_order_contains_subscription' ) ) { if ( wcs_order_contains_subscription( $order, 'parent' ) ) { $payment->merchant_initiated = false; - $payment->payment_type = 'Recurring'; + $payment->payment_type = PaymentType::$recurring; // For PayPal subscription order. if ( 'paypal' === $method->type ) { @@ -677,7 +678,8 @@ public static function generate_google_token() { /** * Perform capture. - * @param int $order_id + * + * @param int $order_id Order ID. * * @return array|mixed */ @@ -705,7 +707,7 @@ public static function capture_payment( $order_id ) { if ( 'Voided' === $details['status'] || 'Captured' === $details['status'] ) { $error_message = sprintf( - /* translators: 1: Order ID. */ + /* translators: 1: Order ID. */ esc_html__( 'Payment has already been voided or captured on Checkout.com hub for order Id : %s', 'checkout-com-unified-payments-api' ), $order_id ); @@ -722,7 +724,7 @@ public static function capture_payment( $order_id ) { if ( ! WC_Checkoutcom_Utility::is_successful( $response ) ) { $error_message = sprintf( - /* translators: 1: Order ID. */ + /* translators: 1: Order ID. */ esc_html__( 'An error has occurred while processing your capture payment on Checkout.com hub. Order Id : %s', 'checkout-com-unified-payments-api' ), $order_id ); @@ -754,7 +756,8 @@ public static function capture_payment( $order_id ) { /** * Perform Void. - * @param int $order_id + * + * @param int $order_id Order ID. * * @return array|mixed */ @@ -780,7 +783,7 @@ public static function void_payment( $order_id ) { if ( 'Voided' === $details['status'] || 'Captured' === $details['status'] ) { $error_message = sprintf( - /* translators: 1: Order ID. */ + /* translators: 1: Order ID. */ esc_html__( 'Payment has already been voided or captured on Checkout.com hub for order Id : %s', 'checkout-com-unified-payments-api' ), $order_id ); @@ -797,7 +800,7 @@ public static function void_payment( $order_id ) { if ( ! WC_Checkoutcom_Utility::is_successful( $response ) ) { $error_message = sprintf( - /* translators: 1: Order ID. */ + /* translators: 1: Order ID. */ esc_html__( 'An error has occurred while processing your void payment on Checkout.com hub. Order Id : %s', 'checkout-com-unified-payments-api' ), $order_id ); @@ -886,7 +889,7 @@ public static function refund_payment( $order_id, $order ) { // Handle Retry with fallback account. $checkout = new Checkout_SDK( true ); - $details = $checkout->get_builder()->getPaymentsClient()->getPaymentDetails( $cko_payment_id ); + $details = $checkout->get_builder()->getPaymentsClient()->getPaymentDetails( $cko_payment_id ); if ( 'Refunded' === $details['status'] && ! $refund_is_less ) { $error_message = 'Payment has already been refunded on Checkout.com hub for order Id : ' . $order_id; @@ -923,7 +926,6 @@ public static function refund_payment( $order_id, $order ) { } else { return $response; } - } if ( 'Refunded' === $details['status'] && ! $refund_is_less ) { @@ -1543,4 +1545,4 @@ public static function is_url_response_ok( $url ) { return ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ); } -} +} \ No newline at end of file diff --git a/includes/api/class-wc-checkoutcom-utility.php b/includes/api/class-wc-checkoutcom-utility.php index 91bfcf69..6ccfdf38 100644 --- a/includes/api/class-wc-checkoutcom-utility.php +++ b/includes/api/class-wc-checkoutcom-utility.php @@ -191,7 +191,7 @@ public static function wc_add_notice_self( $message, $status = 'error' ) { * @param string $error_message Error message to log. * @param Exception $exception Exception object. */ - public static function logger( $error_message, $exception ) { + public static function logger( $error_message, $exception = null ) { $logger = wc_get_logger(); $context = [ 'source' => 'wc_checkoutcom_gateway_log' ]; @@ -433,4 +433,72 @@ public static function is_approved( $data ) { return $approved; } + + /** + * Set WC session value by key. + * + * @param string $key Session key. + * @param string $value Session value. + * + * @return false|void + */ + public static function cko_set_session( $key, $value ) { + if ( ! class_exists( 'WooCommerce' ) || null == WC()->session ) { + return false; + } + + $cko_session = WC()->session->get( 'cko_session' ); + + if ( ! is_array( $cko_session ) ) { + $cko_session = []; + } + + $cko_session[ $key ] = $value; + + WC()->session->set( 'cko_session', $cko_session ); + } + + /** + * Get WC session value by key. + * + * @param string $key Session key. + * + * @return false|mixed + */ + public static function cko_get_session( $key ) { + if ( ! class_exists( 'WooCommerce' ) || null == WC()->session ) { + return false; + } + + $cko_session = WC()->session->get( 'cko_session' ); + + if ( ! empty( $cko_session[ $key ] ) ) { + return $cko_session[ $key ]; + } + + return false; + } + + /** + * Check if cart has subscription item. + * + * @return bool + */ + public static function is_cart_contains_subscription() { + $cart = WC()->cart; + + if ( $cart->is_empty() ) { + return false; + } + + foreach ( $cart->get_cart() as $cart_item_key => $cart_item ) { + $product = $cart_item['data']; + + if ( $product->is_type( 'subscription' ) ) { + return true; + } + } + + return false; + } } diff --git a/includes/class-wc-gateway-checkout-com-apple-pay.php b/includes/class-wc-gateway-checkout-com-apple-pay.php index e3589950..c17cadd5 100644 --- a/includes/class-wc-gateway-checkout-com-apple-pay.php +++ b/includes/class-wc-gateway-checkout-com-apple-pay.php @@ -248,7 +248,6 @@ function handleApplePayEvents(session) { if (outcome) { document.getElementById('cko-apple-card-token').value = outcome; status = ApplePaySession.STATUS_SUCCESS; - // jQuery('#place_order').prop("disabled",false); jQuery('#place_order').prop("disabled",false); jQuery('#place_order').trigger('click'); } else { diff --git a/includes/class-wc-gateway-checkout-com-cards.php b/includes/class-wc-gateway-checkout-com-cards.php index 266a4ac2..f6d6ca4c 100644 --- a/includes/class-wc-gateway-checkout-com-cards.php +++ b/includes/class-wc-gateway-checkout-com-cards.php @@ -964,7 +964,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { * @return bool|int|void */ public function webhook_handler() { - // webhook_url_format = http://localhost/wordpress-5.0.2/wordpress/?wc-api=wc_checkoutcom_webhook . + // webhook_url_format = http://example.com/?wc-api=wc_checkoutcom_webhook . // Get webhook data. $data = json_decode( file_get_contents( 'php://input' ) ); @@ -1023,6 +1023,15 @@ function apache_request_headers() { if ( ! empty( $data->data->metadata->order_id ) ) { $order = wc_get_order( $data->data->metadata->order_id ); + } elseif ( ! empty( $data->data->reference ) ) { + $order = wc_get_order( $data->data->reference ); + + if ( isset( $data->data->metadata ) ) { + $data->data->metadata->order_id = $data->data->reference; + } else { + $data->data->metadata = new StdClass(); + $data->data->metadata->order_id = $data->data->reference; + } } if ( $order ) { diff --git a/includes/class-wc-gateway-checkout-com-paypal.php b/includes/class-wc-gateway-checkout-com-paypal.php index bce9c298..7dca749a 100644 --- a/includes/class-wc-gateway-checkout-com-paypal.php +++ b/includes/class-wc-gateway-checkout-com-paypal.php @@ -7,6 +7,9 @@ defined( 'ABSPATH' ) || exit; +use Checkout\CheckoutApiException; +use Checkout\Payments\PaymentType; + /** * Class WC_Gateway_Checkout_Com_PayPal for PayPal payment method. */ @@ -40,8 +43,225 @@ public function __construct() { } add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, [ $this, 'process_admin_options' ] ); + + // PayPal Payment scripts. + add_action( 'wp_enqueue_scripts', [ $this, 'payment_scripts' ] ); + add_filter( 'script_loader_tag', [ $this, 'add_attributes_to_script' ], 10, 3 ); + + add_action('woocommerce_api_' . strtolower( 'CKO_Paypal_Woocommerce' ), [ $this, 'handle_wc_api' ] ); } + public function handle_wc_api() { + + if ( ! empty( $_GET['cko_paypal_action'] ) ) { + switch ( $_GET['cko_paypal_action'] ) { + + case "create_order": + if ( ! empty( $_POST ) ) { + + WC()->checkout->process_checkout(); + + if ( wc_notice_count( 'error' ) > 0 ) { + WC()->session->set( 'reload_checkout', true ); + $error_messages_data = wc_get_notices('error'); + $error_messages = array(); + foreach ($error_messages_data as $key => $value) { + $error_messages[] = $value['notice']; + } + wc_clear_notices(); + ob_start(); + wp_send_json_error(array('messages' => $error_messages)); + exit; + } + exit(); + } + break; + + case "cc_capture": +// wc_clear_notices(); + WC_Checkoutcom_Utility::cko_set_session( 'cko_paypal_order_id', wc_clean( $_GET['paypal_order_id'] ) ); + $this->cko_cc_capture(); + break; + } + } + + exit(); + } + + public function cko_create_order_request( $subscription = null ) { + + $paymentContextsRequest = new Checkout\Payments\Contexts\PaymentContextsRequest(); + $paymentContextsRequest->source = new Checkout\Payments\Request\Source\Apm\RequestPayPalSource(); + $paymentContextsRequest->currency = get_woocommerce_currency(); + + $paymentContextsRequest->processing = new Checkout\Payments\Contexts\PaymentContextsProcessing(); + $paymentContextsRequest->processing->shipping_preference = Checkout\Payments\ShippingPreference::$NO_SHIPPING; + + $total_amount = WC()->cart->total; + $amount_cents = WC_Checkoutcom_Utility::value_to_decimal( $total_amount, get_woocommerce_currency() ); + + $paymentContextsRequest->amount = $amount_cents; + $paymentContextsRequest->capture = true; + + $paymentContextsRequest->payment_type = PaymentType::$regular; + + if ( WC_Checkoutcom_Utility::is_cart_contains_subscription() ) { + $paymentContextsRequest->payment_type = PaymentType::$recurring; + + $plan = new Checkout\Payments\BillingPlan(); + $plan->type = Checkout\Payments\BillingPlanType::$merchant_initiated_billing_single_agreement; + + $paymentContextsRequest->processing->plan = $plan; + } + + $items = new Checkout\Payments\Contexts\PaymentContextsItems(); + $items->name = 'All Products'; + $items->unit_price = $amount_cents; + $items->quantity = '1'; + + $paymentContextsRequest->items = [ $items ]; + + $checkout = new Checkout_SDK(); + + try { + $response = $checkout->get_builder()->getPaymentContextsClient()->createPaymentContexts( $paymentContextsRequest ); + + WC_Checkoutcom_Utility::cko_set_session( 'cko_pc_id', $response['id'] ); + + if ( isset( $response['partner_metadata']['order_id'] ) ) { + + wp_send_json( [ 'order_id' => $response['partner_metadata']['order_id'] ], 200 ); + } + + } catch ( CheckoutApiException $ex ) { + $gateway_debug = WC_Admin_Settings::get_option( 'cko_gateway_responses' ) === 'yes'; + + $error_message = 'An error has occurred while processing PayPal createPaymentContexts request. '; + + if ( $gateway_debug ) { + $error_message .= $ex->getMessage(); + } + + WC_Checkoutcom_Utility::logger( $error_message, $ex ); + + wp_send_json_error( [ 'messages' => $error_message ] ); + } + + exit(); + } + + public function cko_cc_capture() { + $cko_paypal_order_id = WC_Checkoutcom_Utility::cko_get_session( 'cko_paypal_order_id' ); + $cko_pc_id = WC_Checkoutcom_Utility::cko_get_session( 'cko_pc_id' ); + + if ( empty( $cko_pc_id ) ) { + return; + } + + try { + $checkout = new Checkout_SDK(); + $response = $checkout->get_builder()->getPaymentContextsClient()->getPaymentContextDetails( $cko_pc_id ); + + $order_id = absint( WC()->session->get( 'order_awaiting_payment' ) ); + $order = wc_get_order( $order_id ); + + $payment_context_id = $cko_pc_id; + $processing_channel_id = $response['payment_request']['processing_channel_id']; + + // Payment request to capture amount. + $return_response = $this->request_payment( $order, $payment_context_id, $processing_channel_id ); + + wp_send_json_success( $return_response ); + + } catch ( CheckoutApiException $ex ) { + $gateway_debug = WC_Admin_Settings::get_option( 'cko_gateway_responses' ) === 'yes'; + + $error_message = 'An error has occurred while processing PayPal getPaymentContextDetails request. '; + + if ( $gateway_debug ) { + $error_message .= $ex->getMessage(); + } + + WC_Checkoutcom_Utility::logger( $error_message, $ex ); + + wp_send_json_error( [ 'messages' => $error_message ] ); + } + } + + public function request_payment( $order, $payment_context_id, $processing_channel_id ) { + + try { + $checkout = new Checkout_SDK(); + + $payment_request_param = $checkout->get_payment_request(); + $payment_request_param->payment_context_id = $payment_context_id; + $payment_request_param->processing_channel_id = $processing_channel_id; + $payment_request_param->reference = $order->get_order_number(); + + $response = $checkout->get_builder()->getPaymentsClient()->requestPayment( $payment_request_param ); + $response_code = $response['http_metadata']->getStatusCode(); + + if ( ! WC_Checkoutcom_Utility::is_successful( $response ) || 'Declined' === $response['status'] ) { + $order->update_meta_data( '_cko_payment_id', $response['id'] ); + $order->save(); + + $error_message = esc_html__( 'An error has occurred while PayPal payment request. ', 'checkout-com-unified-payments-api' ); + + wp_send_json_error( [ 'messages' => $error_message ] ); + } + + /** + * Full Success = 201 + * Partial Success = 202 + * + * Ref : https://api-reference.checkout.com/#operation/requestAPaymentOrPayout!path=1/payment_context_id&t=request + */ + if ( in_array( $response_code, [ 201, 202 ], true ) ) { + + $order->set_transaction_id( $response['id'] ); + $order->update_meta_data( '_cko_payment_id', $response['id'] ); + + if ( class_exists( 'WC_Subscriptions_Order' ) ) { + // Save source id for subscription. + WC_Checkoutcom_Subscription::save_source_id( $order->get_id(), $order, $response['source']['id'] ); + } + + // Get cko auth status configured in admin. + $status = WC_Admin_Settings::get_option( 'ckocom_order_authorised', 'on-hold' ); + + $order->update_meta_data( 'cko_payment_authorized', true ); + $order->update_status( $status ); + + // Reduce stock levels. + wc_reduce_stock_levels( $order->get_id() ); + + // Remove cart. + WC()->cart->empty_cart(); + + // Return thank you page. + return [ + 'result' => 'success', + 'redirect' => $this->get_return_url( $order ), + ]; + + } + + } catch ( CheckoutApiException $ex ) { + $gateway_debug = WC_Admin_Settings::get_option( 'cko_gateway_responses' ) === 'yes'; + + $error_message = esc_html__( 'An error has occurred while PayPal payment request. ', 'checkout-com-unified-payments-api' ); + + // Check if gateway response is enabled from module settings. + if ( $gateway_debug ) { + $error_message .= $ex->getMessage(); + } + + WC_Checkoutcom_Utility::logger( $error_message, $ex ); + + wp_send_json_error( [ 'messages' => $error_message ] ); + } + } + /** * Show module configuration in backend. * @@ -71,6 +291,70 @@ public function generate_screen_button_html( $key, $value ) { WC_Checkoutcom_Admin::generate_links( $key, $value ); } + /** + * Add attributes to script tag. + * + * @param string $tag HTML for the script tag. + * @param string $handle Handle of script. + * @param string $src Src of script. + * @return string + */ + public function add_attributes_to_script( $tag, $handle, $src ) { + if ( 'cko-paypal-script' !== $handle ) { + return $tag; + } + + return str_replace( ' + cko_create_order_request(); + exit(); + $order = new WC_Order( $order_id ); // Create payment with PayPal token. diff --git a/includes/settings/class-wc-checkoutcom-cards-settings.php b/includes/settings/class-wc-checkoutcom-cards-settings.php index 50b5242d..55f12037 100644 --- a/includes/settings/class-wc-checkoutcom-cards-settings.php +++ b/includes/settings/class-wc-checkoutcom-cards-settings.php @@ -144,11 +144,11 @@ public static function core_settings() { 'placeholder' => 'pk_xxx', ], 'enable_fallback_ac' => [ - 'id' => 'enable', - 'title' => __( 'Fallback Account', 'checkout-com-unified-payments-api' ), - 'type' => 'checkbox', - 'label' => __( 'Enable Fallback Account(ABC account) for Refund', 'checkout-com-unified-payments-api' ), - 'default' => 'no', + 'id' => 'enable', + 'title' => __( 'Fallback Account', 'checkout-com-unified-payments-api' ), + 'type' => 'checkbox', + 'label' => __( 'Enable Fallback Account(ABC account) for Refund', 'checkout-com-unified-payments-api' ), + 'default' => 'no', ], 'fallback_ckocom_sk' => [ 'title' => __( 'Secret Key', 'checkout-com-unified-payments-api' ), @@ -654,12 +654,12 @@ public static function google_settings() { */ public static function paypal_settings() { $settings = [ - 'google_setting' => [ + 'google_setting' => [ 'title' => __( 'PayPal Settings', 'checkout-com-unified-payments-api' ), 'type' => 'title', 'description' => '', ], - 'enabled' => [ + 'enabled' => [ 'id' => 'enable', 'title' => __( 'Enable/Disable', 'checkout-com-unified-payments-api' ), 'type' => 'checkbox', @@ -668,7 +668,7 @@ public static function paypal_settings() { 'desc_tip' => true, 'default' => 'no', ], - 'title' => [ + 'title' => [ 'title' => __( 'Title', 'checkout-com-unified-payments-api' ), 'type' => 'text', 'label' => __( 'PayPal', 'checkout-com-unified-payments-api' ), @@ -676,13 +676,21 @@ public static function paypal_settings() { 'desc_tip' => true, 'default' => 'PayPal', ], - 'description' => [ + 'description' => [ 'title' => __( 'Description', 'checkout-com-unified-payments-api' ), 'type' => 'text', 'description' => __( 'This controls the description which the user sees during checkout.', 'checkout-com-unified-payments-api' ), 'default' => 'Pay with PayPal.', 'desc_tip' => true, ], + 'ckocom_paypal_merchant_id' => [ + 'title' => __( 'Merchant ID', 'checkout-com-unified-payments-api' ), + 'type' => 'text', + 'description' => __( 'Your Paypal merchant ID.', 'checkout-com-unified-payments-api' ), + 'desc_tip' => false, + 'default' => '', + 'placeholder' => 'ABCD1EFGH2I3K', + ], ]; return apply_filters( 'wc_checkout_com_paypal', $settings ); diff --git a/includes/subscription/class-wc-checkoutcom-subscription.php b/includes/subscription/class-wc-checkoutcom-subscription.php index 828bf6e0..9ab1ce33 100644 --- a/includes/subscription/class-wc-checkoutcom-subscription.php +++ b/includes/subscription/class-wc-checkoutcom-subscription.php @@ -46,9 +46,8 @@ public static function renewal_payment( $renewal_total, $renewal_order ) { /** * Update status of renewal order and add notes * - * @param array $payment_result Payment result. + * @param array $payment_result Payment result. * @param WC_Order $renewal_order Renewal order object. - * @param int $order_id Order ID. */ public static function update_order_status( $payment_result, $renewal_order ) { // Get renewal order ID. @@ -102,7 +101,6 @@ public static function update_order_status( $payment_result, $renewal_order ) { // Reduce stock levels. wc_reduce_stock_levels( $order_id ); - } /** @@ -116,6 +114,7 @@ public static function save_source_id( $order_id, $order, $source_id ) { // update source id for subscription payment method change. if ( $order instanceof WC_Subscription ) { $order->update_meta_data( '_cko_source_id', $source_id ); + $order->save(); } // Check for subscription and save source id. @@ -125,6 +124,7 @@ public static function save_source_id( $order_id, $order, $source_id ) { foreach ( $subscriptions as $subscription_obj ) { $subscription_obj->update_meta_data( '_cko_source_id', $source_id ); + $subscription_obj->save(); } } } @@ -155,7 +155,6 @@ public static function subscription_cancelled( $subscription ) { } } } - } /** diff --git a/lib/class-checkout-sdk.php b/lib/class-checkout-sdk.php index 84469de3..f28759df 100644 --- a/lib/class-checkout-sdk.php +++ b/lib/class-checkout-sdk.php @@ -35,7 +35,7 @@ class Checkout_SDK { /** * Constructor. * - * @param bool $use_fallback + * @param bool $use_fallback Use Fallback account flag. */ public function __construct( $use_fallback = false ) { $core_settings = get_option( 'woocommerce_wc_checkout_com_cards_settings' ); @@ -46,7 +46,7 @@ public function __construct( $use_fallback = false ) { if ( $this->nas_account_type && false === $use_fallback ) { $builder = CheckoutSdk::builder()->staticKeys(); } else { - $builder = CheckoutSdk::builder()->previous(); + $builder = CheckoutSdk::builder()->previous()->staticKeys(); } $builder->publicKey( $core_settings['ckocom_pk'] ); @@ -101,5 +101,4 @@ public function get_capture_request() { return new Checkout\Payments\Previous\CaptureRequest(); } } - -} +} \ No newline at end of file