diff --git a/composer.json b/composer.json index cc75ba745..9e14d0a36 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "skyverge/wc-plugin-framework", "description": "The official SkyVerge WooCommerce plugin framework", - "version": "5.15.5", + "version": "5.15.6", "license": "GPL-3.0", "minimum-stability": "dev", "prefer-stable": true, @@ -35,12 +35,12 @@ "woocommerce/class-sv-wp-admin-message-handler.php" ], "psr-4": { - "SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\": "woocommerce/" + "SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\": "woocommerce/" } }, "autoload-dev": { "psr-4": { - "SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Tests\\": "tests/" + "SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Tests\\": "tests/" } }, "config": { diff --git a/package-lock.json b/package-lock.json index 245f51c8e..6ffe0e0ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wc-plugin-framework", - "version": "5.15.5", + "version": "5.15.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wc-plugin-framework", - "version": "5.15.5", + "version": "5.15.6", "license": "GPL-3.0", "devDependencies": { "@parcel/transformer-coffeescript": "^2.13.3", diff --git a/package.json b/package.json index 4e5ab4b46..261ccc874 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wc-plugin-framework", - "version": "5.15.5", + "version": "5.15.6", "title": "WooCommerce Plugin Framework", "author": "SkyVerge Team", "homepage": "https://github.com/skyverge/wc-plugin-framework#readme", diff --git a/tests/TestCase.php b/tests/TestCase.php index e29883e94..e81f7e0b3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,6 +1,6 @@ assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Plugin_Dependencies', $this->get_plugin()->get_dependency_handler() ); + $this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Plugin_Dependencies', $this->get_plugin()->get_dependency_handler() ); } @@ -161,7 +161,7 @@ public function test_get_dependency_handler() { */ public function test_get_lifecycle_handler() { - $this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_5\Plugin\Lifecycle', $this->get_plugin()->get_lifecycle_handler() ); + $this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_6\Plugin\Lifecycle', $this->get_plugin()->get_lifecycle_handler() ); } diff --git a/tests/integration/REST_API/Controllers/SettingsTest.php b/tests/integration/REST_API/Controllers/SettingsTest.php index da31659b6..de6de865a 100644 --- a/tests/integration/REST_API/Controllers/SettingsTest.php +++ b/tests/integration/REST_API/Controllers/SettingsTest.php @@ -1,14 +1,14 @@ render_js(); $this->assertStringContainsString( 'function load_gateway_test_plugin_payment_methods_handler', $wc_queued_js ); - $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_methods_handler_v5_15_5_loaded\', load_gateway_test_plugin_payment_methods_handler );', $wc_queued_js ); + $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_methods_handler_v5_15_6_loaded\', load_gateway_test_plugin_payment_methods_handler );', $wc_queued_js ); } diff --git a/tests/integration/payment-gateway/PaymentFormTest.php b/tests/integration/payment-gateway/PaymentFormTest.php index cad121472..116a70c70 100644 --- a/tests/integration/payment-gateway/PaymentFormTest.php +++ b/tests/integration/payment-gateway/PaymentFormTest.php @@ -1,11 +1,11 @@ get_plugin()->get_gateway()->get_payment_form_instance()->render_js(); $this->assertStringContainsString( 'function load_test_gateway_payment_form_handler', $wc_queued_js ); - $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_form_handler_v5_15_5_loaded\', load_test_gateway_payment_form_handler );', $wc_queued_js ); + $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_form_handler_v5_15_6_loaded\', load_test_gateway_payment_form_handler );', $wc_queued_js ); } diff --git a/tests/integration/payment-gateway/SV_WC_Payment_Gateway_Payment_Token_Test.php b/tests/integration/payment-gateway/SV_WC_Payment_Gateway_Payment_Token_Test.php index 42cbd379e..d867fb984 100644 --- a/tests/integration/payment-gateway/SV_WC_Payment_Gateway_Payment_Token_Test.php +++ b/tests/integration/payment-gateway/SV_WC_Payment_Gateway_Payment_Token_Test.php @@ -1,11 +1,11 @@ invokeArgs( $frontend_instance, [[]] ); $this->assertStringContainsString( 'function load_test_gateway_apple_pay_handler', $wc_queued_js ); - $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_apple_pay_handler_v5_15_5_loaded\', load_test_gateway_apple_pay_handler );', $wc_queued_js ); + $this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_apple_pay_handler_v5_15_6_loaded\', load_test_gateway_apple_pay_handler );', $wc_queued_js ); } diff --git a/tests/unit/API/CacheableRequestTraitTest.php b/tests/unit/API/CacheableRequestTraitTest.php index 29b635575..113289abd 100644 --- a/tests/unit/API/CacheableRequestTraitTest.php +++ b/tests/unit/API/CacheableRequestTraitTest.php @@ -1,9 +1,9 @@ \SkyVerge\WooCommerce\PluginFramework\v5_15_5\Country_Helper::class, - PaymentFormContextChecker::class => \SkyVerge\WooCommerce\PluginFramework\v5_15_5\PaymentFormContextChecker::class, + Country_Helper::class => \SkyVerge\WooCommerce\PluginFramework\v5_15_6\Country_Helper::class, + PaymentFormContextChecker::class => \SkyVerge\WooCommerce\PluginFramework\v5_15_6\PaymentFormContextChecker::class, ]; foreach ($aliases as $alias) { diff --git a/tests/unit/HelperTest.php b/tests/unit/HelperTest.php index e0568416f..2c9a9b7dc 100644 --- a/tests/unit/HelperTest.php +++ b/tests/unit/HelperTest.php @@ -1,20 +1,20 @@ 'product', + 'posts_per_page' => 1, + 'orderby' => 'rand', + ])); + + if (isset($products[0]) && $products[0] instanceof WC_Product) { + return $products[0]; + } + + return null; + } + + /** + * Gets a dummy (fake) product. + * + * For use in rendering examples for email templates. + * @return WC_Product + */ + protected function getDummyProduct() : WC_Product + { + if (class_exists(EmailPreview::class) && method_exists(EmailPreview::class, 'get_dummy_product_when_not_set')) { + return EmailPreview::instance()->get_dummy_product_when_not_set(null); + } else { + // we should really never end up here! + return new WC_Product(); + } + } } diff --git a/woocommerce/Enums/PaymentFormContext.php b/woocommerce/Enums/PaymentFormContext.php index 9dfa4a7f2..f8b457d15 100644 --- a/woocommerce/Enums/PaymentFormContext.php +++ b/woocommerce/Enums/PaymentFormContext.php @@ -22,9 +22,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Enums; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Enums; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Enums\Traits\EnumTrait; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Enums\Traits\EnumTrait; /** * @since 5.13.0 diff --git a/woocommerce/Enums/Traits/EnumTrait.php b/woocommerce/Enums/Traits/EnumTrait.php index 29329c259..8fe83c39d 100644 --- a/woocommerce/Enums/Traits/EnumTrait.php +++ b/woocommerce/Enums/Traits/EnumTrait.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Enums\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Enums\Traits; use ReflectionClass; diff --git a/woocommerce/Handlers/Country_Helper.php b/woocommerce/Handlers/Country_Helper.php index 85437df42..784bbdb53 100644 --- a/woocommerce/Handlers/Country_Helper.php +++ b/woocommerce/Handlers/Country_Helper.php @@ -22,9 +22,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Plugin_Compatibility; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Plugin_Compatibility; defined( 'ABSPATH' ) or exit; diff --git a/woocommerce/Handlers/Script_Handler.php b/woocommerce/Handlers/Script_Handler.php index 7c71b11dc..d9ff4b85c 100644 --- a/woocommerce/Handlers/Script_Handler.php +++ b/woocommerce/Handlers/Script_Handler.php @@ -22,14 +22,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Plugin_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Plugin_Exception; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Handlers\\Script_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Handlers\\Script_Handler' ) ) : /** @@ -80,7 +80,7 @@ protected function add_hooks() { */ protected function get_js_handler_class_name() { - return sprintf( '%s_v5_15_5', $this->js_handler_base_class_name ); + return sprintf( '%s_v5_15_6', $this->js_handler_base_class_name ); } diff --git a/woocommerce/Helpers/ArrayHelper.php b/woocommerce/Helpers/ArrayHelper.php index c75e552a5..e73606354 100644 --- a/woocommerce/Helpers/ArrayHelper.php +++ b/woocommerce/Helpers/ArrayHelper.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Helpers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Helpers; use ArrayAccess; diff --git a/woocommerce/Helpers/NumberHelper.php b/woocommerce/Helpers/NumberHelper.php index 0247166e6..69f6b2bb5 100644 --- a/woocommerce/Helpers/NumberHelper.php +++ b/woocommerce/Helpers/NumberHelper.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Helpers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Helpers; class NumberHelper { diff --git a/woocommerce/Helpers/PageHelper.php b/woocommerce/Helpers/PageHelper.php index 487965180..e67e54872 100644 --- a/woocommerce/Helpers/PageHelper.php +++ b/woocommerce/Helpers/PageHelper.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Helpers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Helpers; class PageHelper { diff --git a/woocommerce/Plugin/Lifecycle.php b/woocommerce/Plugin/Lifecycle.php index 1898f8691..6eba679b9 100644 --- a/woocommerce/Plugin/Lifecycle.php +++ b/woocommerce/Plugin/Lifecycle.php @@ -22,12 +22,12 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Plugin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Admin\Notes_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Plugin_Compatibility; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Admin\Notes_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Plugin_Compatibility; defined( 'ABSPATH' ) or exit; diff --git a/woocommerce/Settings_API/Abstract_Settings.php b/woocommerce/Settings_API/Abstract_Settings.php index c9f6c5e8d..4c2965318 100644 --- a/woocommerce/Settings_API/Abstract_Settings.php +++ b/woocommerce/Settings_API/Abstract_Settings.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Settings_API\\Abstract_Settings' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Settings_API\\Abstract_Settings' ) ) : /** diff --git a/woocommerce/Settings_API/Control.php b/woocommerce/Settings_API/Control.php index 0e742feb3..5d3a0fbac 100644 --- a/woocommerce/Settings_API/Control.php +++ b/woocommerce/Settings_API/Control.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Settings_API\\Control' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Settings_API\\Control' ) ) : /** diff --git a/woocommerce/Settings_API/Setting.php b/woocommerce/Settings_API/Setting.php index ba9f136f8..f0557ce69 100644 --- a/woocommerce/Settings_API/Setting.php +++ b/woocommerce/Settings_API/Setting.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Settings_API\\Setting' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Settings_API\\Setting' ) ) : /** diff --git a/woocommerce/Traits/CanConvertToArrayTrait.php b/woocommerce/Traits/CanConvertToArrayTrait.php index 197c11c54..425afefed 100644 --- a/woocommerce/Traits/CanConvertToArrayTrait.php +++ b/woocommerce/Traits/CanConvertToArrayTrait.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Traits; use ReflectionClass; use ReflectionProperty; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Helpers\ArrayHelper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Helpers\ArrayHelper; /** * A trait that allows a given class/object to convert its state to an array. diff --git a/woocommerce/Traits/CanGetNewInstanceTrait.php b/woocommerce/Traits/CanGetNewInstanceTrait.php index 8fd34ea4d..2c814dc19 100644 --- a/woocommerce/Traits/CanGetNewInstanceTrait.php +++ b/woocommerce/Traits/CanGetNewInstanceTrait.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Traits; defined('ABSPATH') or exit; -if (trait_exists('\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Traits\\CanGetNewInstanceTrait')) { +if (trait_exists('\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Traits\\CanGetNewInstanceTrait')) { return; } diff --git a/woocommerce/Traits/IsSingletonTrait.php b/woocommerce/Traits/IsSingletonTrait.php index 1a249a098..3a5efed89 100644 --- a/woocommerce/Traits/IsSingletonTrait.php +++ b/woocommerce/Traits/IsSingletonTrait.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Traits; defined('ABSPATH') or exit; -if (trait_exists('\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Traits\\IsSingletonTrait')) { +if (trait_exists('\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Traits\\IsSingletonTrait')) { return; } diff --git a/woocommerce/admin/Notes_Helper.php b/woocommerce/admin/Notes_Helper.php index 3a419aeef..1bdefdcf8 100644 --- a/woocommerce/admin/Notes_Helper.php +++ b/woocommerce/admin/Notes_Helper.php @@ -21,13 +21,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Admin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Admin; use Automattic\WooCommerce\Admin\Notes as WooCommerce_Admin_Notes; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Admin\\Notes_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Admin\\Notes_Helper' ) ) : /** diff --git a/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php b/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php index 076517227..cf65b9642 100644 --- a/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php +++ b/woocommerce/admin/abstract-sv-wc-plugin-admin-setup-wizard.php @@ -21,13 +21,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Admin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Admin; defined( 'ABSPATH' ) or exit; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Admin\\Setup_Wizard' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Admin\\Setup_Wizard' ) ) : /** diff --git a/woocommerce/api/Abstract_Cacheable_API_Base.php b/woocommerce/api/Abstract_Cacheable_API_Base.php index 2437669ef..05d6c1c59 100644 --- a/woocommerce/api/Abstract_Cacheable_API_Base.php +++ b/woocommerce/api/Abstract_Cacheable_API_Base.php @@ -22,14 +22,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\API; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_API_Base; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\API\Traits\Cacheable_Request_Trait; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_API_Base; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\API\Traits\Cacheable_Request_Trait; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\API\\Abstract_Cacheable_API_Base' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\API\\Abstract_Cacheable_API_Base' ) ) : /** diff --git a/woocommerce/api/Traits/Cacheable_Request_Trait.php b/woocommerce/api/Traits/Cacheable_Request_Trait.php index 989cd6454..3eef481b6 100644 --- a/woocommerce/api/Traits/Cacheable_Request_Trait.php +++ b/woocommerce/api/Traits/Cacheable_Request_Trait.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\API\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\API\Traits; defined( 'ABSPATH' ) or exit; -if ( ! trait_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\API\\Traits\\Cacheable_Request_Trait' ) ) : +if ( ! trait_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\API\\Traits\\Cacheable_Request_Trait' ) ) : /** diff --git a/woocommerce/api/abstract-sv-wc-api-json-request.php b/woocommerce/api/abstract-sv-wc-api-json-request.php index 58e8bc104..b65612a0c 100644 --- a/woocommerce/api/abstract-sv-wc-api-json-request.php +++ b/woocommerce/api/abstract-sv-wc-api-json-request.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_JSON_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_JSON_Request' ) ) : /** diff --git a/woocommerce/api/abstract-sv-wc-api-json-response.php b/woocommerce/api/abstract-sv-wc-api-json-response.php index 3124b9ba0..f99d5a634 100644 --- a/woocommerce/api/abstract-sv-wc-api-json-response.php +++ b/woocommerce/api/abstract-sv-wc-api-json-response.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_JSON_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_JSON_Response' ) ) : /** diff --git a/woocommerce/api/abstract-sv-wc-api-xml-request.php b/woocommerce/api/abstract-sv-wc-api-xml-request.php index 5105a1575..041127f5c 100644 --- a/woocommerce/api/abstract-sv-wc-api-xml-request.php +++ b/woocommerce/api/abstract-sv-wc-api-xml-request.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_XML_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_XML_Request' ) ) : /** diff --git a/woocommerce/api/abstract-sv-wc-api-xml-response.php b/woocommerce/api/abstract-sv-wc-api-xml-response.php index b18fc2242..5a9a0be4a 100644 --- a/woocommerce/api/abstract-sv-wc-api-xml-response.php +++ b/woocommerce/api/abstract-sv-wc-api-xml-response.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_XML_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_XML_Response' ) ) : /** diff --git a/woocommerce/api/class-sv-wc-api-base.php b/woocommerce/api/class-sv-wc-api-base.php index 4dd3a5d71..9249932d5 100644 --- a/woocommerce/api/class-sv-wc-api-base.php +++ b/woocommerce/api/class-sv-wc-api-base.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_Base' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_Base' ) ) : /** diff --git a/woocommerce/api/class-sv-wc-api-exception.php b/woocommerce/api/class-sv-wc-api-exception.php index 8d8c53798..bc58d17c6 100644 --- a/woocommerce/api/class-sv-wc-api-exception.php +++ b/woocommerce/api/class-sv-wc-api-exception.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_Exception' ) ) : /** diff --git a/woocommerce/api/interface-sv-wc-api-request.php b/woocommerce/api/interface-sv-wc-api-request.php index 53d416d4b..3fb6a3163 100644 --- a/woocommerce/api/interface-sv-wc-api-request.php +++ b/woocommerce/api/interface-sv-wc-api-request.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_Request' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_Request' ) ) : /** diff --git a/woocommerce/api/interface-sv-wc-api-response.php b/woocommerce/api/interface-sv-wc-api-response.php index e020524ad..5ad990737 100644 --- a/woocommerce/api/interface-sv-wc-api-response.php +++ b/woocommerce/api/interface-sv-wc-api-response.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_API_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_API_Response' ) ) : /** diff --git a/woocommerce/changelog.txt b/woocommerce/changelog.txt index 2268c3e50..b6d9a244d 100644 --- a/woocommerce/changelog.txt +++ b/woocommerce/changelog.txt @@ -1,5 +1,8 @@ *** SkyVerge WooCommerce Plugin Framework Changelog *** +2025.03.11 - version 5.15.6 +* New: Added additional helper methods to the trait `HasEmailPreviewValuesTrait` + 2025.03.05 - version 5.15.5 * New: Add a trait to assist in compatibility with new WooCommerce email preview feature * Fix: Undefined array key errors diff --git a/woocommerce/class-sv-wc-admin-notice-handler.php b/woocommerce/class-sv-wc-admin-notice-handler.php index 2c016881d..6235995c4 100644 --- a/woocommerce/class-sv-wc-admin-notice-handler.php +++ b/woocommerce/class-sv-wc-admin-notice-handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Admin_Notice_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Admin_Notice_Handler' ) ) : /** diff --git a/woocommerce/class-sv-wc-helper.php b/woocommerce/class-sv-wc-helper.php index 0a03fcf1b..923ab30e1 100644 --- a/woocommerce/class-sv-wc-helper.php +++ b/woocommerce/class-sv-wc-helper.php @@ -22,15 +22,15 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Helpers\NumberHelper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Helpers\NumberHelper; use WC_Data; use WP_Post; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Helper' ) ) : /** diff --git a/woocommerce/class-sv-wc-hook-deprecator.php b/woocommerce/class-sv-wc-hook-deprecator.php index cc91d3782..52b199995 100644 --- a/woocommerce/class-sv-wc-hook-deprecator.php +++ b/woocommerce/class-sv-wc-hook-deprecator.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Hook_Deprecator' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Hook_Deprecator' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-compatibility.php b/woocommerce/class-sv-wc-plugin-compatibility.php index ac407a1aa..6512e7eb9 100644 --- a/woocommerce/class-sv-wc-plugin-compatibility.php +++ b/woocommerce/class-sv-wc-plugin-compatibility.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; use Automattic\WooCommerce\Utilities\OrderUtil; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Plugin_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Plugin_Compatibility' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-dependencies.php b/woocommerce/class-sv-wc-plugin-dependencies.php index 1d894aad6..d24e456d7 100644 --- a/woocommerce/class-sv-wc-plugin-dependencies.php +++ b/woocommerce/class-sv-wc-plugin-dependencies.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Plugin_Dependencies' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Plugin_Dependencies' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-exception.php b/woocommerce/class-sv-wc-plugin-exception.php index 685d676eb..15a7ff637 100644 --- a/woocommerce/class-sv-wc-plugin-exception.php +++ b/woocommerce/class-sv-wc-plugin-exception.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Plugin_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Plugin_Exception' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin.php b/woocommerce/class-sv-wc-plugin.php index fe9a5bc58..6effbc0ee 100644 --- a/woocommerce/class-sv-wc-plugin.php +++ b/woocommerce/class-sv-wc-plugin.php @@ -22,18 +22,18 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; use Automattic\WooCommerce\Utilities\FeaturesUtil; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Handlers\Country_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\PaymentFormContextChecker; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Handlers\Country_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\PaymentFormContextChecker; use stdClass; use Throwable; use WC_Logger_Interface; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Plugin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Plugin' ) ) : /** @@ -51,7 +51,7 @@ abstract class SV_WC_Plugin { /** Plugin Framework Version */ - public const VERSION = '5.15.5'; + public const VERSION = '5.15.6'; /** @var object single instance of plugin */ protected static $instance; @@ -486,7 +486,7 @@ private function includes() { */ protected function setupClassAliases() : void { - $countryHelperAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Country_Helper'; + $countryHelperAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Country_Helper'; if (! class_exists($countryHelperAlias)) { class_alias( Country_Helper::class, @@ -494,7 +494,7 @@ class_alias( ); } - $paymentFormContextCheckerAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\PaymentFormContextChecker'; + $paymentFormContextCheckerAlias = '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\PaymentFormContextChecker'; if (! class_exists($paymentFormContextCheckerAlias)) { class_alias( PaymentFormContextChecker::class, diff --git a/woocommerce/class-sv-wp-admin-message-handler.php b/woocommerce/class-sv-wp-admin-message-handler.php index 2f920dd6c..b1ec17967 100644 --- a/woocommerce/class-sv-wp-admin-message-handler.php +++ b/woocommerce/class-sv-wp-admin-message-handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WP_Admin_Message_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WP_Admin_Message_Handler' ) ) : /** diff --git a/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php b/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php index 428b7c97b..00c38e3e7 100644 --- a/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php +++ b/woocommerce/compatibility/abstract-sv-wc-data-compatibility.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Data_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Data_Compatibility' ) ) : /** diff --git a/woocommerce/compatibility/class-sv-wc-order-compatibility.php b/woocommerce/compatibility/class-sv-wc-order-compatibility.php index b855de90b..397dd8eb7 100644 --- a/woocommerce/compatibility/class-sv-wc-order-compatibility.php +++ b/woocommerce/compatibility/class-sv-wc-order-compatibility.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; use Automattic\WooCommerce\Admin\Overrides\Order; use Automattic\WooCommerce\Internal\Admin\Orders\PageController; @@ -32,7 +32,7 @@ defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Order_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Order_Compatibility' ) ) : /** diff --git a/woocommerce/compatibility/class-sv-wc-subscription-compatibility.php b/woocommerce/compatibility/class-sv-wc-subscription-compatibility.php index 46d7c8c6b..9e5ddb538 100644 --- a/woocommerce/compatibility/class-sv-wc-subscription-compatibility.php +++ b/woocommerce/compatibility/class-sv-wc-subscription-compatibility.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Subscription_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Subscription_Compatibility' ) ) : /** * WooCommerce subscription compatibility class. diff --git a/woocommerce/i18n/languages/woocommerce-plugin-framework.pot b/woocommerce/i18n/languages/woocommerce-plugin-framework.pot index a4d47186e..5cec14a20 100644 --- a/woocommerce/i18n/languages/woocommerce-plugin-framework.pot +++ b/woocommerce/i18n/languages/woocommerce-plugin-framework.pot @@ -1,14 +1,14 @@ # Copyright (c) GoDaddy Operating Company, LLC. All Rights Reserved. msgid "" msgstr "" -"Project-Id-Version: SkyVerge WooCommerce Plugin Framework 1.0.0 TODO: plugin version\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wc-plugin-framework\n" +"Project-Id-Version: SkyVerge WooCommerce Plugin Framework\n" +"Report-Msgid-Bugs-To: https://github.com/godaddy-wordpress/wc-plugin-framework/issues\n" "Last-Translator: plugins@godaddy.com\n" -"Language-Team: LANGUAGE \n" +"Language-Team: plugins@godaddy.com\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-03-05T09:49:58+00:00\n" +"POT-Creation-Date: 2025-03-11T12:47:32+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" "X-Domain: woocommerce-plugin-framework\n" diff --git a/woocommerce/payment-gateway/Blocks/Gateway_Blocks_Handler.php b/woocommerce/payment-gateway/Blocks/Gateway_Blocks_Handler.php index 30bbca64a..5f74f0c26 100644 --- a/woocommerce/payment-gateway/Blocks/Gateway_Blocks_Handler.php +++ b/woocommerce/payment-gateway/Blocks/Gateway_Blocks_Handler.php @@ -1,13 +1,13 @@ get_handler()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-external-checkout.css', array(), $this->get_handler()->get_plugin()->get_version() ); // TODO: min + wp_enqueue_style( 'sv-wc-external-checkout-v5_15_6', $this->get_handler()->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-external-checkout.css', array(), $this->get_handler()->get_plugin()->get_version() ); // TODO: min } diff --git a/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php b/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php index 618ea302b..b9a0853ea 100644 --- a/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php +++ b/woocommerce/payment-gateway/External_Checkout/Google_Pay/AJAX.php @@ -22,14 +22,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Exception; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php index c214b5caf..bc2251cd8 100755 --- a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php +++ b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Admin.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Helper; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) : /** @@ -37,7 +37,7 @@ * @since 5.10.0 */ #[\AllowDynamicProperties] -class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Admin { +class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Admin { /** @var Google_Pay the Google Pay handler instance */ diff --git a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php index 9ca0b4ffe..4c798cfc4 100644 --- a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php +++ b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Frontend.php @@ -22,14 +22,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Exception; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) : /** @@ -38,7 +38,7 @@ * @since 5.10.0 */ #[\AllowDynamicProperties] -class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Frontend { +class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Frontend { /** @var string JS handler base class name, without the FW version */ @@ -102,7 +102,7 @@ public function enqueue_scripts() { $version = $gateway->get_plugin()->get_assets_version( $gateway->get_id() ); wp_enqueue_script( 'google-pay-js-library', 'https://pay.google.com/gp/p/js/pay.js', [], $version, true ); - wp_enqueue_script( 'sv-wc-google-pay-v5_15_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $version, true ); + wp_enqueue_script( 'sv-wc-google-pay-v5_15_6', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $version, true ); } diff --git a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php index 52bfdc77e..0360af6db 100755 --- a/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php +++ b/woocommerce/payment-gateway/External_Checkout/Google_Pay/Google_Pay.php @@ -22,17 +22,17 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Orders; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Exception; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\External_Checkout; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Orders; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) : /** @@ -677,7 +677,7 @@ public function get_supported_networks() { $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : []; - $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); + $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); $valid_networks = [ SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'AMEX', diff --git a/woocommerce/payment-gateway/External_Checkout/Orders.php b/woocommerce/payment-gateway/External_Checkout/Orders.php index 4d94817d1..cc4bec81e 100644 --- a/woocommerce/payment-gateway/External_Checkout/Orders.php +++ b/woocommerce/payment-gateway/External_Checkout/Orders.php @@ -22,9 +22,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; defined( 'ABSPATH' ) or exit; diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php index f200b6bd2..b3db1eecc 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-request.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php index fb99b0d62..365fa21bd 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api-response.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php index ca29723ad..e28e8037f 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-api.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) : /** @@ -58,7 +58,7 @@ public function __construct( SV_WC_Payment_Gateway $gateway ) { $this->set_request_content_type_header( 'application/json' ); $this->set_request_accept_header( 'application/json' ); - $this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ); + $this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ); } diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php index e1065aa26..cc25e332f 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/api/class-sv-wc-payment-gateway-apple-pay-payment-response.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php index a17d47436..396c67ce9 100755 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-admin.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Admin; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Admin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php index 9bfec4e88..123408cff 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-ajax.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php index 883d082f0..2408ac840 100644 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay-frontend.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) : /** @@ -35,7 +35,7 @@ * @since 4.7.0 */ #[\AllowDynamicProperties] -class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Frontend { +class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Frontend { /** @var string JS handler base class name, without the FW version */ @@ -116,9 +116,9 @@ public function enqueue_scripts() { $gateway = $this->get_gateway(); $version = $gateway->get_plugin()->get_assets_version( $gateway->get_id() ); - wp_enqueue_style( 'sv-wc-apple-pay-v5_15_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', [], $version ); // TODO: min + wp_enqueue_style( 'sv-wc-apple-pay-v5_15_6', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', [], $version ); // TODO: min - wp_enqueue_script( 'sv-wc-apple-pay-v5_15_5', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', [ 'jquery' ], $version, true ); + wp_enqueue_script( 'sv-wc-apple-pay-v5_15_6', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', [ 'jquery' ], $version, true ); } diff --git a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php index e10dcd44b..4e1610c49 100755 --- a/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php +++ b/woocommerce/payment-gateway/External_Checkout/apple-pay/class-sv-wc-payment-gateway-apple-pay.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Orders; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Orders; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Apple_Pay' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Apple_Pay' ) ) : /** @@ -937,7 +937,7 @@ public function get_supported_networks() { $accepted_card_types = ( $this->get_processing_gateway() ) ? $this->get_processing_gateway()->get_card_types() : array(); - $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); + $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); $valid_networks = array( SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX => 'amex', diff --git a/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php b/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php index b83d96117..e21fb2768 100644 --- a/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php +++ b/woocommerce/payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as FrameworkBase; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as FrameworkBase; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) : /** diff --git a/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php b/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php index 550dc4874..147404b88 100644 --- a/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php +++ b/woocommerce/payment-gateway/Handlers/Abstract_Payment_Handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as FrameworkBase; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as FrameworkBase; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) : /** diff --git a/woocommerce/payment-gateway/Handlers/Capture.php b/woocommerce/payment-gateway/Handlers/Capture.php index 53d95ec2f..55f684e21 100644 --- a/woocommerce/payment-gateway/Handlers/Capture.php +++ b/woocommerce/payment-gateway/Handlers/Capture.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\Handlers\\Capture' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\Handlers\\Capture' ) ) : /** diff --git a/woocommerce/payment-gateway/PaymentFormContextChecker.php b/woocommerce/payment-gateway/PaymentFormContextChecker.php index 6bd9e351b..d5579c9d4 100644 --- a/woocommerce/payment-gateway/PaymentFormContextChecker.php +++ b/woocommerce/payment-gateway/PaymentFormContextChecker.php @@ -1,9 +1,9 @@ 0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(confirm(i.capture_ays))return a("#woocommerce-order-items").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),t={action:i.capture_action,nonce:i.capture_nonce,gateway_id:i.gateway_id,order_id:i.order_id,amount:e,comment:r},a.ajax({url:i.ajax_url,data:t}).done(function(a){if(null!=a.data&&null!=a.data.message&&alert(a.data.message),a.success)return location.reload()}).fail(function(){return alert(i.capture_error)}).always(function(){return a("#woocommerce-order-items").unblock()})},window.sv_wc_payment_gateway_admin_order_add_capture_events()})}).call(this); -},{}]},{},["U07d"], null) -//# sourceMappingURL=../admin/sv-wc-payment-gateway-admin-order.js.map \ No newline at end of file +(function(){jQuery(function(a){var e,t,r,n,o,c,i,u,m;return i=null!=(t=window.sv_wc_payment_gateway_admin_order)?t:{},u=null!=(r=window.woocommerce_admin)?r:{},m=null!=(n=window.woocommerce_admin_meta_boxes)?n:{},e=null!=(o=window.accounting)?o:{},window.sv_wc_payment_gateway_admin_order_add_capture_events=function(){if(!a(".sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events").length)return a(".sv-wc-payment-gateway-partial-capture").addClass("sv-wc-payment-gateway-partial-capture-with-events").appendTo("#woocommerce-order-items .inside"),a("#woocommerce-order-items").on("click",".sv-wc-payment-gateway-capture:not(.disabled)",function(e){return(e.preventDefault(),a(this).hasClass("partial-capture"))?(a("div.sv-wc-payment-gateway-partial-capture").slideDown(),a("div.wc-order-data-row-toggle").not("div.sv-wc-payment-gateway-partial-capture").slideUp(),a("div.wc-order-totals-items").slideUp()):c()}),a(".sv-wc-payment-gateway-partial-capture").on("change keyup","#capture_amount",function(t){var r;return(r=e.unformat(a(this).val(),u.mon_decimal_point))?a("button.capture-action").removeAttr("disabled"):a("button.capture-action").attr("disabled","disabled"),a("button .capture-amount .amount").text(e.formatMoney(r,{symbol:m.currency_format_symbol,decimal:m.currency_format_decimal_sep,thousand:m.currency_format_thousand_sep,precision:m.currency_format_num_decimals,format:m.currency_format}))}),a(".sv-wc-payment-gateway-partial-capture").on("click",".capture-action",function(e){var t,r;return e.preventDefault(),t=a(".sv-wc-payment-gateway-partial-capture #capture_amount").val(),r=a(".sv-wc-payment-gateway-partial-capture #capture_comment").val(),c(t,r)})},c=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(confirm(i.capture_ays))return a("#woocommerce-order-items").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),e={action:i.capture_action,nonce:i.capture_nonce,gateway_id:i.gateway_id,order_id:i.order_id,amount:t,comment:r},a.ajax({url:i.ajax_url,data:e}).done(function(a){if(null!=a.data&&null!=a.data.message&&alert(a.data.message),a.success)return location.reload()}).fail(function(){return alert(i.capture_error)}).always(function(){return a("#woocommerce-order-items").unblock()})},window.sv_wc_payment_gateway_admin_order_add_capture_events()})}).call(module.exports); +//# sourceMappingURL=sv-wc-payment-gateway-admin-order.js.map diff --git a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map index b791894da..541325035 100644 --- a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map +++ b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-admin-order.js.map @@ -1 +1 @@ -{"version":3,"sources":["admin/sv-wc-payment-gateway-admin-order.coffee"],"names":["jQuery","$","accounting","ref","ref1","ref2","ref3","submitCapture","sv_wc_payment_gateway_admin_order","woocommerce_admin","woocommerce_admin_meta_boxes","window","sv_wc_payment_gateway_admin_order_add_capture_events","length","addClass","appendTo","on","e","preventDefault","hasClass","slideDown","not","slideUp","total","unformat","val","mon_decimal_point","removeAttr","attr","text","formatMoney","symbol","currency_format_symbol","decimal","currency_format_decimal_sep","thousand","currency_format_thousand_sep","precision","currency_format_num_decimals","format","currency_format","amount","comment","data","confirm","capture_ays","block","message","overlayCSS","background","opacity","action","capture_action","nonce","capture_nonce","gateway_id","order_id","ajax","url","ajax_url","done","response","alert","success","location","reload","fail","capture_error","always","unblock","call"],"mappings":";CAAA,WASEA,OAAO,SAASC,GACd,aACIC,IAAAA,EAAYC,EAAKC,EAAMC,EAAMC,EAAMC,EAAeC,EAAmCC,EAAmBC,EAkFrGC,OAjFPH,EAAwF,OAAnDL,EAAMQ,O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A,GAAA,GAE1CE,GAAAA,QAAQpC,EAAkCqC,aAgBrC5C,OAfPA,EAAE,4BAA4B6C,MAAM,CAClCC,QAAS,KACTC,WAAY,CACVC,WAAY,OACZC,QAAS,MAGbP,EAAO,CACLQ,OAAQ3C,EAAkC4C,eAC1CC,MAAO7C,EAAkC8C,cACzCC,WAAY/C,EAAkC+C,WAC9CC,SAAUhD,EAAkCgD,SAC5Cf,OAAQA,EACRC,QAASA,GAEJzC,EAAEwD,KAAK,CACZC,IAAKlD,EAAkCmD,SACvChB,KAAMA,IACLiB,KAAK,SAASC,GAIXA,GAHkB,MAAjBA,EAASlB,MAA2C,MAAzBkB,EAASlB,KAAKI,SAC5Ce,MAAMD,EAASlB,KAAKI,SAElBc,EAASE,QACJC,OAAAA,SAASC,WAEjBC,KAAK,WAECJ,OAAAA,MAAMtD,EAAkC2D,iBAC9CC,OAAO,WAEDnE,OAAAA,EAAE,4BAA4BoE,aAIpC1D,OAAOC,2DAGf0D,KAAK","file":"sv-wc-payment-gateway-admin-order.js","sourceRoot":"../js","sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript\n Version 5.0.0\n\n Copyright (c) 2017-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */\n jQuery(function($) {\n \"use strict\";\n var accounting, ref, ref1, ref2, ref3, submitCapture, sv_wc_payment_gateway_admin_order, woocommerce_admin, woocommerce_admin_meta_boxes;\n sv_wc_payment_gateway_admin_order = (ref = window.sv_wc_payment_gateway_admin_order) != null ? ref : {};\n woocommerce_admin = (ref1 = window.woocommerce_admin) != null ? ref1 : {};\n woocommerce_admin_meta_boxes = (ref2 = window.woocommerce_admin_meta_boxes) != null ? ref2 : {};\n accounting = (ref3 = window.accounting) != null ? ref3 : {};\n window.sv_wc_payment_gateway_admin_order_add_capture_events = function() {\n // prevent the events to be attached again\n if (($('.sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events').length)) {\n return;\n }\n $('.sv-wc-payment-gateway-partial-capture').addClass('sv-wc-payment-gateway-partial-capture-with-events').appendTo('#woocommerce-order-items .inside');\n $('#woocommerce-order-items').on('click', '.sv-wc-payment-gateway-capture:not(.disabled)', function(e) {\n e.preventDefault();\n if ($(this).hasClass('partial-capture')) {\n $('div.sv-wc-payment-gateway-partial-capture').slideDown();\n $('div.wc-order-data-row-toggle').not('div.sv-wc-payment-gateway-partial-capture').slideUp();\n return $('div.wc-order-totals-items').slideUp();\n } else {\n return submitCapture();\n }\n });\n $('.sv-wc-payment-gateway-partial-capture').on('change keyup', '#capture_amount', function(e) {\n var total;\n total = accounting.unformat($(this).val(), woocommerce_admin.mon_decimal_point);\n if (total) {\n $('button.capture-action').removeAttr('disabled');\n } else {\n $('button.capture-action').attr('disabled', 'disabled');\n }\n return $('button .capture-amount .amount').text(accounting.formatMoney(total, {\n symbol: woocommerce_admin_meta_boxes.currency_format_symbol,\n decimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep,\n thousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep,\n precision: woocommerce_admin_meta_boxes.currency_format_num_decimals,\n format: woocommerce_admin_meta_boxes.currency_format\n }));\n });\n return $('.sv-wc-payment-gateway-partial-capture').on('click', '.capture-action', function(e) {\n var amount, comment;\n e.preventDefault();\n amount = $('.sv-wc-payment-gateway-partial-capture #capture_amount').val();\n comment = $('.sv-wc-payment-gateway-partial-capture #capture_comment').val();\n return submitCapture(amount, comment);\n });\n };\n submitCapture = function(amount = '', comment = '') {\n var data;\n if (confirm(sv_wc_payment_gateway_admin_order.capture_ays)) {\n $('#woocommerce-order-items').block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n data = {\n action: sv_wc_payment_gateway_admin_order.capture_action,\n nonce: sv_wc_payment_gateway_admin_order.capture_nonce,\n gateway_id: sv_wc_payment_gateway_admin_order.gateway_id,\n order_id: sv_wc_payment_gateway_admin_order.order_id,\n amount: amount,\n comment: comment\n };\n return $.ajax({\n url: sv_wc_payment_gateway_admin_order.ajax_url,\n data: data\n }).done(function(response) {\n if ((response.data != null) && (response.data.message != null)) {\n alert(response.data.message);\n }\n if (response.success) {\n return location.reload();\n }\n }).fail(function() {\n // connection error\n return alert(sv_wc_payment_gateway_admin_order.capture_error);\n }).always(function() {\n // never leave the UI blocked\n return $('#woocommerce-order-items').unblock();\n });\n }\n };\n return window.sv_wc_payment_gateway_admin_order_add_capture_events();\n });\n\n}).call(this);\n"]} \ No newline at end of file +{"mappings":"ACOG,CAAA,WAEH,OAAO,SAAE,CAAF,EACP,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAiGC,OA/FA,EAAA,AAAA,MAAA,CAAA,EAAA,OAAA,iCAAA,AAAA,EAAA,EAA+E,CAAA,EAC/E,EAAA,AAAA,MAAA,CAAA,EAAA,OAAA,iBAAA,AAAA,EAAA,EAA+D,CAAA,EAC/D,EAAA,AAAA,MAAA,CAAA,EAAA,OAAA,4BAAA,AAAA,EAAA,EAA0E,CAAA,EAC1E,EAAA,AAAA,MAAA,CAAA,EAAA,OAAA,UAAA,AAAA,EAAA,EAAwD,CAAA,EAExD,OAAO,oDAAP,CAA8D,WAG7D,IAAK,EAAG,4FAA6F,MAAlG,CAsCH,OAnCA,EAAG,0CAA2C,QAA9C,CAAwD,qDAAsD,QAA9G,CAAwH,oCAExH,EAAG,4BAA6B,EAAhC,CAAmC,QAAS,gDAAiD,SAAE,CAAF,QAI5F,CAFA,EAAE,cAAF,GAEK,EAAG,IAAH,EAAO,QAAP,CAAiB,qBAErB,EAAG,6CAA8C,SAAjD,GACA,EAAG,gCAAiC,GAApC,CAAyC,6CAA8C,OAAvF,GACA,EAAG,6BAA8B,OAAjC,IAIA,GAZ2F,GAe7F,EAAG,0CAA2C,EAA9C,CAAiD,eAAgB,kBAAmB,SAAE,CAAF,EAEtF,IAAA,EAOG,MAPA,CAAA,EAAQ,EAAW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A,IAAA,CAAA,OAAA,EAArD,MAAO,EAAS,IAAI,CAAC,OAArB,EAEqB,EAAS,OAA9B,CAAA,OAAA,SAAS,MAAT,EAJO,GAMN,IATF,CASQ,WAGP,OAAA,MAAO,EAAkC,aAAzC,CAHO,GAKN,MAdF,CAcU,WAGT,OAAA,EAAG,4BAA6B,OAAhC,EAHS,EAlCI,EAwChB,OAAO,oDAAP,EAlGM,E,C,E,I,C,O,O","sources":["","woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-admin-order.coffee"],"sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript\n Version 5.0.0\n\n Copyright (c) 2017-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */ jQuery(function($) {\n \"use strict\";\n var accounting, ref, ref1, ref2, ref3, submitCapture, sv_wc_payment_gateway_admin_order, woocommerce_admin, woocommerce_admin_meta_boxes;\n sv_wc_payment_gateway_admin_order = (ref = window.sv_wc_payment_gateway_admin_order) != null ? ref : {};\n woocommerce_admin = (ref1 = window.woocommerce_admin) != null ? ref1 : {};\n woocommerce_admin_meta_boxes = (ref2 = window.woocommerce_admin_meta_boxes) != null ? ref2 : {};\n accounting = (ref3 = window.accounting) != null ? ref3 : {};\n window.sv_wc_payment_gateway_admin_order_add_capture_events = function() {\n // prevent the events to be attached again\n if ($('.sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events').length) return;\n $('.sv-wc-payment-gateway-partial-capture').addClass('sv-wc-payment-gateway-partial-capture-with-events').appendTo('#woocommerce-order-items .inside');\n $('#woocommerce-order-items').on('click', '.sv-wc-payment-gateway-capture:not(.disabled)', function(e) {\n e.preventDefault();\n if ($(this).hasClass('partial-capture')) {\n $('div.sv-wc-payment-gateway-partial-capture').slideDown();\n $('div.wc-order-data-row-toggle').not('div.sv-wc-payment-gateway-partial-capture').slideUp();\n return $('div.wc-order-totals-items').slideUp();\n } else return submitCapture();\n });\n $('.sv-wc-payment-gateway-partial-capture').on('change keyup', '#capture_amount', function(e) {\n var total;\n total = accounting.unformat($(this).val(), woocommerce_admin.mon_decimal_point);\n if (total) $('button.capture-action').removeAttr('disabled');\n else $('button.capture-action').attr('disabled', 'disabled');\n return $('button .capture-amount .amount').text(accounting.formatMoney(total, {\n symbol: woocommerce_admin_meta_boxes.currency_format_symbol,\n decimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep,\n thousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep,\n precision: woocommerce_admin_meta_boxes.currency_format_num_decimals,\n format: woocommerce_admin_meta_boxes.currency_format\n }));\n });\n return $('.sv-wc-payment-gateway-partial-capture').on('click', '.capture-action', function(e) {\n var amount, comment;\n e.preventDefault();\n amount = $('.sv-wc-payment-gateway-partial-capture #capture_amount').val();\n comment = $('.sv-wc-payment-gateway-partial-capture #capture_comment').val();\n return submitCapture(amount, comment);\n });\n };\n submitCapture = function submitCapture() {\n var amount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '', comment = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';\n var data;\n if (confirm(sv_wc_payment_gateway_admin_order.capture_ays)) {\n $('#woocommerce-order-items').block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n data = {\n action: sv_wc_payment_gateway_admin_order.capture_action,\n nonce: sv_wc_payment_gateway_admin_order.capture_nonce,\n gateway_id: sv_wc_payment_gateway_admin_order.gateway_id,\n order_id: sv_wc_payment_gateway_admin_order.order_id,\n amount: amount,\n comment: comment\n };\n return $.ajax({\n url: sv_wc_payment_gateway_admin_order.ajax_url,\n data: data\n }).done(function(response) {\n if (response.data != null && response.data.message != null) alert(response.data.message);\n if (response.success) return location.reload();\n }).fail(function() {\n // connection error\n return alert(sv_wc_payment_gateway_admin_order.capture_error);\n }).always(function() {\n // never leave the UI blocked\n return $('#woocommerce-order-items').unblock();\n });\n }\n };\n return window.sv_wc_payment_gateway_admin_order_add_capture_events();\n });\n}).call(module.exports);\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-admin-order.js.map\n","###\n WooCommerce SkyVerge Payment Gateway Framework Order Admin CoffeeScript\n Version 5.0.0\n\n Copyright (c) 2017-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\n\njQuery ( $ ) ->\n\t\"use strict\"\n\n\tsv_wc_payment_gateway_admin_order = window.sv_wc_payment_gateway_admin_order ? {}\n\twoocommerce_admin = window.woocommerce_admin ? {}\n\twoocommerce_admin_meta_boxes = window.woocommerce_admin_meta_boxes ? {}\n\taccounting = window.accounting ? {}\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events = () ->\n\n\t\t# prevent the events to be attached again\n\t\tif ( $( '.sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events' ).length )\n\t\t\treturn\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).addClass( 'sv-wc-payment-gateway-partial-capture-with-events' ).appendTo( '#woocommerce-order-items .inside' )\n\n\t\t$( '#woocommerce-order-items' ).on 'click', '.sv-wc-payment-gateway-capture:not(.disabled)', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tif ( $( @ ).hasClass( 'partial-capture' ) )\n\n\t\t\t\t$( 'div.sv-wc-payment-gateway-partial-capture' ).slideDown();\n\t\t\t\t$( 'div.wc-order-data-row-toggle' ).not( 'div.sv-wc-payment-gateway-partial-capture' ).slideUp();\n\t\t\t\t$( 'div.wc-order-totals-items' ).slideUp();\n\n\t\t\telse\n\n\t\t\t\tsubmitCapture()\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'change keyup', '#capture_amount', ( e ) ->\n\n\t\t\ttotal = accounting.unformat( $( @ ).val(), woocommerce_admin.mon_decimal_point );\n\n\t\t\tif ( total )\n\t\t\t\t$( 'button.capture-action' ).removeAttr( 'disabled' )\n\t\t\telse\n\t\t\t\t$( 'button.capture-action' ).attr( 'disabled', 'disabled' )\n\n\t\t\t$( 'button .capture-amount .amount' ).text( accounting.formatMoney( total, {\n\t\t\t\tsymbol: woocommerce_admin_meta_boxes.currency_format_symbol,\n\t\t\t\tdecimal: woocommerce_admin_meta_boxes.currency_format_decimal_sep,\n\t\t\t\tthousand: woocommerce_admin_meta_boxes.currency_format_thousand_sep,\n\t\t\t\tprecision: woocommerce_admin_meta_boxes.currency_format_num_decimals,\n\t\t\t\tformat: woocommerce_admin_meta_boxes.currency_format\n\t\t\t} ) )\n\n\n\t\t$( '.sv-wc-payment-gateway-partial-capture' ).on 'click', '.capture-action', ( e ) ->\n\n\t\t\te.preventDefault()\n\n\t\t\tamount = $( '.sv-wc-payment-gateway-partial-capture #capture_amount' ).val()\n\t\t\tcomment = $( '.sv-wc-payment-gateway-partial-capture #capture_comment' ).val()\n\n\t\t\tsubmitCapture( amount, comment )\n\n\tsubmitCapture = ( amount = '', comment = '' ) ->\n\n\t\tif ( confirm( sv_wc_payment_gateway_admin_order.capture_ays ) )\n\n\t\t\t$( '#woocommerce-order-items' ).block( {\n\t\t\t\tmessage: null\n\t\t\t\toverlayCSS: {\n\t\t\t\t\tbackground: '#fff'\n\t\t\t\t\topacity: 0.6\n\t\t\t\t}\n\t\t\t} )\n\n\t\t\tdata =\n\t\t\t\taction: sv_wc_payment_gateway_admin_order.capture_action\n\t\t\t\tnonce: sv_wc_payment_gateway_admin_order.capture_nonce\n\t\t\t\tgateway_id: sv_wc_payment_gateway_admin_order.gateway_id\n\t\t\t\torder_id: sv_wc_payment_gateway_admin_order.order_id\n\t\t\t\tamount: amount\n\t\t\t\tcomment: comment\n\n\t\t\t$.ajax(\n\t\t\t\turl: sv_wc_payment_gateway_admin_order.ajax_url\n\t\t\t\tdata: data\n\t\t\t).done( ( response ) ->\n\n\t\t\t\talert( response.data.message ) if response.data? and response.data.message?\n\n\t\t\t\tlocation.reload() if response.success\n\n\t\t\t).fail( ->\n\n\t\t\t\t# connection error\n\t\t\t\talert( sv_wc_payment_gateway_admin_order.capture_error )\n\n\t\t\t).always( ->\n\n\t\t\t\t# never leave the UI blocked\n\t\t\t\t$( '#woocommerce-order-items' ).unblock()\n\t\t\t)\n\n\twindow.sv_wc_payment_gateway_admin_order_add_capture_events()\n"],"names":["jQuery","$","accounting","ref","ref1","ref2","ref3","submitCapture","sv_wc_payment_gateway_admin_order","woocommerce_admin","woocommerce_admin_meta_boxes","window","sv_wc_payment_gateway_admin_order_add_capture_events","length","addClass","appendTo","on","e","preventDefault","hasClass","slideDown","not","slideUp","total","unformat","val","mon_decimal_point","removeAttr","attr","text","formatMoney","symbol","currency_format_symbol","decimal","currency_format_decimal_sep","thousand","currency_format_thousand_sep","precision","currency_format_num_decimals","format","currency_format","amount","comment","data","arguments","confirm","capture_ays","block","message","overlayCSS","background","opacity","action","capture_action","nonce","capture_nonce","gateway_id","order_id","ajax","url","ajax_url","done","response","alert","success","location","reload","fail","capture_error","always","unblock","call","module","exports"],"version":3,"file":"sv-wc-payment-gateway-admin-order.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js index 03343c371..5d039570d 100644 --- a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js +++ b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js @@ -1,4 +1,2 @@ -parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c'+a.actions.save.error+""),t(this).focus(),r=!0),o.unblock()):void 0})}),e=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(e),n||(n=a.i18n.general_error),t.find("th.actions").prepend(''+n+"")}})}).call(this); -},{}]},{},["YLvv"], null) -//# sourceMappingURL=../admin/sv-wc-payment-gateway-token-editor.js.map \ No newline at end of file +(function(){jQuery(function(t){var e,n,a;return a=null!=(n=window.wc_payment_gateway_token_editor)?n:{},t(".sv_wc_payment_gateway_token_editor").each(function(){return 0===t(this).find("tr.token").length?t(this).find("tr.no-tokens").show():t(this).find("tr.no-tokens").hide()}),t(".sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="remove"]',function(n){var o,r,i;if(n.preventDefault(),confirm(a.actions.remove_token.ays))return((r=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),r.find(".error").remove(),(i=t(this).closest("tr")).hasClass("new-token"))?(r.unblock(),i.remove()):(o={action:"wc_payment_gateway_"+r.data("gateway-id")+"_admin_remove_payment_token",user_id:t(this).data("user-id"),token_id:t(this).data("token-id"),security:a.actions.remove_token.nonce},t.post(a.ajax_url,o).done(function(n){return n.success?(t(i).remove(),0===r.find("tr.token").length)?r.find("tr.no-tokens").show():void 0:e(r,n.data)}).fail(function(t,n,a){return e(r,n+": "+a)}).always(function(){return r.unblock()}))}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="add-new"]',function(e){var n,o,r,i;return e.preventDefault(),(i=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),o=(n=i.find("tbody.tokens")).find("tr.token").length,r={action:"wc_payment_gateway_"+i.data("gateway-id")+"_admin_get_blank_payment_token",index:o+1,security:a.actions.add_token.nonce},t.post(a.ajax_url,r,function(t){return!0===t.success&&n.append(t.data),i.find("tr.no-tokens").hide(),i.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.button[data-action="refresh"]',function(n){var o,r,i;return n.preventDefault(),(i=t(this).closest("table")).block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),i.find(".error").remove(),(o=i.find("tbody.tokens")).find("tr.token").length,r={action:"wc_payment_gateway_"+i.data("gateway-id")+"_admin_refresh_payment_tokens",user_id:t(this).data("user-id"),security:a.actions.refresh.nonce},t.post(a.ajax_url,r).done(function(t){return t.success?null!=t.data?(i.find("tr.no-tokens").hide(),o.html(t.data)):(o.empty(),i.find("tr.no-tokens").show()):e(i,t.data)}).fail(function(t,n,a){return e(i,n+": "+a)}).always(function(){return i.unblock()})}),t("table.sv_wc_payment_gateway_token_editor").on("click",'.sv-wc-payment-gateway-token-editor-action-button[data-action="save"]',function(e){var n,o,r,i;return n=(o=t(this).closest("table")).find("tfoot th"),o.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),n.find(".error, .success").remove(),i=o.find('tbody.tokens tr.token input[type="text"]'),r=!1,i.each(function(i){var s,c,d;if(t(this).removeClass("error"),d=t(this).val(),c=t(this).prop("required"),s=t(this).attr("pattern"),(c||d)&&(!d.match(s)||c&&!d))return e.preventDefault(),t(this).addClass("error"),r||(n.prepend(''+a.actions.save.error+""),t(this).focus(),r=!0),o.unblock()})}),e=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(e),n||(n=a.i18n.general_error),t.find("th.actions").prepend(''+n+"")}})}).call(module.exports); +//# sourceMappingURL=sv-wc-payment-gateway-token-editor.js.map diff --git a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map index dd5674c40..194f18779 100644 --- a/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map +++ b/woocommerce/payment-gateway/assets/dist/admin/sv-wc-payment-gateway-token-editor.js.map @@ -1 +1 @@ -{"version":3,"sources":["admin/sv-wc-payment-gateway-token-editor.coffee"],"names":["jQuery","$","handleError","ref","wc_payment_gateway_token_editor","window","each","tokens","find","length","show","hide","on","e","data","editor","row","preventDefault","confirm","actions","remove_token","ays","closest","block","message","overlayCSS","background","opacity","remove","hasClass","unblock","action","user_id","token_id","security","nonce","post","ajax_url","done","response","success","fail","jqXHR","textStatus","error","always","body","count","index","add_token","append","refresh","html","empty","actions_row","focused","inputs","pattern","required","value","removeClass","val","prop","attr","match","addClass","prepend","save","focus","console","i18n","general_error","call"],"mappings":";CAAA,WASEA,OAAO,SAASC,GACd,aACIC,IAAAA,EAAaC,EAAKC,EA6JfF,OA5JPE,EAAoF,OAAjDD,EAAME,OAAOD,iCAA2CD,EAAM,GACjGF,EAAE,uCAAuCK,KAAK,WAGxCC,OAAkB,IADbN,EAAE,MAAMO,KAAK,YACXC,OACFR,EAAE,MAAMO,KAAK,gBAAgBE,OAE7BT,EAAE,MAAMO,KAAK,gBAAgBG,SAIxCV,EAAE,uCAAuCW,GAAG,QAAS,gCAAiC,SAASC,GACzFC,IAAAA,EAAMC,EAAQC,EAEd,GADJH,EAAEI,iBACGC,QAAQd,EAAgCe,QAAQC,aAAaC,KAc9DL,OAXJD,EAASd,EAAE,MAAMqB,QAAQ,UAClBC,MAAM,CACXC,QAAS,KACTC,WAAY,CACVC,WAAY,OACZC,QAAS,MAGbZ,EAAOP,KAAK,UAAUoB,UACtBZ,EAAMf,EAAE,MAAMqB,QAAQ,OAEdO,SAAS,cACfd,EAAOe,UACAd,EAAIY,WAEbd,EAAO,CACLiB,OAAQ,sBAAwBhB,EAAOD,KAAK,cAAgB,8BAC5DkB,QAAS/B,EAAE,MAAMa,KAAK,WACtBmB,SAAUhC,EAAE,MAAMa,KAAK,YACvBoB,SAAU9B,EAAgCe,QAAQC,aAAae,OAE1DlC,EAA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AA,UAAA,GAAA,UAAA,GAAA,GAK9CT,OAJPsD,QAAQzB,MAAMA,GACTpB,IACHA,EAAUpB,EAAgCkE,KAAKC,eAE1CxD,EAAOP,KAAK,cAAc0D,QAAQ,uBAAyB1C,EAAU,gBAI/EgD,KAAK","file":"sv-wc-payment-gateway-token-editor.js","sourceRoot":"../js","sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Token Editor CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */\n jQuery(function($) {\n \"use strict\";\n var handleError, ref, wc_payment_gateway_token_editor;\n wc_payment_gateway_token_editor = (ref = window.wc_payment_gateway_token_editor) != null ? ref : {};\n $('.sv_wc_payment_gateway_token_editor').each(function() {\n var tokens;\n tokens = $(this).find('tr.token');\n if (tokens.length === 0) {\n return $(this).find('tr.no-tokens').show();\n } else {\n return $(this).find('tr.no-tokens').hide();\n }\n });\n // Remove a token\n $('.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"remove\"]', function(e) {\n var data, editor, row;\n e.preventDefault();\n if (!confirm(wc_payment_gateway_token_editor.actions.remove_token.ays)) {\n return;\n }\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n editor.find('.error').remove();\n row = $(this).closest('tr');\n // if this is an unsaved token, just remove the row\n if (row.hasClass('new-token')) {\n editor.unblock();\n return row.remove();\n }\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_remove_payment_token',\n user_id: $(this).data('user-id'),\n token_id: $(this).data('token-id'),\n security: wc_payment_gateway_token_editor.actions.remove_token.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data).done((response) => {\n if (!response.success) {\n return handleError(editor, response.data);\n }\n $(row).remove();\n // no more tokens? Display a message\n if (editor.find('tr.token').length === 0) {\n return editor.find('tr.no-tokens').show();\n }\n }).fail((jqXHR, textStatus, error) => {\n return handleError(editor, textStatus + ': ' + error);\n }).always(() => {\n return editor.unblock();\n });\n });\n // Add a new (blank) token\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"add-new\"]', function(e) {\n var body, count, data, editor;\n e.preventDefault();\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n body = editor.find('tbody.tokens');\n count = body.find('tr.token').length;\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_get_blank_payment_token',\n index: count + 1,\n security: wc_payment_gateway_token_editor.actions.add_token.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data, function(response) {\n if (response.success === true) {\n body.append(response.data);\n }\n editor.find('tr.no-tokens').hide();\n return editor.unblock();\n });\n });\n // Refresh the tokens\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"refresh\"]', function(e) {\n var body, count, data, editor;\n e.preventDefault();\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n editor.find('.error').remove();\n body = editor.find('tbody.tokens');\n count = body.find('tr.token').length;\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_refresh_payment_tokens',\n user_id: $(this).data('user-id'),\n security: wc_payment_gateway_token_editor.actions.refresh.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data).done((response) => {\n if (!response.success) {\n return handleError(editor, response.data);\n }\n if (response.data != null) {\n editor.find('tr.no-tokens').hide();\n return body.html(response.data);\n } else {\n body.empty();\n return editor.find('tr.no-tokens').show();\n }\n }).fail((jqXHR, textStatus, error) => {\n return handleError(editor, textStatus + ': ' + error);\n }).always(() => {\n return editor.unblock();\n });\n });\n // Save the tokens\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.sv-wc-payment-gateway-token-editor-action-button[data-action=\"save\"]', function(e) {\n var actions_row, editor, focused, inputs;\n editor = $(this).closest('table');\n actions_row = editor.find('tfoot th');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n actions_row.find('.error, .success').remove();\n inputs = editor.find('tbody.tokens tr.token input[type=\"text\"]');\n focused = false;\n return inputs.each(function(index) {\n var pattern, required, value;\n $(this).removeClass('error');\n value = $(this).val();\n required = $(this).prop('required');\n pattern = $(this).attr('pattern');\n if (!(required || value)) {\n return;\n }\n if (!value.match(pattern) || (required && !value)) {\n e.preventDefault();\n $(this).addClass('error');\n if (!focused) {\n actions_row.prepend('' + wc_payment_gateway_token_editor.actions.save.error + '');\n $(this).focus();\n focused = true;\n }\n return editor.unblock();\n }\n });\n });\n // Handles any AJAX errors.\n\n // @since 5.1.0\n return handleError = function(editor, error, message = '') {\n console.error(error);\n if (!message) {\n message = wc_payment_gateway_token_editor.i18n.general_error;\n }\n return editor.find('th.actions').prepend('' + message + '');\n };\n });\n\n}).call(this);\n"]} \ No newline at end of file +{"mappings":"ACOG,CAAA,WACH,OAAO,SAAE,CAAF,EACP,IAAA,EAAA,EAAA,EA4KC,OA1KA,EAAA,AAAA,MAAA,CAAA,EAAA,OAAA,+BAAA,AAAA,EAAA,EAA2E,CAAA,EAG3E,EAAG,uCAAwC,IAA3C,CAAgD,kBAI/C,AAAK,AAAiB,IAAjB,AAFI,EAAG,IAAH,EAAU,IAAV,CAAgB,YAEb,MAAP,CACJ,EAAG,IAAH,EAAU,IAAV,CAAgB,gBAAiB,IAAjC,GAEA,EAAG,IAAH,EAAU,IAAV,CAAgB,gBAAiB,IAAjC,EAP8C,GAWhD,EAAG,uCAAwC,EAA3C,CAA8C,QAAS,gCAAiC,SAAE,CAAF,EAEzF,IAAA,EAAA,EAAA,EAEE,GAFA,EAAE,cAAF,GAEc,QAAS,EAAgC,OAAO,CAAC,YAAY,CAAC,GAA9D,QAWd,CAPA,AAFA,CAAA,EAAS,EAAG,IAAH,EAAU,OAAV,CAAmB,QAA5B,EAEO,KA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AAe,OAA5B,CAAqC,uBAAyB,EAAU,UAN3D,CA7KR,E,C,E,I,C,O,O","sources":["","woocommerce/payment-gateway/assets/js/admin/sv-wc-payment-gateway-token-editor.coffee"],"sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Token Editor CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */ jQuery(function($) {\n \"use strict\";\n var handleError, ref, wc_payment_gateway_token_editor;\n wc_payment_gateway_token_editor = (ref = window.wc_payment_gateway_token_editor) != null ? ref : {};\n $('.sv_wc_payment_gateway_token_editor').each(function() {\n var tokens;\n tokens = $(this).find('tr.token');\n if (tokens.length === 0) return $(this).find('tr.no-tokens').show();\n else return $(this).find('tr.no-tokens').hide();\n });\n // Remove a token\n $('.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"remove\"]', function(e) {\n var data, editor, row;\n e.preventDefault();\n if (!confirm(wc_payment_gateway_token_editor.actions.remove_token.ays)) return;\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n editor.find('.error').remove();\n row = $(this).closest('tr');\n // if this is an unsaved token, just remove the row\n if (row.hasClass('new-token')) {\n editor.unblock();\n return row.remove();\n }\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_remove_payment_token',\n user_id: $(this).data('user-id'),\n token_id: $(this).data('token-id'),\n security: wc_payment_gateway_token_editor.actions.remove_token.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data).done(function(response) {\n if (!response.success) return handleError(editor, response.data);\n $(row).remove();\n // no more tokens? Display a message\n if (editor.find('tr.token').length === 0) return editor.find('tr.no-tokens').show();\n }).fail(function(jqXHR, textStatus, error) {\n return handleError(editor, textStatus + ': ' + error);\n }).always(function() {\n return editor.unblock();\n });\n });\n // Add a new (blank) token\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"add-new\"]', function(e) {\n var body, count, data, editor;\n e.preventDefault();\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n body = editor.find('tbody.tokens');\n count = body.find('tr.token').length;\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_get_blank_payment_token',\n index: count + 1,\n security: wc_payment_gateway_token_editor.actions.add_token.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data, function(response) {\n if (response.success === true) body.append(response.data);\n editor.find('tr.no-tokens').hide();\n return editor.unblock();\n });\n });\n // Refresh the tokens\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.button[data-action=\"refresh\"]', function(e) {\n var body, count, data, editor;\n e.preventDefault();\n editor = $(this).closest('table');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n editor.find('.error').remove();\n body = editor.find('tbody.tokens');\n count = body.find('tr.token').length;\n data = {\n action: 'wc_payment_gateway_' + editor.data('gateway-id') + '_admin_refresh_payment_tokens',\n user_id: $(this).data('user-id'),\n security: wc_payment_gateway_token_editor.actions.refresh.nonce\n };\n return $.post(wc_payment_gateway_token_editor.ajax_url, data).done(function(response) {\n if (!response.success) return handleError(editor, response.data);\n if (response.data != null) {\n editor.find('tr.no-tokens').hide();\n return body.html(response.data);\n } else {\n body.empty();\n return editor.find('tr.no-tokens').show();\n }\n }).fail(function(jqXHR, textStatus, error) {\n return handleError(editor, textStatus + ': ' + error);\n }).always(function() {\n return editor.unblock();\n });\n });\n // Save the tokens\n $('table.sv_wc_payment_gateway_token_editor').on('click', '.sv-wc-payment-gateway-token-editor-action-button[data-action=\"save\"]', function(e) {\n var actions_row, editor, focused, inputs;\n editor = $(this).closest('table');\n actions_row = editor.find('tfoot th');\n editor.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n actions_row.find('.error, .success').remove();\n inputs = editor.find('tbody.tokens tr.token input[type=\"text\"]');\n focused = false;\n return inputs.each(function(index) {\n var pattern, required, value;\n $(this).removeClass('error');\n value = $(this).val();\n required = $(this).prop('required');\n pattern = $(this).attr('pattern');\n if (!(required || value)) return;\n if (!value.match(pattern) || required && !value) {\n e.preventDefault();\n $(this).addClass('error');\n if (!focused) {\n actions_row.prepend('' + wc_payment_gateway_token_editor.actions.save.error + '');\n $(this).focus();\n focused = true;\n }\n return editor.unblock();\n }\n });\n });\n // Handles any AJAX errors.\n // @since 5.1.0\n return handleError = function handleError(editor, error) {\n var message = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : '';\n console.error(error);\n if (!message) message = wc_payment_gateway_token_editor.i18n.general_error;\n return editor.find('th.actions').prepend('' + message + '');\n };\n });\n}).call(module.exports);\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-token-editor.js.map\n","###\n WooCommerce SkyVerge Payment Gateway Framework Token Editor CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\twc_payment_gateway_token_editor = window.wc_payment_gateway_token_editor ? {}\n\n\n\t$( '.sv_wc_payment_gateway_token_editor' ).each () ->\n\n\t\ttokens = $( this ).find( 'tr.token' )\n\n\t\tif ( tokens.length is 0 )\n\t\t\t$( this ).find( 'tr.no-tokens' ).show()\n\t\telse\n\t\t\t$( this ).find( 'tr.no-tokens' ).hide()\n\n\n\t# Remove a token\n\t$( '.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"remove\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\treturn unless confirm( wc_payment_gateway_token_editor.actions.remove_token.ays )\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\teditor.find( '.error' ).remove()\n\n\t\trow = $( this ).closest( 'tr' )\n\n\t\t# if this is an unsaved token, just remove the row\n\t\tif row.hasClass( 'new-token' )\n\t\t\teditor.unblock()\n\t\t\treturn row.remove()\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_remove_payment_token'\n\t\t\tuser_id: $( this ).data( 'user-id' )\n\t\t\ttoken_id: $( this ).data( 'token-id' )\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.remove_token.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data\n\n\t\t\t.done ( response ) =>\n\n\t\t\t\treturn handleError( editor, response.data ) unless response.success\n\n\t\t\t\t$( row ).remove()\n\n\t\t\t\t# no more tokens? Display a message\n\t\t\t\tif ( editor.find( 'tr.token' ).length is 0 )\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).show()\n\n\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\thandleError( editor, textStatus + ': ' + error )\n\n\t\t\t.always =>\n\n\t\t\t\teditor.unblock()\n\n\n\n\n\t# Add a new (blank) token\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"add-new\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\tbody = editor.find( 'tbody.tokens' )\n\t\tcount = body.find( 'tr.token' ).length\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_get_blank_payment_token'\n\t\t\tindex: count + 1\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.add_token.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data, ( response ) ->\n\n\t\t\tif response.success is true then body.append( response.data )\n\n\t\t\teditor.find( 'tr.no-tokens' ).hide()\n\n\t\t\teditor.unblock()\n\n\n\t# Refresh the tokens\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.button[data-action=\"refresh\"]', ( e ) ->\n\n\t\te.preventDefault()\n\n\t\teditor = $( this ).closest( 'table' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\teditor.find( '.error' ).remove()\n\n\t\tbody = editor.find( 'tbody.tokens' )\n\t\tcount = body.find( 'tr.token' ).length\n\n\t\tdata =\n\t\t\taction: 'wc_payment_gateway_' + editor.data( 'gateway-id' ) + '_admin_refresh_payment_tokens'\n\t\t\tuser_id: $( this ).data( 'user-id' )\n\t\t\tsecurity: wc_payment_gateway_token_editor.actions.refresh.nonce\n\n\t\t$.post wc_payment_gateway_token_editor.ajax_url, data\n\n\t\t\t.done ( response ) =>\n\n\t\t\t\treturn handleError( editor, response.data ) unless response.success\n\n\t\t\t\tif response.data?\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).hide()\n\t\t\t\t\tbody.html( response.data )\n\t\t\t\telse\n\t\t\t\t\tbody.empty()\n\t\t\t\t\teditor.find( 'tr.no-tokens' ).show()\n\n\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\thandleError( editor, textStatus + ': ' + error )\n\n\t\t\t.always =>\n\n\t\t\t\teditor.unblock()\n\n\t# Save the tokens\n\t$( 'table.sv_wc_payment_gateway_token_editor' ).on 'click', '.sv-wc-payment-gateway-token-editor-action-button[data-action=\"save\"]', ( e ) ->\n\n\t\teditor = $( this ).closest( 'table' )\n\t\tactions_row = editor.find( 'tfoot th' )\n\n\t\teditor.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\t\tactions_row.find( '.error, .success' ).remove();\n\n\t\t# Validate the input data\n\n\t\tinputs = editor.find( 'tbody.tokens tr.token input[type=\"text\"]' )\n\t\tfocused = false\n\n\t\tinputs.each ( index ) ->\n\n\t\t\t$( this ).removeClass( 'error' )\n\n\t\t\tvalue = $( this ).val()\n\t\t\trequired = $( this ).prop( 'required' )\n\t\t\tpattern = $( this ).attr( 'pattern' )\n\n\t\t\treturn unless required or value\n\n\t\t\tif ( ! value.match( pattern ) or ( required and ! value ) )\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\t$( this ).addClass( 'error' )\n\n\t\t\t\tif ( ! focused )\n\t\t\t\t\tactions_row.prepend( '' + wc_payment_gateway_token_editor.actions.save.error + '' )\n\t\t\t\t\t$( this ).focus()\n\t\t\t\t\tfocused = true\n\n\t\t\t\teditor.unblock()\n\n\n\t# Handles any AJAX errors.\n\t#\n\t# @since 5.1.0\n\thandleError = ( editor, error, message = '' ) ->\n\n\t\tconsole.error error\n\n\t\tmessage = wc_payment_gateway_token_editor.i18n.general_error unless message\n\n\t\teditor.find( 'th.actions' ).prepend( '' + message + '' )\n"],"names":["jQuery","$","handleError","ref","wc_payment_gateway_token_editor","window","each","tokens","find","length","show","hide","on","e","data","editor","row","preventDefault","confirm","actions","remove_token","ays","closest","block","message","overlayCSS","background","opacity","remove","hasClass","unblock","action","user_id","token_id","security","nonce","post","ajax_url","done","response","success","fail","jqXHR","textStatus","error","always","body","count","index","add_token","append","refresh","html","empty","actions_row","focused","inputs","pattern","required","value","removeClass","val","prop","attr","match","addClass","prepend","save","focus","arguments","console","i18n","general_error","call","module","exports"],"version":3,"file":"sv-wc-payment-gateway-token-editor.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js index 2e7e932b9..b334b2ad5 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js @@ -1,4 +1,2 @@ -parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{};return this.block_ui(),this.get_payment_request(n).then(function(n){return e(t.button).show(),e(t.wrapper).show(),t.payment_request=JSON.parse(n),t.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),e(t.button).hide(),1===e(t.container).children().length&&e(t.wrapper).hide(),t.unblock_ui()})}},{key:"get_payment_request",value:function(t){var n=this;return new Promise(function(i,o){var a;return a={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},e.extend(t,a),e.post(n.ajax_url,t,function(e){return e.success?i(e.data):o(e.data)})})}},{key:"render_errors",value:function(t){return e(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('
  • '+t.join("
  • ")+"
"),this.ui_element.removeClass("processing").unblock(),e("html, body").animate({scrollTop:this.ui_element.offset().top-100},1e3)}},{key:"block_ui",value:function(){return this.ui_element.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.ui_element.unblock()}}])}(),e(document.body).trigger("sv_wc_apple_pay_handler_v5_15_5_loaded")})}).call(this); -},{}]},{},["L57g"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-apple-pay.js.map \ No newline at end of file +function e(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},i={},a=t.parcelRequire94c2;null==a&&((a=function(e){if(e in n)return n[e].exports;if(e in i){var t=i[e];delete i[e];var a={id:e,exports:{}};return n[e]=a,t.call(a.exports,a,a.exports),a.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){i[e]=t},t.parcelRequire94c2=a);var o=a.register;o("guLUH",function(t,n){e(t.exports,"_",function(){return i});function i(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}}),o("90XvN",function(t,n){function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return this.block_ui(),this.get_payment_request(n).then(function(n){return e(t.button).show(),e(t.wrapper).show(),t.payment_request=JSON.parse(n),t.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),e(t.button).hide(),1===e(t.container).children().length&&e(t.wrapper).hide(),t.unblock_ui()})}},{key:"get_payment_request",value:function(t){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},e.extend(t,o),e.post(n.ajax_url,t,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(t){return e(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('
  • '+t.join("
  • ")+"
"),this.ui_element.removeClass("processing").unblock(),e("html, body").animate({scrollTop:this.ui_element.offset().top-100},1e3)}},{key:"block_ui",value:function(){return this.ui_element.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.ui_element.unblock()}}]),t}(),e(document.body).trigger("sv_wc_apple_pay_handler_v5_15_5_loaded")})}).call(void 0); +//# sourceMappingURL=sv-wc-payment-gateway-apple-pay.js.map diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map index 5fd3d094c..9552f3132 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-apple-pay.js.map @@ -1 +1 @@ -{"version":3,"sources":["frontend/sv-wc-payment-gateway-apple-pay.coffee"],"names":["jQuery","$","window","SV_WC_Apple_Pay_Handler_v5_15_5","args","init_product_page","bind","init_cart_page","init_checkout_page","on_validate_merchant","validate_merchant","on_payment_method_selected","on_shipping_contact_selected","on_shipping_method_selected","on_payment_authorized","process_authorization","on_cancel_payment","reset_payment_request","get_payment_request","gateway_id","gateway_slug","merchant_id","ajax_url","validate_nonce","recalculate_totals_nonce","process_nonce","payment_request","generic_error","wrapper","container","button","ApplePaySession","canMakePaymentsWithActiveCard","then","canMakePayments","children","length","hide","is_available","ui_element","show","document","body","on","e","error","preventDefault","block_ui","session","get_new_session","onvalidatemerchant","event","onpaymentmethodselected","onshippingcontactselected","onshippingmethodselected","onpaymentauthorized","oncancel","begin","error1","fail_payment","parents","get_sdk_version","validationURL","merchant_session","JSON","parse","completeMerchantValidation","response","abort","message","url","Promise","resolve","reject","data","post","success","completePaymentMethodSelection","total","line_items","console","lineItems","shippingContact","completeShippingContactSelection","STATUS_SUCCESS","shipping_methods","STATUS_FAILURE","shippingMethod","identifier","completeShippingMethodSelection","payment","set_payment_status","complete_purchase","action","nonce","stringify","unblock_ui","location","redirect","render_errors","status","completePayment","base_data","extend","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger","call"],"mappings":";AAAA,SAAA,EAAA,GAAA,OAAA,EAAA,mBAAA,QAAA,iBAAA,OAAA,SAAA,SAAA,GAAA,cAAA,GAAA,SAAA,GAAA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,IAAA,GAAA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA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YAhXjC,CAAA,IAAA,gBAyXE,MAAA,SAAc8B,GAQLvG,OANPA,EAAE,4CAA4CwG,SAEzClE,KAAAA,WAAWmE,QAAQ,qCAAuCF,EAAOG,KAAK,aAAe,cAErFpE,KAAAA,WAAWqE,YAAY,cAAcC,UAEnC5G,EAAE,cAAc6G,QAAQ,CAC7BC,UAAW,KAAKxE,WAAWyE,SAASC,IAAM,KACzC,OAnYP,CAAA,IAAA,WAyYE,MAAA,WACS,OAAA,KAAK1E,WAAW2E,MAAM,CAC3B7C,QAAS,KACT8C,WAAY,CACVC,WAAY,OACZC,QAAS,QA9YjB,CAAA,IAAA,aAsZE,MAAA,WACS,OAAA,KAAK9E,WAAWsE,cAvZ3B,GA4ZO5G,EAAEwC,SAASC,MAAM4E,QAAQ,8CAGjCC,KAAK","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["(function() {\n /*\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */\n jQuery(function($) {\n \"use strict\";\n // The WooCommerce Apple Pay handler base class.\n\n // @since 4.7.0\n window.SV_WC_Apple_Pay_Handler_v5_15_5 = class SV_WC_Apple_Pay_Handler_v5_15_5 {\n // Constructs the handler.\n\n // @since 4.7.0\n constructor(args) {\n // Initializes the product page.\n\n // @since 5.6.0\n this.init_product_page = this.init_product_page.bind(this);\n // Initializes the cart page.\n\n // @since 5.6.0\n this.init_cart_page = this.init_cart_page.bind(this);\n // Initializes the checkout page.\n\n // @since 5.6.0\n this.init_checkout_page = this.init_checkout_page.bind(this);\n // The callback for after the merchant data is validated.\n\n // @since 4.7.0\n this.on_validate_merchant = this.on_validate_merchant.bind(this);\n // Validates the merchant data.\n\n // @since 4.7.0\n // @return object\n this.validate_merchant = this.validate_merchant.bind(this);\n // Fires after a payment method has been selected.\n\n // @since 4.7.0\n this.on_payment_method_selected = this.on_payment_method_selected.bind(this);\n // Fires after a shipping contact has been selected.\n\n // @since 4.7.0\n this.on_shipping_contact_selected = this.on_shipping_contact_selected.bind(this);\n // Fires after a shipping method has been selected.\n\n // @since 4.7.0\n this.on_shipping_method_selected = this.on_shipping_method_selected.bind(this);\n // The callback for after the payment data is authorized.\n\n // @since 4.7.0\n this.on_payment_authorized = this.on_payment_authorized.bind(this);\n // Processes the transaction data.\n\n // @since 4.7.0\n this.process_authorization = this.process_authorization.bind(this);\n // The callback for when the payment card is cancelled/dismissed.\n\n // @since 4.7.0\n this.on_cancel_payment = this.on_cancel_payment.bind(this);\n // Resets the payment request via AJAX.\n\n // Extending handlers can call this on change events to refresh the data.\n\n // @since 4.7.0\n this.reset_payment_request = this.reset_payment_request.bind(this);\n // Gets the payment request via AJAX.\n\n // @since 4.7.0\n this.get_payment_request = this.get_payment_request.bind(this);\n this.gateway_id = args.gateway_id;\n this.gateway_slug = args.gateway_slug;\n this.merchant_id = args.merchant_id;\n this.ajax_url = args.ajax_url;\n this.validate_nonce = args.validate_nonce;\n this.recalculate_totals_nonce = args.recalculate_totals_nonce;\n this.process_nonce = args.process_nonce;\n this.payment_request = args.payment_request;\n this.generic_error = args.generic_error;\n this.wrapper = '.sv-wc-external-checkout';\n this.container = '.buttons-container';\n this.button = '.sv-wc-apple-pay-button';\n }\n\n // Determines if Apple Pay is available.\n\n // @since 4.7.0\n // @return bool\n is_available() {\n if (!window.ApplePaySession) {\n return false;\n }\n return ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then((canMakePayments) => {\n return canMakePayments;\n });\n }\n\n // Initializes the handler.\n\n // @since 4.7.0\n init() {\n // hide the wrapper if Apple Pay is the only button\n if ($(this.container).children().length === 1) {\n $(this.wrapper).hide();\n }\n if (!this.is_available()) {\n return;\n }\n // initialize for the various pages\n if ($('form.cart').length) {\n this.init_product_page();\n } else if ($('form.woocommerce-cart-form').length) {\n this.init_cart_page();\n } else if ($('form.woocommerce-checkout').length) {\n this.init_checkout_page();\n }\n // bail if no UI was initialized\n if (!this.ui_element) {\n return;\n }\n if (this.payment_request) {\n $(this.button).show();\n $(this.wrapper).show();\n }\n return $(document.body).on('click', '.sv-wc-apple-pay-button', (e) => {\n var error;\n e.preventDefault();\n this.block_ui();\n try {\n this.session = this.get_new_session(this.payment_request);\n // set the payment card events\n this.session.onvalidatemerchant = (event) => {\n return this.on_validate_merchant(event);\n };\n this.session.onpaymentmethodselected = (event) => {\n return this.on_payment_method_selected(event);\n };\n this.session.onshippingcontactselected = (event) => {\n return this.on_shipping_contact_selected(event);\n };\n this.session.onshippingmethodselected = (event) => {\n return this.on_shipping_method_selected(event);\n };\n this.session.onpaymentauthorized = (event) => {\n return this.on_payment_authorized(event);\n };\n this.session.oncancel = (event) => {\n return this.on_cancel_payment(event);\n };\n return this.session.begin();\n } catch (error1) {\n error = error1;\n return this.fail_payment(error);\n }\n });\n }\n\n init_product_page() {\n return this.ui_element = $('form.cart');\n }\n\n init_cart_page() {\n this.ui_element = $('form.woocommerce-cart-form').parents('div.woocommerce');\n // re-init if the cart totals are updated\n return $(document.body).on('updated_cart_totals', () => {\n return this.reset_payment_request();\n });\n }\n\n init_checkout_page() {\n this.ui_element = $('form.woocommerce-checkout');\n return $(document.body).on('updated_checkout', () => {\n // re-init if the checkout is updated\n return this.reset_payment_request();\n });\n }\n\n // Gets a new Apple Pay session.\n\n // @since 5.6.0\n\n // @param [Object] payment_request payment request object\n // @return ApplePaySession\n get_new_session(payment_request) {\n return new ApplePaySession(this.get_sdk_version(), payment_request);\n }\n\n // Gets the Apple SDK version to use.\n\n // @since 5.6.0\n // @return int\n get_sdk_version() {\n return 2;\n }\n\n on_validate_merchant(event) {\n return this.validate_merchant(event.validationURL).then((merchant_session) => {\n merchant_session = JSON.parse(merchant_session);\n return this.session.completeMerchantValidation(merchant_session);\n }, (response) => {\n this.session.abort();\n return this.fail_payment('Merchant could no be validated. ' + response.message);\n });\n }\n\n validate_merchant(url) {\n return new Promise((resolve, reject) => {\n var data;\n data = {\n 'action': `wc_${this.gateway_id}_apple_pay_validate_merchant`,\n 'nonce': this.validate_nonce,\n 'merchant_id': this.merchant_id,\n 'url': url\n };\n // retrieve a payment request object\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n return resolve(response.data);\n } else {\n return reject(response.data);\n }\n });\n });\n }\n\n on_payment_method_selected(event) {\n return new Promise((resolve, reject) => {\n var data;\n data = {\n 'action': `wc_${this.gateway_id}_apple_pay_recalculate_totals`,\n 'nonce': this.recalculate_totals_nonce\n };\n // retrieve a payment request object\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n data = response.data;\n return resolve(this.session.completePaymentMethodSelection(data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message);\n return reject(this.session.completePaymentMethodSelection(this.payment_request.total, this.payment_request.lineItems));\n }\n });\n });\n }\n\n on_shipping_contact_selected(event) {\n return new Promise((resolve, reject) => {\n var data;\n data = {\n 'action': `wc_${this.gateway_id}_apple_pay_recalculate_totals`,\n 'nonce': this.recalculate_totals_nonce,\n 'contact': event.shippingContact\n };\n // retrieve a payment request object\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n data = response.data;\n return resolve(this.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message);\n return reject(this.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE, [], this.payment_request.total, this.payment_request.lineItems));\n }\n });\n });\n }\n\n on_shipping_method_selected(event) {\n return new Promise((resolve, reject) => {\n var data;\n data = {\n 'action': `wc_${this.gateway_id}_apple_pay_recalculate_totals`,\n 'nonce': this.recalculate_totals_nonce,\n 'method': event.shippingMethod.identifier\n };\n // retrieve a payment request object\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n data = response.data;\n return resolve(this.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS, data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping method. ' + response.data.message);\n return reject(this.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE, this.payment_request.total, this.payment_request.lineItems));\n }\n });\n });\n }\n\n on_payment_authorized(event) {\n return this.process_authorization(event.payment).then((response) => {\n this.set_payment_status(true);\n return this.complete_purchase(response);\n }, (response) => {\n this.set_payment_status(false);\n return this.fail_payment('Payment could no be processed. ' + response.message);\n });\n }\n\n process_authorization(payment) {\n return new Promise((resolve, reject) => {\n var data;\n data = {\n action: `wc_${this.gateway_id}_apple_pay_process_payment`,\n nonce: this.process_nonce,\n payment: JSON.stringify(payment)\n };\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n return resolve(response.data);\n } else {\n return reject(response.data);\n }\n });\n });\n }\n\n on_cancel_payment(event) {\n return this.unblock_ui();\n }\n\n // Completes the purchase based on the gateway result.\n\n // @since 4.7.0\n complete_purchase(response) {\n return window.location = response.redirect;\n }\n\n // Fails the purchase based on the gateway result.\n\n // @since 4.7.0\n fail_payment(error) {\n console.error('[Apple Pay] ' + error);\n this.unblock_ui();\n return this.render_errors([this.generic_error]);\n }\n\n // Sets the Apple Pay payment status depending on the gateway result.\n\n // @since 4.7.0\n set_payment_status(success) {\n var status;\n if (success) {\n status = ApplePaySession.STATUS_SUCCESS;\n } else {\n status = ApplePaySession.STATUS_FAILURE;\n }\n return this.session.completePayment(status);\n }\n\n reset_payment_request(data = {}) {\n this.block_ui();\n return this.get_payment_request(data).then((response) => {\n $(this.button).show();\n $(this.wrapper).show();\n this.payment_request = JSON.parse(response);\n return this.unblock_ui();\n }, (response) => {\n console.error('[Apple Pay] Could not build payment request. ' + response.message);\n $(this.button).hide();\n // hide the wrapper if Apple Pay is the only button\n if ($(this.container).children().length === 1) {\n $(this.wrapper).hide();\n }\n return this.unblock_ui();\n });\n }\n\n get_payment_request(data) {\n return new Promise((resolve, reject) => {\n var base_data;\n base_data = {\n 'action': `wc_${this.gateway_id}_apple_pay_get_payment_request`\n };\n $.extend(data, base_data);\n // retrieve a payment request object\n return $.post(this.ajax_url, data, (response) => {\n if (response.success) {\n return resolve(response.data);\n } else {\n return reject(response.data);\n }\n });\n });\n }\n\n // Renders any new errors and bring them into the viewport.\n\n // @since 4.7.0\n render_errors(errors) {\n // hide and remove any previous errors\n $('.woocommerce-error, .woocommerce-message').remove();\n // add errors\n this.ui_element.prepend('
  • ' + errors.join('
  • ') + '
');\n // unblock UI\n this.ui_element.removeClass('processing').unblock();\n // scroll to top\n return $('html, body').animate({\n scrollTop: this.ui_element.offset().top - 100\n }, 1000);\n }\n\n // Blocks the payment form UI.\n\n // @since 4.7.0\n block_ui() {\n return this.ui_element.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n\n // Unblocks the payment form UI.\n\n // @since 4.7.0\n unblock_ui() {\n return this.ui_element.unblock();\n }\n\n };\n // dispatch loaded event\n return $(document.body).trigger('sv_wc_apple_pay_handler_v5_15_5_loaded');\n });\n\n}).call(this);\n"]} \ No newline at end of file +{"mappings":"A,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,I,W,O,C,GCAA,SAAS,EAAkB,CAAQ,CAAE,CAAW,EAC5C,GAAI,CAAE,CAAA,aAAoB,CAAA,EAAc,MAAM,AAAI,UAAU,oCAChE,C,G,E,Q,S,C,C,C,ECFA,SAA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/helpers/esm/_class_call_check.js","node_modules/@swc/helpers/esm/_create_class.js","woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.coffee"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"guLUH\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c0249d4a3fc9bb83$export$71511d61b312f219; });\nfunction $c0249d4a3fc9bb83$export$71511d61b312f219(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\n});\n\nparcelRegister(\"90XvN\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $690246f0b6925227$export$71511d61b312f219; });\nfunction $690246f0b6925227$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction $690246f0b6925227$export$71511d61b312f219(Constructor, protoProps, staticProps) {\n if (protoProps) $690246f0b6925227$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $690246f0b6925227$var$_defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n});\n\n\nvar $guLUH = parcelRequire(\"guLUH\");\n\nvar $90XvN = parcelRequire(\"90XvN\");\n(function() {\n /*\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */ jQuery(function($) {\n \"use strict\";\n // The WooCommerce Apple Pay handler base class.\n // @since 4.7.0\n window.SV_WC_Apple_Pay_Handler_v5_15_5 = /*#__PURE__*/ function() {\n function SV_WC_Apple_Pay_Handler_v5_15_5(args) {\n (0, $guLUH._)(this, SV_WC_Apple_Pay_Handler_v5_15_5);\n // Initializes the product page.\n // @since 5.6.0\n this.init_product_page = this.init_product_page.bind(this);\n // Initializes the cart page.\n // @since 5.6.0\n this.init_cart_page = this.init_cart_page.bind(this);\n // Initializes the checkout page.\n // @since 5.6.0\n this.init_checkout_page = this.init_checkout_page.bind(this);\n // The callback for after the merchant data is validated.\n // @since 4.7.0\n this.on_validate_merchant = this.on_validate_merchant.bind(this);\n // Validates the merchant data.\n // @since 4.7.0\n // @return object\n this.validate_merchant = this.validate_merchant.bind(this);\n // Fires after a payment method has been selected.\n // @since 4.7.0\n this.on_payment_method_selected = this.on_payment_method_selected.bind(this);\n // Fires after a shipping contact has been selected.\n // @since 4.7.0\n this.on_shipping_contact_selected = this.on_shipping_contact_selected.bind(this);\n // Fires after a shipping method has been selected.\n // @since 4.7.0\n this.on_shipping_method_selected = this.on_shipping_method_selected.bind(this);\n // The callback for after the payment data is authorized.\n // @since 4.7.0\n this.on_payment_authorized = this.on_payment_authorized.bind(this);\n // Processes the transaction data.\n // @since 4.7.0\n this.process_authorization = this.process_authorization.bind(this);\n // The callback for when the payment card is cancelled/dismissed.\n // @since 4.7.0\n this.on_cancel_payment = this.on_cancel_payment.bind(this);\n // Resets the payment request via AJAX.\n // Extending handlers can call this on change events to refresh the data.\n // @since 4.7.0\n this.reset_payment_request = this.reset_payment_request.bind(this);\n // Gets the payment request via AJAX.\n // @since 4.7.0\n this.get_payment_request = this.get_payment_request.bind(this);\n this.gateway_id = args.gateway_id;\n this.gateway_slug = args.gateway_slug;\n this.merchant_id = args.merchant_id;\n this.ajax_url = args.ajax_url;\n this.validate_nonce = args.validate_nonce;\n this.recalculate_totals_nonce = args.recalculate_totals_nonce;\n this.process_nonce = args.process_nonce;\n this.payment_request = args.payment_request;\n this.generic_error = args.generic_error;\n this.wrapper = '.sv-wc-external-checkout';\n this.container = '.buttons-container';\n this.button = '.sv-wc-apple-pay-button';\n }\n (0, $90XvN._)(SV_WC_Apple_Pay_Handler_v5_15_5, [\n {\n // Determines if Apple Pay is available.\n // @since 4.7.0\n // @return bool\n key: \"is_available\",\n value: function is_available() {\n if (!window.ApplePaySession) return false;\n return ApplePaySession.canMakePaymentsWithActiveCard(this.merchant_id).then(function(canMakePayments) {\n return canMakePayments;\n });\n }\n },\n {\n // Initializes the handler.\n // @since 4.7.0\n key: \"init\",\n value: function init() {\n var _this = this;\n // hide the wrapper if Apple Pay is the only button\n if ($(this.container).children().length === 1) $(this.wrapper).hide();\n if (!this.is_available()) return;\n // initialize for the various pages\n if ($('form.cart').length) this.init_product_page();\n else if ($('form.woocommerce-cart-form').length) this.init_cart_page();\n else if ($('form.woocommerce-checkout').length) this.init_checkout_page();\n // bail if no UI was initialized\n if (!this.ui_element) return;\n if (this.payment_request) {\n $(this.button).show();\n $(this.wrapper).show();\n }\n return $(document.body).on('click', '.sv-wc-apple-pay-button', function(e) {\n var error;\n e.preventDefault();\n _this.block_ui();\n try {\n _this.session = _this.get_new_session(_this.payment_request);\n // set the payment card events\n _this.session.onvalidatemerchant = function(event) {\n return _this.on_validate_merchant(event);\n };\n _this.session.onpaymentmethodselected = function(event) {\n return _this.on_payment_method_selected(event);\n };\n _this.session.onshippingcontactselected = function(event) {\n return _this.on_shipping_contact_selected(event);\n };\n _this.session.onshippingmethodselected = function(event) {\n return _this.on_shipping_method_selected(event);\n };\n _this.session.onpaymentauthorized = function(event) {\n return _this.on_payment_authorized(event);\n };\n _this.session.oncancel = function(event) {\n return _this.on_cancel_payment(event);\n };\n return _this.session.begin();\n } catch (error1) {\n error = error1;\n return _this.fail_payment(error);\n }\n });\n }\n },\n {\n key: \"init_product_page\",\n value: function init_product_page() {\n return this.ui_element = $('form.cart');\n }\n },\n {\n key: \"init_cart_page\",\n value: function init_cart_page() {\n var _this = this;\n this.ui_element = $('form.woocommerce-cart-form').parents('div.woocommerce');\n // re-init if the cart totals are updated\n return $(document.body).on('updated_cart_totals', function() {\n return _this.reset_payment_request();\n });\n }\n },\n {\n key: \"init_checkout_page\",\n value: function init_checkout_page() {\n var _this = this;\n this.ui_element = $('form.woocommerce-checkout');\n return $(document.body).on('updated_checkout', function() {\n // re-init if the checkout is updated\n return _this.reset_payment_request();\n });\n }\n },\n {\n // Gets a new Apple Pay session.\n // @since 5.6.0\n // @param [Object] payment_request payment request object\n // @return ApplePaySession\n key: \"get_new_session\",\n value: function get_new_session(payment_request) {\n return new ApplePaySession(this.get_sdk_version(), payment_request);\n }\n },\n {\n // Gets the Apple SDK version to use.\n // @since 5.6.0\n // @return int\n key: \"get_sdk_version\",\n value: function get_sdk_version() {\n return 2;\n }\n },\n {\n key: \"on_validate_merchant\",\n value: function on_validate_merchant(event) {\n var _this = this;\n return this.validate_merchant(event.validationURL).then(function(merchant_session) {\n merchant_session = JSON.parse(merchant_session);\n return _this.session.completeMerchantValidation(merchant_session);\n }, function(response) {\n _this.session.abort();\n return _this.fail_payment('Merchant could no be validated. ' + response.message);\n });\n }\n },\n {\n key: \"validate_merchant\",\n value: function validate_merchant(url) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var data;\n data = {\n 'action': \"wc_\".concat(_this.gateway_id, \"_apple_pay_validate_merchant\"),\n 'nonce': _this.validate_nonce,\n 'merchant_id': _this.merchant_id,\n 'url': url\n };\n // retrieve a payment request object\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) return resolve(response.data);\n else return reject(response.data);\n });\n });\n }\n },\n {\n key: \"on_payment_method_selected\",\n value: function on_payment_method_selected(event) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var data;\n data = {\n 'action': \"wc_\".concat(_this.gateway_id, \"_apple_pay_recalculate_totals\"),\n 'nonce': _this.recalculate_totals_nonce\n };\n // retrieve a payment request object\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) {\n data = response.data;\n return resolve(_this.session.completePaymentMethodSelection(data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message);\n return reject(_this.session.completePaymentMethodSelection(_this.payment_request.total, _this.payment_request.lineItems));\n }\n });\n });\n }\n },\n {\n key: \"on_shipping_contact_selected\",\n value: function on_shipping_contact_selected(event) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var data;\n data = {\n 'action': \"wc_\".concat(_this.gateway_id, \"_apple_pay_recalculate_totals\"),\n 'nonce': _this.recalculate_totals_nonce,\n 'contact': event.shippingContact\n };\n // retrieve a payment request object\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) {\n data = response.data;\n return resolve(_this.session.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping contact. ' + response.data.message);\n return reject(_this.session.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE, [], _this.payment_request.total, _this.payment_request.lineItems));\n }\n });\n });\n }\n },\n {\n key: \"on_shipping_method_selected\",\n value: function on_shipping_method_selected(event) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var data;\n data = {\n 'action': \"wc_\".concat(_this.gateway_id, \"_apple_pay_recalculate_totals\"),\n 'nonce': _this.recalculate_totals_nonce,\n 'method': event.shippingMethod.identifier\n };\n // retrieve a payment request object\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) {\n data = response.data;\n return resolve(_this.session.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS, data.total, data.line_items));\n } else {\n console.error('[Apple Pay] Error selecting a shipping method. ' + response.data.message);\n return reject(_this.session.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE, _this.payment_request.total, _this.payment_request.lineItems));\n }\n });\n });\n }\n },\n {\n key: \"on_payment_authorized\",\n value: function on_payment_authorized(event) {\n var _this = this;\n return this.process_authorization(event.payment).then(function(response) {\n _this.set_payment_status(true);\n return _this.complete_purchase(response);\n }, function(response) {\n _this.set_payment_status(false);\n return _this.fail_payment('Payment could no be processed. ' + response.message);\n });\n }\n },\n {\n key: \"process_authorization\",\n value: function process_authorization(payment) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var data;\n data = {\n action: \"wc_\".concat(_this.gateway_id, \"_apple_pay_process_payment\"),\n nonce: _this.process_nonce,\n payment: JSON.stringify(payment)\n };\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) return resolve(response.data);\n else return reject(response.data);\n });\n });\n }\n },\n {\n key: \"on_cancel_payment\",\n value: function on_cancel_payment(event) {\n return this.unblock_ui();\n }\n },\n {\n // Completes the purchase based on the gateway result.\n // @since 4.7.0\n key: \"complete_purchase\",\n value: function complete_purchase(response) {\n return window.location = response.redirect;\n }\n },\n {\n // Fails the purchase based on the gateway result.\n // @since 4.7.0\n key: \"fail_payment\",\n value: function fail_payment(error) {\n console.error('[Apple Pay] ' + error);\n this.unblock_ui();\n return this.render_errors([\n this.generic_error\n ]);\n }\n },\n {\n // Sets the Apple Pay payment status depending on the gateway result.\n // @since 4.7.0\n key: \"set_payment_status\",\n value: function set_payment_status(success) {\n var status;\n if (success) status = ApplePaySession.STATUS_SUCCESS;\n else status = ApplePaySession.STATUS_FAILURE;\n return this.session.completePayment(status);\n }\n },\n {\n key: \"reset_payment_request\",\n value: function reset_payment_request() {\n var _this = this;\n var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n this.block_ui();\n return this.get_payment_request(data).then(function(response) {\n $(_this.button).show();\n $(_this.wrapper).show();\n _this.payment_request = JSON.parse(response);\n return _this.unblock_ui();\n }, function(response) {\n console.error('[Apple Pay] Could not build payment request. ' + response.message);\n $(_this.button).hide();\n // hide the wrapper if Apple Pay is the only button\n if ($(_this.container).children().length === 1) $(_this.wrapper).hide();\n return _this.unblock_ui();\n });\n }\n },\n {\n key: \"get_payment_request\",\n value: function get_payment_request(data) {\n var _this = this;\n return new Promise(function(resolve, reject) {\n var base_data;\n base_data = {\n 'action': \"wc_\".concat(_this.gateway_id, \"_apple_pay_get_payment_request\")\n };\n $.extend(data, base_data);\n // retrieve a payment request object\n return $.post(_this.ajax_url, data, function(response) {\n if (response.success) return resolve(response.data);\n else return reject(response.data);\n });\n });\n }\n },\n {\n // Renders any new errors and bring them into the viewport.\n // @since 4.7.0\n key: \"render_errors\",\n value: function render_errors(errors) {\n // hide and remove any previous errors\n $('.woocommerce-error, .woocommerce-message').remove();\n // add errors\n this.ui_element.prepend('
  • ' + errors.join('
  • ') + '
');\n // unblock UI\n this.ui_element.removeClass('processing').unblock();\n // scroll to top\n return $('html, body').animate({\n scrollTop: this.ui_element.offset().top - 100\n }, 1000);\n }\n },\n {\n // Blocks the payment form UI.\n // @since 4.7.0\n key: \"block_ui\",\n value: function block_ui() {\n return this.ui_element.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n },\n {\n // Unblocks the payment form UI.\n // @since 4.7.0\n key: \"unblock_ui\",\n value: function unblock_ui() {\n return this.ui_element.unblock();\n }\n }\n ]);\n return SV_WC_Apple_Pay_Handler_v5_15_5;\n }();\n // dispatch loaded event\n return $(document.body).trigger('sv_wc_apple_pay_handler_v5_15_5_loaded');\n });\n}).call(undefined);\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-apple-pay.js.map\n","function _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _class_call_check as _ };\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","###\n WooCommerce Apple Pay Handler\n Version 4.7.0\n\n Copyright (c) 2016, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\n\njQuery ( $ ) ->\n\n\t\"use strict\"\n\n\t# The WooCommerce Apple Pay handler base class.\n\t#\n\t# @since 4.7.0\n\tclass window.SV_WC_Apple_Pay_Handler_v5_15_5\n\n\n\t\t# Constructs the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tconstructor: (args) ->\n\n\t\t\t@gateway_id = args.gateway_id\n\t\t\t@gateway_slug = args.gateway_slug\n\t\t\t@merchant_id = args.merchant_id\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@validate_nonce = args.validate_nonce\n\t\t\t@recalculate_totals_nonce = args.recalculate_totals_nonce\n\t\t\t@process_nonce = args.process_nonce\n\t\t\t@payment_request = args.payment_request\n\t\t\t@generic_error = args.generic_error\n\n\t\t\t@wrapper = '.sv-wc-external-checkout'\n\t\t\t@container = '.buttons-container'\n\t\t\t@button = '.sv-wc-apple-pay-button'\n\n\n\t\t# Determines if Apple Pay is available.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return bool\n\t\tis_available: ->\n\n\t\t\treturn false unless window.ApplePaySession\n\n\t\t\tApplePaySession.canMakePaymentsWithActiveCard( @merchant_id ).then ( canMakePayments ) =>\n\n\t\t\t\treturn canMakePayments\n\n\n\t\t# Initializes the handler.\n\t\t#\n\t\t# @since 4.7.0\n\t\tinit: ->\n\n\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\tif $( @container ).children().length is 1\n\t\t\t\t$( @wrapper ).hide()\n\n\t\t\treturn unless this.is_available()\n\n\t\t\t# initialize for the various pages\n\t\t\tif $( 'form.cart' ).length\n\t\t\t\tthis.init_product_page()\n\t\t\telse if $( 'form.woocommerce-cart-form' ).length\n\t\t\t\tthis.init_cart_page()\n\t\t\telse if $( 'form.woocommerce-checkout' ).length\n\t\t\t\tthis.init_checkout_page()\n\n\t\t\t# bail if no UI was initialized\n\t\t\treturn unless @ui_element\n\n\t\t\tif @payment_request\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t$( document.body ).on 'click', '.sv-wc-apple-pay-button', ( e ) =>\n\n\t\t\t\te.preventDefault()\n\n\t\t\t\tthis.block_ui()\n\n\t\t\t\ttry\n\n\t\t\t\t\t@session = this.get_new_session( @payment_request )\n\n\t\t\t\t\t# set the payment card events\n\t\t\t\t\t@session.onvalidatemerchant = ( event ) => this.on_validate_merchant( event )\n\t\t\t\t\t@session.onpaymentmethodselected = ( event ) => this.on_payment_method_selected( event )\n\t\t\t\t\t@session.onshippingcontactselected = ( event ) => this.on_shipping_contact_selected( event )\n\t\t\t\t\t@session.onshippingmethodselected = ( event ) => this.on_shipping_method_selected( event )\n\t\t\t\t\t@session.onpaymentauthorized = ( event ) => this.on_payment_authorized( event )\n\t\t\t\t\t@session.oncancel = ( event ) => this.on_cancel_payment( event )\n\n\t\t\t\t\t@session.begin()\n\n\t\t\t\tcatch error\n\n\t\t\t\t\tthis.fail_payment( error )\n\n\n\t\t# Initializes the product page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_product_page: =>\n\n\t\t\t@ui_element = $( 'form.cart' )\n\n\n\t\t# Initializes the cart page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_cart_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' )\n\n\t\t\t# re-init if the cart totals are updated\n\t\t\t$( document.body ).on 'updated_cart_totals', =>\n\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Initializes the checkout page.\n\t\t#\n\t\t# @since 5.6.0\n\t\tinit_checkout_page: =>\n\n\t\t\t@ui_element = $( 'form.woocommerce-checkout' )\n\n\t\t\t$( document.body ).on 'updated_checkout', =>\n\n\t\t\t\t# re-init if the checkout is updated\n\t\t\t\tthis.reset_payment_request()\n\n\n\t\t# Gets a new Apple Pay session.\n\t\t#\n\t\t# @since 5.6.0\n\t\t#\n\t\t# @param [Object] payment_request payment request object\n\t\t# @return ApplePaySession\n\t\tget_new_session: ( payment_request ) ->\n\n\t\t\treturn new ApplePaySession( this.get_sdk_version(), payment_request )\n\n\n\t\t# Gets the Apple SDK version to use.\n\t\t#\n\t\t# @since 5.6.0\n\t\t# @return int\n\t\tget_sdk_version: ->\n\n\t\t\treturn 2\n\n\n\t\t# The callback for after the merchant data is validated.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_validate_merchant: ( event ) =>\n\n\t\t\tthis.validate_merchant( event.validationURL ).then ( merchant_session ) =>\n\n\t\t\t\tmerchant_session = JSON.parse( merchant_session )\n\n\t\t\t\t@session.completeMerchantValidation( merchant_session )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\t@session.abort()\n\n\t\t\t\tthis.fail_payment 'Merchant could no be validated. ' + response.message\n\n\n\t\t# Validates the merchant data.\n\t\t#\n\t\t# @since 4.7.0\n\t\t# @return object\n\t\tvalidate_merchant: ( url ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_validate_merchant\",\n\t\t\t\t'nonce': @validate_nonce,\n\t\t\t\t'merchant_id': @merchant_id,\n\t\t\t\t'url': url\n\t\t\t}\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Fires after a payment method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completePaymentMethodSelection( data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completePaymentMethodSelection( @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping contact has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_contact_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'contact': event.shippingContact\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingContactSelection( ApplePaySession.STATUS_SUCCESS, data.shipping_methods, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping contact. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingContactSelection( ApplePaySession.STATUS_FAILURE, [], @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# Fires after a shipping method has been selected.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_shipping_method_selected: ( event ) =>\n\n\t\t\tnew Promise ( resolve, reject ) =>\n\n\t\t\t\tdata = {\n\t\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_recalculate_totals\",\n\t\t\t\t\t'nonce': @recalculate_totals_nonce,\n\t\t\t\t\t'method': event.shippingMethod.identifier\n\t\t\t\t}\n\n\t\t\t\t# retrieve a payment request object\n\t\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\t\tif response.success\n\n\t\t\t\t\t\tdata = response.data\n\n\t\t\t\t\t\tresolve @session.completeShippingMethodSelection( ApplePaySession.STATUS_SUCCESS, data.total, data.line_items )\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\tconsole.error '[Apple Pay] Error selecting a shipping method. ' + response.data.message\n\n\t\t\t\t\t\treject @session.completeShippingMethodSelection( ApplePaySession.STATUS_FAILURE, @payment_request.total, @payment_request.lineItems )\n\n\n\t\t# The callback for after the payment data is authorized.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_payment_authorized: ( event ) =>\n\n\t\t\tthis.process_authorization( event.payment ).then ( response ) =>\n\n\t\t\t\tthis.set_payment_status( true )\n\n\t\t\t\tthis.complete_purchase( response )\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tthis.set_payment_status( false )\n\n\t\t\t\tthis.fail_payment 'Payment could no be processed. ' + response.message\n\n\n\t\t# Processes the transaction data.\n\t\t#\n\t\t# @since 4.7.0\n\t\tprocess_authorization: ( payment ) => new Promise ( resolve, reject ) =>\n\n\t\t\tdata = {\n\t\t\t\taction: \"wc_#{ @gateway_id }_apple_pay_process_payment\",\n\t\t\t\tnonce: @process_nonce,\n\t\t\t\tpayment: JSON.stringify( payment )\n\t\t\t}\n\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# The callback for when the payment card is cancelled/dismissed.\n\t\t#\n\t\t# @since 4.7.0\n\t\ton_cancel_payment: ( event ) =>\n\n\t\t\tthis.unblock_ui()\n\n\n\t\t# Completes the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tcomplete_purchase: ( response ) ->\n\n\t\t\twindow.location = response.redirect\n\n\n\t\t# Fails the purchase based on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tfail_payment: ( error ) ->\n\n\t\t\tconsole.error '[Apple Pay] ' + error\n\n\t\t\tthis.unblock_ui()\n\n\t\t\tthis.render_errors( [ @generic_error ] )\n\n\n\t\t# Sets the Apple Pay payment status depending on the gateway result.\n\t\t#\n\t\t# @since 4.7.0\n\t\tset_payment_status: ( success ) ->\n\n\t\t\tif success\n\t\t\t\tstatus = ApplePaySession.STATUS_SUCCESS\n\t\t\telse\n\t\t\t\tstatus = ApplePaySession.STATUS_FAILURE\n\n\t\t\t@session.completePayment( status )\n\n\n\t\t# Resets the payment request via AJAX.\n\t\t#\n\t\t# Extending handlers can call this on change events to refresh the data.\n\t\t#\n\t\t# @since 4.7.0\n\t\treset_payment_request: ( data = {} ) =>\n\n\t\t\tthis.block_ui()\n\n\t\t\tthis.get_payment_request( data ).then ( response ) =>\n\n\t\t\t\t$( @button ).show()\n\t\t\t\t$( @wrapper ).show()\n\n\t\t\t\t@payment_request = JSON.parse( response )\n\n\t\t\t\tthis.unblock_ui()\n\n\t\t\t, ( response ) =>\n\n\t\t\t\tconsole.error '[Apple Pay] Could not build payment request. ' + response.message\n\n\t\t\t\t$( @button ).hide()\n\t\t\t\t# hide the wrapper if Apple Pay is the only button\n\t\t\t\tif $( @container ).children().length is 1\n\t\t\t\t\t$( @wrapper ).hide()\n\n\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Gets the payment request via AJAX.\n\t\t#\n\t\t# @since 4.7.0\n\t\tget_payment_request: ( data ) => new Promise ( resolve, reject ) =>\n\n\t\t\tbase_data = {\n\t\t\t\t'action': \"wc_#{ @gateway_id }_apple_pay_get_payment_request\"\n\t\t\t}\n\n\t\t\t$.extend data, base_data\n\n\t\t\t# retrieve a payment request object\n\t\t\t$.post @ajax_url, data, ( response ) =>\n\n\t\t\t\tif response.success\n\t\t\t\t\tresolve response.data\n\t\t\t\telse\n\t\t\t\t\treject response.data\n\n\n\t\t# Renders any new errors and bring them into the viewport.\n\t\t#\n\t\t# @since 4.7.0\n\t\trender_errors: ( errors ) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@ui_element.prepend '
  • ' + errors.join( '
  • ' ) + '
'\n\n\t\t\t# unblock UI\n\t\t\t@ui_element.removeClass( 'processing' ).unblock()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @ui_element.offset().top - 100 }, 1000 )\n\n\n\t\t# Blocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tblock_ui: -> @ui_element.block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI.\n\t\t#\n\t\t# @since 4.7.0\n\t\tunblock_ui: -> @ui_element.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_15_5_loaded' )\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$c0249d4a3fc9bb83$export$71511d61b312f219","instance","Constructor","TypeError","$690246f0b6925227$var$_defineProperties","target","props","i","length","descriptor","writable","key","$690246f0b6925227$export$71511d61b312f219","protoProps","staticProps","prototype","$guLUH","$90XvN","jQuery","$","SV_WC_Apple_Pay_Handler_v5_15_5","args","_","init_product_page","bind","init_cart_page","init_checkout_page","on_validate_merchant","validate_merchant","on_payment_method_selected","on_shipping_contact_selected","on_shipping_method_selected","on_payment_authorized","process_authorization","on_cancel_payment","reset_payment_request","get_payment_request","gateway_id","gateway_slug","merchant_id","ajax_url","validate_nonce","recalculate_totals_nonce","process_nonce","payment_request","generic_error","wrapper","container","button","value","ApplePaySession","canMakePaymentsWithActiveCard","then","canMakePayments","_this","children","hide","is_available","ui_element","show","document","body","on","preventDefault","block_ui","session","get_new_session","onvalidatemerchant","event","onpaymentmethodselected","onshippingcontactselected","onshippingmethodselected","onpaymentauthorized","oncancel","begin","error1","fail_payment","parents","get_sdk_version","validationURL","merchant_session","JSON","parse","completeMerchantValidation","response","abort","message","url","Promise","resolve","reject","data","concat","post","success","completePaymentMethodSelection","total","line_items","console","error","lineItems","shippingContact","completeShippingContactSelection","STATUS_SUCCESS","shipping_methods","STATUS_FAILURE","shippingMethod","identifier","completeShippingMethodSelection","payment","set_payment_status","complete_purchase","action","nonce","stringify","unblock_ui","location","redirect","render_errors","status","completePayment","arguments","base_data","extend","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger","undefined"],"version":3,"file":"sv-wc-payment-gateway-apple-pay.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js index 5b07ae31c..0f2db2af8 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js @@ -1,4 +1,2 @@ -parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c
  • '+t.join("
  • ")+"
  • "),this.uiElement.removeClass("processing").unblock(),e("html, body").animate({scrollTop:this.uiElement.offset().top-100},1e3)}},{key:"blockUI",value:function(){this.uiElement.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblockUI",value:function(){this.uiElement.unblock()}}])}(),e(document.body).trigger("sv_wc_google_pay_handler_v5_15_5_loaded")}); -},{}]},{},["O8A1"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-google-pay.js.map \ No newline at end of file +function e(e,t,n,a){Object.defineProperty(e,t,{get:n,set:a,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},a={},o=t.parcelRequire94c2;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in a){var t=a[e];delete a[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){a[e]=t},t.parcelRequire94c2=o);var i=o.register;i("guLUH",function(t,n){e(t.exports,"_",function(){return a});function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}}),i("90XvN",function(t,n){function a(e,t){for(var n=0;n
  • '+t.join("
  • ")+"
  • "),this.uiElement.removeClass("processing").unblock(),e("html, body").animate({scrollTop:this.uiElement.offset().top-100},1e3)}},{key:"blockUI",value:function(){this.uiElement.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblockUI",value:function(){this.uiElement.unblock()}}]),t}(),e(document.body).trigger("sv_wc_google_pay_handler_v5_15_6_loaded")}); +//# sourceMappingURL=sv-wc-payment-gateway-google-pay.js.map diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map index e59fe735d..3236d050d 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-google-pay.js.map @@ -1 +1 @@ -{"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_15_5","params","plugin_id","merchant_id","merchant_name","gateway_id","gateway_merchant_id","gateway_id_dasherized","environment","ajax_url","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","gatewayMerchantID","merchantID","merchantName","ajaxURL","recalculateTotalsNonce","processNonce","buttonStyle","availableCountries","currencyCode","needsShipping","genericError","product_id","productID","allowedCardNetworks","baseRequest","apiVersion","apiVersionMinor","allowedCardAuthMethods","tokenizationSpecification","type","parameters","baseCardPaymentMethod","allowedAuthMethods","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","cardPaymentMethod","Object","assign","paymentsClient","allowedPaymentMethods","resolve","getGoogleTransactionInfo","transactionInfo","paymentDataRequest","merchantInfo","merchantId","emailRequired","callbackIntents","shippingAddressRequired","shippingAddressParameters","getGoogleShippingAddressParameters","shippingOptionRequired","args","paymentDataCallbacks","onPaymentAuthorized","paymentData","onPaymentDataChanged","google","payments","api","PaymentsClient","blockUI","Promise","reject","processPayment","err","transactionState","error","intent","message","reason","unblockUI","intermediatePaymentData","shippingAddress","shippingOptionData","chosenShippingMethod","callbackTrigger","id","getUpdatedTotals","paymentDataRequestUpdate","newShippingOptionParameters","shippingOptions","length","getGoogleUnserviceableAddressError","failPayment","data","action","post","response","success","JSON","parse","shippingMethod","allowedCountryCodes","button","getGooglePaymentsClient","createButton","onClick","event","onGooglePaymentButtonClicked","buttonColor","buttonSizeMode","document","getElementById","appendChild","getGooglePaymentDataRequest","totalPriceStatus","prefetchPaymentData","nonce","stringify","location","redirect","preventDefault","loadPaymentData","initProductPage","initCartPage","initCheckoutPage","initGooglePay","isReadyToPay","getGoogleIsReadyToPayRequest","then","result","addGooglePayButton","prefetchGooglePaymentData","catch","uiElement","parents","body","on","console","renderErrors","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger"],"mappings":";AAAA,SAAA,EAAA,GAAA,OAAA,EAAA,mBAAA,QAAA,iBAAA,OAAA,SAAA,SAAA,GAAA,cAAA,GAAA,SAAA,GAAA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,IAAA,GAAA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,EAAA,KAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,OAAA,eAAA,EAAA,YAAA,CAAA,UAAA,IAAA,EAAA,SAAA,EAAA,GAAA,IAAA,EAAA,EAAA,EAAA,UAAA,MAAA,UAAA,EAAA,GAAA,EAAA,EAAA,GAAA,SAAA,EAAA,EAAA,GAAA,GAAA,UAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,OAAA,aAAA,QAAA,IAAA,EAA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,KAAKb,UAAUc,SAASC,IAAM,KAAO,OAzkB/E,CAAA,IAAA,UA+kBC,MAAA,WACMf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAhlBpF,CAAA,IAAA,YAslBC,MAAA,WACMnB,KAAAA,UAAUW,cAvlBjB,GA2lBArJ,EAAGmH,SAASyB,MAAOkB,QAAS","file":"sv-wc-payment-gateway-google-pay.js","sourceRoot":"../js","sourcesContent":["jQuery( function( $ ) {\n\n\t\"use strict\"\n\n\t/**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_15_5} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_15_5 = class SV_WC_Google_Pay_Handler_v5_15_5 {\n\n\t\t/**\n\t\t * Handler constructor.\n\t\t *\n\t\t * @since 5.10.0\n\t\t *\n\t\t * @param {Object} params The plugin ID\n\t\t * @param {string} params.plugin_id The plugin ID\n\t\t * @param {string} params.merchant_id The merchant ID\n\t\t * @param {string} params.merchant_name The site name\n\t\t * @param {string} params.gateway_id The gateway ID\n\t\t * @param {string} params.gateway_id_dasherized The gateway ID dasherized\n\t\t * @param {string} params.gateway_merchant_id The gateway merchant ID\n\t\t * @param {string} params.environment The gateway environment (PRODUCTION or TEST)\n\t\t * @param {string} params.ajax_url The AJAX URL\n\t\t * @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action\n\t\t * @param {string} params.process_nonce Nonce for the process AJAX action\n\t\t * @param {string} params.button_style The button style\n\t\t * @param {string[]} params.card_types The supported card types\n\t\t * @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for\n\t\t * @param {string[]} params.currency_code WC configured currency\n\t\t * @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping\n\t\t * @param {string} params.generic_error The generic error message\n\t\t * @param {string} params.product_id The product ID if we are on a Product page\n\t\t */\n\t\tconstructor( params ) {\n\n\t\t\tlet {\n\t\t\t\tplugin_id,\n\t\t\t\tmerchant_id,\n\t\t\t\tmerchant_name,\n\t\t\t\tgateway_id,\n\t\t\t\tgateway_id_dasherized,\n\t\t\t\tgateway_merchant_id,\n\t\t\t\tenvironment,\n\t\t\t\tajax_url,\n\t\t\t\trecalculate_totals_nonce,\n\t\t\t\tprocess_nonce,\n\t\t\t\tbutton_style,\n\t\t\t\tcard_types,\n\t\t\t\tavailable_countries,\n\t\t\t\tcurrency_code,\n\t\t\t\tneeds_shipping,\n\t\t\t\tgeneric_error\n\t\t\t} = params;\n\n\t\t\tthis.gatewayID = gateway_id;\n\t\t\tthis.gatewayMerchantID = gateway_merchant_id;\n\t\t\tthis.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\n\t\t\tthis.environment = environment;\n\t\t\tthis.ajaxURL = ajax_url;\n\t\t\tthis.recalculateTotalsNonce = recalculate_totals_nonce;\n\t\t\tthis.processNonce = process_nonce;\n\t\t\tthis.buttonStyle = button_style;\n\t\t\tthis.availableCountries = available_countries;\n\t\t\tthis.currencyCode = currency_code;\n\t\t\tthis.needsShipping = needs_shipping;\n\t\t\tthis.genericError = generic_error;\n\n\t\t\tif ( params.product_id ) {\n\t\t\t\tthis.productID = params.product_id;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tconst allowedCardNetworks = card_types;\n\n\t\t\t/**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */\n\t\t\tthis.baseRequest = {\n\t\t\t\tapiVersion: 2,\n\t\t\t\tapiVersionMinor: 0\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */\n\t\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\n\t\t\t/**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */\n\t\t\tconst tokenizationSpecification = {\n\t\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\t\tparameters: {\n\t\t\t\t\t'gateway': plugin_id,\n\t\t\t\t\t'gatewayMerchantId': this.gatewayMerchantID\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.baseCardPaymentMethod = {\n\t\t\t\ttype: 'CARD',\n\t\t\t\tparameters: {\n\t\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\t\tbillingAddressRequired: true,\n\t\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\t\tformat: 'FULL',\n\t\t\t\t\t\tphoneNumberRequired: true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.cardPaymentMethod = Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseCardPaymentMethod,\n\t\t\t\t{\n\t\t\t\t\ttokenizationSpecification: tokenizationSpecification\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */\n\t\t\tthis.paymentsClient = null;\n\t\t}\n\n\t\t/**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */\n\t\tgetGoogleIsReadyToPayRequest() {\n\n\t\t\treturn Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseRequest,\n\t\t\t\t{\n\t\t\t\t\tallowedPaymentMethods: [ this.baseCardPaymentMethod ]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */\n\t\tgetGooglePaymentDataRequest( resolve ) {\n\n\t\t\treturn this.getGoogleTransactionInfo( ( transactionInfo ) => {\n\n\t\t\t\tconst paymentDataRequest = Object.assign( {}, this.baseRequest );\n\t\t\t\tpaymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];\n\t\t\t\tpaymentDataRequest.transactionInfo = transactionInfo;\n\t\t\t\tpaymentDataRequest.merchantInfo = {\n\t\t\t\t\tmerchantId: this.merchantID,\n\t\t\t\t\tmerchantName: this.merchantName\n\t\t\t\t};\n\n\t\t\t\tpaymentDataRequest.emailRequired = true;\n\t\t\t\tpaymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\tpaymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];\n\t\t\t\t\tpaymentDataRequest.shippingAddressRequired = true;\n\t\t\t\t\tpaymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();\n\t\t\t\t\tpaymentDataRequest.shippingOptionRequired = true;\n\t\t\t\t}\n\n\t\t\t\tresolve( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */\n\t\tgetGooglePaymentsClient() {\n\t\t\tif ( this.paymentsClient === null ) {\n\t\t\t\tlet args = {\n\t\t\t\t\tenvironment: this.environment,\n\t\t\t\t\tmerchantInfo: {\n\t\t\t\t\t\tmerchantName: this.merchantName,\n\t\t\t\t\t\tmerchantId: this.merchantID\n\t\t\t\t\t},\n\t\t\t\t\tpaymentDataCallbacks: {\n\t\t\t\t\t\tonPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\targs.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );\n\t\t\t\t}\n\n\t\t\t\tthis.paymentsClient = new google.payments.api.PaymentsClient( args );\n\t\t\t}\n\t\t\treturn this.paymentsClient;\n\t\t}\n\n\t\t/**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */\n\t\tonPaymentAuthorized( paymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise( (resolve, reject) => {\n\n\t\t\t\t// handle the response\n\t\t\t\ttry {\n\t\t\t\t\tthis.processPayment( paymentData, resolve );\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\treject( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'PAYMENT_AUTHORIZATION',\n\t\t\t\t\t\t\tmessage: 'Payment could not be processed',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */\n\t\tonPaymentDataChanged( intermediatePaymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise(( resolve, reject ) => {\n\n\t\t\t\ttry {\n\t\t\t\t\tlet shippingAddress = intermediatePaymentData.shippingAddress;\n\t\t\t\t\tlet shippingOptionData = intermediatePaymentData.shippingOptionData;\n\t\t\t\t\tlet chosenShippingMethod = '';\n\n\t\t\t\t\tif ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {\n\t\t\t\t\t\tchosenShippingMethod = shippingOptionData.id;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {\n\n\t\t\t\t\t\tif ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {\n\t\t\t\t\t\t\tpaymentDataRequestUpdate = {\n\t\t\t\t\t\t\t\terror: this.getGoogleUnserviceableAddressError()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( paymentDataRequestUpdate );\n\t\t\t\t\t} );\n\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load updated totals or process payment data request update. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleTransactionInfo( resolve ) {\n\n\t\t\t// get transaction info from cart\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_get_transaction_info`,\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not build transaction info. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tgetUpdatedTotals( shippingAddress, shippingMethod, resolve ) {\n\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_recalculate_totals`,\n\t\t\t\t'nonce': this.recalculateTotalsNonce,\n\t\t\t\tshippingAddress,\n\t\t\t\tshippingMethod\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not recalculate totals. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleShippingAddressParameters() {\n\n\t\t\treturn {\n\t\t\t\tallowedCountryCodes: this.availableCountries\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */\n\t\tgetGoogleUnserviceableAddressError() {\n\t\t\treturn {\n\t\t\t\treason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n\t\t\t\tmessage: 'Cannot ship to the selected address',\n\t\t\t\tintent: 'SHIPPING_ADDRESS'\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */\n\t\taddGooglePayButton() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tconst button = paymentsClient.createButton( {\n\t\t\t\tonClick: ( event ) => this.onGooglePaymentButtonClicked( event ),\n\t\t\t\tbuttonColor: this.buttonStyle,\n\t\t\t\tbuttonSizeMode: 'fill'\n\t\t\t} );\n\t\t\tdocument.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );\n\t\t}\n\n\t\t/**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */\n\t\tprefetchGooglePaymentData() {\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\t// transactionInfo must be set but does not affect cache\n\t\t\t\tpaymentDataRequest.transactionInfo = {\n\t\t\t\t\ttotalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n\t\t\t\t\tcurrencyCode: this.currencyCode\n\t\t\t\t};\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\tpaymentsClient.prefetchPaymentData( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tprocessPayment( paymentData, resolve ) {\n\n\t\t\t// pass payment token to your gateway to process payment\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_process_payment`,\n\t\t\t\tnonce: this.processNonce,\n\t\t\t\tpaymentData: JSON.stringify( paymentData ),\n\t\t\t}\n\n\t\t\tif ( this.productID && ! this.needsShipping ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\treturn $.post( this.ajaxURL, data, ( response ) => {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'SUCCESS'\n\t\t\t\t\t} );\n\t\t\t\t\twindow.location = response.data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'SHIPPING_ADDRESS',\n\t\t\t\t\t\t\tmessage: 'Invalid data',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tthis.failPayment( 'Payment could not be processed. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */\n\t\tonGooglePaymentButtonClicked( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.blockUI();\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\ttry {\n\t\t\t\t\tpaymentsClient.loadPaymentData( paymentDataRequest );\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load payment data. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */\n\t\tinit() {\n\n\t\t\t// initialize for the various pages\n\t\t\tif ( $( 'form.cart' ).length ) {\n\t\t\t\tthis.initProductPage();\n\t\t\t} else if ( $( 'form.woocommerce-cart-form' ).length ) {\n\t\t\t\tthis.initCartPage();\n\t\t\t} else if ( $( 'form.woocommerce-checkout' ).length) {\n\t\t\t\tthis.initCheckoutPage()\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.initGooglePay();\n\t\t}\n\n\t\t/**\n\t\t * Initializes Google Pay.\n\t\t */\n\t\tinitGooglePay() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tpaymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( response.result ) {\n\t\t\t\t\t\tthis.addGooglePayButton();\n\t\t\t\t\t\t// prefetch payment data to improve performance\n\t\t\t\t\t\tthis.prefetchGooglePaymentData();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tthis.failPayment( 'Google Pay is not ready. ' + err );\n\t\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the product page.\n\t\t */\n\t\tinitProductPage() {\n\t\t\tthis.uiElement = $( 'form.cart' );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the cart page.\n\t\t */\n\t\tinitCartPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );\n\n\t\t\t// re-init if the cart totals are updated\n\t\t\t$( document.body ).on( 'updated_cart_totals', () => {\n\t\t\t\tthis.initGooglePay();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the checkout page.\n\t\t */\n\t\tinitCheckoutPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-checkout' );\n\t\t}\n\n\t\t/**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */\n\t\tfailPayment( error ) {\n\n\t\t\tconsole.error( '[Google Pay] ' + error );\n\n\t\t\tthis.unblockUI();\n\n\t\t\tthis.renderErrors( [ this.genericError ] );\n\t\t}\n\n\t\t/**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */\n\t\trenderErrors( errors ) {\n\n\t\t\t// hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove();\n\n\t\t\t// add errors\n\t\t\tthis.uiElement.prepend( '
    • ' + errors.join( '
    • ' ) + '
    ' );\n\n\t\t\t// unblock UI\n\t\t\tthis.uiElement.removeClass( 'processing' ).unblock();\n\n\t\t\t// scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );\n\t\t}\n\n\t\t/**\n\t\t * Blocks the payment form UI.\n\t\t */\n\t\tblockUI() {\n\t\t\tthis.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );\n\t\t}\n\n\t\t/**\n\t\t * Unblocks the payment form UI.\n\t\t */\n\t\tunblockUI() {\n\t\t\tthis.uiElement.unblock();\n\t\t}\n\t}\n\n\t$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_15_5_loaded' );\n\n} );\n"]} \ No newline at end of file +{"mappings":"A,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,I,W,O,C,GCAA,SAAS,EAAkB,CAAQ,CAAE,CAAW,EAC5C,GAAI,CAAE,CAAA,aAAoB,CAAA,EAAc,MAAM,AAAI,UAAU,oCAChE,C,G,E,Q,S,C,C,C,ECFA,SAAS,EAAkB,CAAM,CAAE,CAAK,EACpC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,MAAM,CAAE,IAAK,CACnC,IAAI,EAAa,CAAK,CAAC,EAAE,AACzB,CAAA,EAAW,UAAU,CAAG,EAAW,UAAU,EAAI,CAAA,EACjD,EAAW,YAAY,CA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,SAAa,CAAK,EAEjB,QAAQ,KAAK,CAAE,gBAAkB,GAEjC,IAAI,CAAC,SAAS,GAEd,IAAI,CAAC,YAAY,CAAE,CAAE,IAAI,CAAC,YAAY,CAAE,CACzC,C,E,CAKA,IAAA,eAAA,MAAA,SAAc,CAAM,EAGnB,EAAG,4CAA6C,MAAM,GAGtD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAE,qCAAuC,EAAO,IAAI,CAAE,aAAgB,cAG5F,IAAI,CAAC,SAAS,CAAC,WAAW,CAAE,cAAe,OAAO,GAGlD,EAAG,cAAe,OAAO,CAAE,CAAE,UAAW,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAG,GAAI,EAAG,IAC9E,C,E,CAKA,IAAA,UAAA,MAAA,WACC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAE,CAAE,QAAS,KAAM,WAAY,CAAE,WAAY,OAAQ,QAAS,EAAI,CAAE,EACzF,C,E,CAKA,IAAA,YAAA,MAAA,WACC,IAAI,CAAC,SAAS,CAAC,OAAO,EACvB,C,E,E,C,IAGD,EAAG,SAAS,IAAI,EAAG,OAAO,CAAE,0CAE7B","sources":["","node_modules/@swc/helpers/esm/_class_call_check.js","node_modules/@swc/helpers/esm/_create_class.js","woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"guLUH\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c0249d4a3fc9bb83$export$71511d61b312f219; });\nfunction $c0249d4a3fc9bb83$export$71511d61b312f219(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\n});\n\nparcelRegister(\"90XvN\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $690246f0b6925227$export$71511d61b312f219; });\nfunction $690246f0b6925227$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction $690246f0b6925227$export$71511d61b312f219(Constructor, protoProps, staticProps) {\n if (protoProps) $690246f0b6925227$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $690246f0b6925227$var$_defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n});\n\n\nvar $guLUH = parcelRequire(\"guLUH\");\n\nvar $90XvN = parcelRequire(\"90XvN\");\njQuery(function($) {\n \"use strict\";\n /**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_15_6} object\n\t */ window.SV_WC_Google_Pay_Handler_v5_15_6 = /*#__PURE__*/ function() {\n function SV_WC_Google_Pay_Handler_v5_15_6(params) {\n (0, $guLUH._)(this, SV_WC_Google_Pay_Handler_v5_15_6);\n var plugin_id = params.plugin_id, merchant_id = params.merchant_id, merchant_name = params.merchant_name, gateway_id = params.gateway_id, gateway_id_dasherized = params.gateway_id_dasherized, gateway_merchant_id = params.gateway_merchant_id, environment = params.environment, ajax_url = params.ajax_url, recalculate_totals_nonce = params.recalculate_totals_nonce, process_nonce = params.process_nonce, button_style = params.button_style, card_types = params.card_types, available_countries = params.available_countries, currency_code = params.currency_code, needs_shipping = params.needs_shipping, generic_error = params.generic_error;\n this.gatewayID = gateway_id;\n this.gatewayMerchantID = gateway_merchant_id;\n this.merchantID = merchant_id;\n this.merchantName = merchant_name;\n this.environment = environment;\n this.ajaxURL = ajax_url;\n this.recalculateTotalsNonce = recalculate_totals_nonce;\n this.processNonce = process_nonce;\n this.buttonStyle = button_style;\n this.availableCountries = available_countries;\n this.currencyCode = currency_code;\n this.needsShipping = needs_shipping;\n this.genericError = generic_error;\n if (params.product_id) this.productID = params.product_id;\n /**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */ var allowedCardNetworks = card_types;\n /**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */ this.baseRequest = {\n apiVersion: 2,\n apiVersionMinor: 0\n };\n /**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */ var allowedCardAuthMethods = [\n 'PAN_ONLY',\n 'CRYPTOGRAM_3DS'\n ];\n /**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */ var tokenizationSpecification = {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n 'gateway': plugin_id,\n 'gatewayMerchantId': this.gatewayMerchantID\n }\n };\n /**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */ this.baseCardPaymentMethod = {\n type: 'CARD',\n parameters: {\n allowedAuthMethods: allowedCardAuthMethods,\n allowedCardNetworks: allowedCardNetworks,\n billingAddressRequired: true,\n billingAddressParameters: {\n format: 'FULL',\n phoneNumberRequired: true\n }\n }\n };\n /**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */ this.cardPaymentMethod = Object.assign({}, this.baseCardPaymentMethod, {\n tokenizationSpecification: tokenizationSpecification\n });\n /**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */ this.paymentsClient = null;\n }\n (0, $90XvN._)(SV_WC_Google_Pay_Handler_v5_15_6, [\n {\n /**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */ key: \"getGoogleIsReadyToPayRequest\",\n value: function getGoogleIsReadyToPayRequest() {\n return Object.assign({}, this.baseRequest, {\n allowedPaymentMethods: [\n this.baseCardPaymentMethod\n ]\n });\n }\n },\n {\n /**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */ key: \"getGooglePaymentDataRequest\",\n value: function getGooglePaymentDataRequest(resolve) {\n var _this = this;\n return this.getGoogleTransactionInfo(function(transactionInfo) {\n var paymentDataRequest = Object.assign({}, _this.baseRequest);\n paymentDataRequest.allowedPaymentMethods = [\n _this.cardPaymentMethod\n ];\n paymentDataRequest.transactionInfo = transactionInfo;\n paymentDataRequest.merchantInfo = {\n merchantId: _this.merchantID,\n merchantName: _this.merchantName\n };\n paymentDataRequest.emailRequired = true;\n paymentDataRequest.callbackIntents = [\n 'PAYMENT_AUTHORIZATION'\n ];\n if (_this.needsShipping) {\n paymentDataRequest.callbackIntents = [\n 'SHIPPING_ADDRESS',\n 'SHIPPING_OPTION',\n 'PAYMENT_AUTHORIZATION'\n ];\n paymentDataRequest.shippingAddressRequired = true;\n paymentDataRequest.shippingAddressParameters = _this.getGoogleShippingAddressParameters();\n paymentDataRequest.shippingOptionRequired = true;\n }\n resolve(paymentDataRequest);\n });\n }\n },\n {\n /**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */ key: \"getGooglePaymentsClient\",\n value: function getGooglePaymentsClient() {\n var _this = this;\n if (this.paymentsClient === null) {\n var args = {\n environment: this.environment,\n merchantInfo: {\n merchantName: this.merchantName,\n merchantId: this.merchantID\n },\n paymentDataCallbacks: {\n onPaymentAuthorized: function(paymentData) {\n return _this.onPaymentAuthorized(paymentData);\n }\n }\n };\n if (this.needsShipping) args.paymentDataCallbacks.onPaymentDataChanged = function(paymentData) {\n return _this.onPaymentDataChanged(paymentData);\n };\n this.paymentsClient = new google.payments.api.PaymentsClient(args);\n }\n return this.paymentsClient;\n }\n },\n {\n /**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */ key: \"onPaymentAuthorized\",\n value: function onPaymentAuthorized(paymentData) {\n var _this = this;\n this.blockUI();\n return new Promise(function(resolve, reject) {\n // handle the response\n try {\n _this.processPayment(paymentData, resolve);\n } catch (err) {\n reject({\n transactionState: 'ERROR',\n error: {\n intent: 'PAYMENT_AUTHORIZATION',\n message: 'Payment could not be processed',\n reason: 'PAYMENT_DATA_INVALID'\n }\n });\n }\n _this.unblockUI();\n });\n }\n },\n {\n /**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */ key: \"onPaymentDataChanged\",\n value: function onPaymentDataChanged(intermediatePaymentData) {\n var _this = this;\n this.blockUI();\n return new Promise(function(resolve, reject) {\n try {\n var shippingAddress = intermediatePaymentData.shippingAddress;\n var shippingOptionData = intermediatePaymentData.shippingOptionData;\n var chosenShippingMethod = '';\n if (intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION') chosenShippingMethod = shippingOptionData.id;\n _this.getUpdatedTotals(shippingAddress, chosenShippingMethod, function(paymentDataRequestUpdate) {\n if (paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0) paymentDataRequestUpdate = {\n error: _this.getGoogleUnserviceableAddressError()\n };\n resolve(paymentDataRequestUpdate);\n });\n } catch (err) {\n _this.failPayment('Could not load updated totals or process payment data request update. ' + err);\n }\n _this.unblockUI();\n });\n }\n },\n {\n /**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */ key: \"getGoogleTransactionInfo\",\n value: function getGoogleTransactionInfo(resolve) {\n var _this = this;\n // get transaction info from cart\n var data = {\n action: \"wc_\".concat(this.gatewayID, \"_google_pay_get_transaction_info\")\n };\n if (this.productID) data.productID = this.productID;\n $.post(this.ajaxURL, data, function(response) {\n if (response.success) resolve(JSON.parse(response.data));\n else _this.failPayment('Could not build transaction info. ' + response.data.message);\n });\n }\n },\n {\n /**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */ key: \"getUpdatedTotals\",\n value: function getUpdatedTotals(shippingAddress, shippingMethod, resolve) {\n var _this = this;\n var data = {\n action: \"wc_\".concat(this.gatewayID, \"_google_pay_recalculate_totals\"),\n 'nonce': this.recalculateTotalsNonce,\n shippingAddress: shippingAddress,\n shippingMethod: shippingMethod\n };\n if (this.productID) data.productID = this.productID;\n $.post(this.ajaxURL, data, function(response) {\n if (response.success) resolve(JSON.parse(response.data));\n else _this.failPayment('Could not recalculate totals. ' + response.data.message);\n });\n }\n },\n {\n /**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */ key: \"getGoogleShippingAddressParameters\",\n value: function getGoogleShippingAddressParameters() {\n return {\n allowedCountryCodes: this.availableCountries\n };\n }\n },\n {\n /**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */ key: \"getGoogleUnserviceableAddressError\",\n value: function getGoogleUnserviceableAddressError() {\n return {\n reason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n message: 'Cannot ship to the selected address',\n intent: 'SHIPPING_ADDRESS'\n };\n }\n },\n {\n /**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */ key: \"addGooglePayButton\",\n value: function addGooglePayButton() {\n var _this = this;\n var paymentsClient = this.getGooglePaymentsClient();\n var button = paymentsClient.createButton({\n onClick: function(event) {\n return _this.onGooglePaymentButtonClicked(event);\n },\n buttonColor: this.buttonStyle,\n buttonSizeMode: 'fill'\n });\n document.getElementById('sv-wc-google-pay-button-container').appendChild(button);\n }\n },\n {\n /**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */ key: \"prefetchGooglePaymentData\",\n value: function prefetchGooglePaymentData() {\n var _this = this;\n this.getGooglePaymentDataRequest(function(paymentDataRequest) {\n // transactionInfo must be set but does not affect cache\n paymentDataRequest.transactionInfo = {\n totalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n currencyCode: _this.currencyCode\n };\n var paymentsClient = _this.getGooglePaymentsClient();\n paymentsClient.prefetchPaymentData(paymentDataRequest);\n });\n }\n },\n {\n /**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */ key: \"processPayment\",\n value: function processPayment(paymentData, resolve) {\n var _this = this;\n // pass payment token to your gateway to process payment\n var data = {\n action: \"wc_\".concat(this.gatewayID, \"_google_pay_process_payment\"),\n nonce: this.processNonce,\n paymentData: JSON.stringify(paymentData)\n };\n if (this.productID && !this.needsShipping) data.productID = this.productID;\n return $.post(this.ajaxURL, data, function(response) {\n if (response.success) {\n resolve({\n transactionState: 'SUCCESS'\n });\n window.location = response.data.redirect;\n } else {\n resolve({\n transactionState: 'ERROR',\n error: {\n intent: 'SHIPPING_ADDRESS',\n message: 'Invalid data',\n reason: 'PAYMENT_DATA_INVALID'\n }\n });\n _this.failPayment('Payment could not be processed. ' + response.data.message);\n }\n });\n }\n },\n {\n /**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */ key: \"onGooglePaymentButtonClicked\",\n value: function onGooglePaymentButtonClicked(event) {\n var _this = this;\n event.preventDefault();\n this.blockUI();\n this.getGooglePaymentDataRequest(function(paymentDataRequest) {\n var paymentsClient = _this.getGooglePaymentsClient();\n try {\n paymentsClient.loadPaymentData(paymentDataRequest);\n } catch (err) {\n _this.failPayment('Could not load payment data. ' + err);\n }\n _this.unblockUI();\n });\n }\n },\n {\n /**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */ key: \"init\",\n value: function init() {\n // initialize for the various pages\n if ($('form.cart').length) this.initProductPage();\n else if ($('form.woocommerce-cart-form').length) this.initCartPage();\n else if ($('form.woocommerce-checkout').length) this.initCheckoutPage();\n else return;\n this.initGooglePay();\n }\n },\n {\n /**\n\t\t * Initializes Google Pay.\n\t\t */ key: \"initGooglePay\",\n value: function initGooglePay() {\n var _this = this;\n var paymentsClient = this.getGooglePaymentsClient();\n paymentsClient.isReadyToPay(this.getGoogleIsReadyToPayRequest()).then(function(response) {\n if (response.result) {\n _this.addGooglePayButton();\n // prefetch payment data to improve performance\n _this.prefetchGooglePaymentData();\n }\n }).catch(function(err) {\n _this.failPayment('Google Pay is not ready. ' + err);\n });\n }\n },\n {\n /**\n\t\t * Initializes the product page.\n\t\t */ key: \"initProductPage\",\n value: function initProductPage() {\n this.uiElement = $('form.cart');\n }\n },\n {\n /**\n\t\t * Initializes the cart page.\n\t\t */ key: \"initCartPage\",\n value: function initCartPage() {\n var _this = this;\n this.uiElement = $('form.woocommerce-cart-form').parents('div.woocommerce');\n // re-init if the cart totals are updated\n $(document.body).on('updated_cart_totals', function() {\n _this.initGooglePay();\n });\n }\n },\n {\n /**\n\t\t * Initializes the checkout page.\n\t\t */ key: \"initCheckoutPage\",\n value: function initCheckoutPage() {\n this.uiElement = $('form.woocommerce-checkout');\n }\n },\n {\n /**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */ key: \"failPayment\",\n value: function failPayment(error) {\n console.error('[Google Pay] ' + error);\n this.unblockUI();\n this.renderErrors([\n this.genericError\n ]);\n }\n },\n {\n /**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */ key: \"renderErrors\",\n value: function renderErrors(errors) {\n // hide and remove any previous errors\n $('.woocommerce-error, .woocommerce-message').remove();\n // add errors\n this.uiElement.prepend('
    • ' + errors.join('
    • ') + '
    ');\n // unblock UI\n this.uiElement.removeClass('processing').unblock();\n // scroll to top\n $('html, body').animate({\n scrollTop: this.uiElement.offset().top - 100\n }, 1000);\n }\n },\n {\n /**\n\t\t * Blocks the payment form UI.\n\t\t */ key: \"blockUI\",\n value: function blockUI() {\n this.uiElement.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n },\n {\n /**\n\t\t * Unblocks the payment form UI.\n\t\t */ key: \"unblockUI\",\n value: function unblockUI() {\n this.uiElement.unblock();\n }\n }\n ]);\n return SV_WC_Google_Pay_Handler_v5_15_6;\n }();\n $(document.body).trigger('sv_wc_google_pay_handler_v5_15_6_loaded');\n});\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-google-pay.js.map\n","function _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _class_call_check as _ };\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","jQuery( function( $ ) {\n\n\t\"use strict\"\n\n\t/**\n\t * Google Pay handler.\n\t *\n\t * @since 5.10.0\n\t *\n\t * @type {SV_WC_Google_Pay_Handler_v5_15_6} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_15_6 = class SV_WC_Google_Pay_Handler_v5_15_6 {\n\n\t\t/**\n\t\t * Handler constructor.\n\t\t *\n\t\t * @since 5.10.0\n\t\t *\n\t\t * @param {Object} params The plugin ID\n\t\t * @param {string} params.plugin_id The plugin ID\n\t\t * @param {string} params.merchant_id The merchant ID\n\t\t * @param {string} params.merchant_name The site name\n\t\t * @param {string} params.gateway_id The gateway ID\n\t\t * @param {string} params.gateway_id_dasherized The gateway ID dasherized\n\t\t * @param {string} params.gateway_merchant_id The gateway merchant ID\n\t\t * @param {string} params.environment The gateway environment (PRODUCTION or TEST)\n\t\t * @param {string} params.ajax_url The AJAX URL\n\t\t * @param {string} params.recalculate_totals_nonce Nonce for the recalculate_totals AJAX action\n\t\t * @param {string} params.process_nonce Nonce for the process AJAX action\n\t\t * @param {string} params.button_style The button style\n\t\t * @param {string[]} params.card_types The supported card types\n\t\t * @param {string[]} params.available_countries Array of two-letter country codes the gateway is available for\n\t\t * @param {string[]} params.currency_code WC configured currency\n\t\t * @param {boolean} params.needs_shipping Whether or not the cart or product needs shipping\n\t\t * @param {string} params.generic_error The generic error message\n\t\t * @param {string} params.product_id The product ID if we are on a Product page\n\t\t */\n\t\tconstructor( params ) {\n\n\t\t\tlet {\n\t\t\t\tplugin_id,\n\t\t\t\tmerchant_id,\n\t\t\t\tmerchant_name,\n\t\t\t\tgateway_id,\n\t\t\t\tgateway_id_dasherized,\n\t\t\t\tgateway_merchant_id,\n\t\t\t\tenvironment,\n\t\t\t\tajax_url,\n\t\t\t\trecalculate_totals_nonce,\n\t\t\t\tprocess_nonce,\n\t\t\t\tbutton_style,\n\t\t\t\tcard_types,\n\t\t\t\tavailable_countries,\n\t\t\t\tcurrency_code,\n\t\t\t\tneeds_shipping,\n\t\t\t\tgeneric_error\n\t\t\t} = params;\n\n\t\t\tthis.gatewayID = gateway_id;\n\t\t\tthis.gatewayMerchantID = gateway_merchant_id;\n\t\t\tthis.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\n\t\t\tthis.environment = environment;\n\t\t\tthis.ajaxURL = ajax_url;\n\t\t\tthis.recalculateTotalsNonce = recalculate_totals_nonce;\n\t\t\tthis.processNonce = process_nonce;\n\t\t\tthis.buttonStyle = button_style;\n\t\t\tthis.availableCountries = available_countries;\n\t\t\tthis.currencyCode = currency_code;\n\t\t\tthis.needsShipping = needs_shipping;\n\t\t\tthis.genericError = generic_error;\n\n\t\t\tif ( params.product_id ) {\n\t\t\t\tthis.productID = params.product_id;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Card networks supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tconst allowedCardNetworks = card_types;\n\n\t\t\t/**\n\t\t\t * Define the version of the Google Pay API referenced when creating your configuration\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}\n\t\t\t */\n\t\t\tthis.baseRequest = {\n\t\t\t\tapiVersion: 2,\n\t\t\t\tapiVersionMinor: 0\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Card authentication methods supported by your site and your gateway\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t *\n\t\t\t * @todo confirm your processor supports Android device tokens for your supported card networks\n\t\t\t */\n\t\t\tconst allowedCardAuthMethods = [ 'PAN_ONLY', 'CRYPTOGRAM_3DS' ];\n\n\t\t\t/**\n\t\t\t * Identify your gateway and your site's gateway merchant identifier\n\t\t\t *\n\t\t\t * The Google Pay API response will return an encrypted payment method capable\n\t\t\t * of being charged by a supported gateway after payer authorization\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}\n\t\t\t */\n\t\t\tconst tokenizationSpecification = {\n\t\t\t\ttype: 'PAYMENT_GATEWAY',\n\t\t\t\tparameters: {\n\t\t\t\t\t'gateway': plugin_id,\n\t\t\t\t\t'gatewayMerchantId': this.gatewayMerchantID\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method and its required fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.baseCardPaymentMethod = {\n\t\t\t\ttype: 'CARD',\n\t\t\t\tparameters: {\n\t\t\t\t\tallowedAuthMethods: allowedCardAuthMethods,\n\t\t\t\t\tallowedCardNetworks: allowedCardNetworks,\n\t\t\t\t\tbillingAddressRequired: true,\n\t\t\t\t\tbillingAddressParameters: {\n\t\t\t\t\t\tformat: 'FULL',\n\t\t\t\t\t\tphoneNumberRequired: true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Describe your site's support for the CARD payment method including optional fields\n\t\t\t *\n\t\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}\n\t\t\t */\n\t\t\tthis.cardPaymentMethod = Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseCardPaymentMethod,\n\t\t\t\t{\n\t\t\t\t\ttokenizationSpecification: tokenizationSpecification\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * An initialized google.payments.api.PaymentsClient object or null if not yet set\n\t\t\t *\n\t\t\t * @see {@link getGooglePaymentsClient}\n\t\t\t */\n\t\t\tthis.paymentsClient = null;\n\t\t}\n\n\t\t/**\n\t\t * Configure your site's support for payment methods supported by the Google Pay\n\t\t * API.\n\t\t *\n\t\t * Each member of allowedPaymentMethods should contain only the required fields,\n\t\t * allowing reuse of this base request when determining a viewer's ability\n\t\t * to pay and later requesting a supported payment method\n\t\t *\n\t\t * @returns {object} Google Pay API version, payment methods supported by the site\n\t\t */\n\t\tgetGoogleIsReadyToPayRequest() {\n\n\t\t\treturn Object.assign(\n\t\t\t\t{},\n\t\t\t\tthis.baseRequest,\n\t\t\t\t{\n\t\t\t\t\tallowedPaymentMethods: [ this.baseCardPaymentMethod ]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Configure support for the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} PaymentDataRequest fields\n\t\t */\n\t\tgetGooglePaymentDataRequest( resolve ) {\n\n\t\t\treturn this.getGoogleTransactionInfo( ( transactionInfo ) => {\n\n\t\t\t\tconst paymentDataRequest = Object.assign( {}, this.baseRequest );\n\t\t\t\tpaymentDataRequest.allowedPaymentMethods = [ this.cardPaymentMethod ];\n\t\t\t\tpaymentDataRequest.transactionInfo = transactionInfo;\n\t\t\t\tpaymentDataRequest.merchantInfo = {\n\t\t\t\t\tmerchantId: this.merchantID,\n\t\t\t\t\tmerchantName: this.merchantName\n\t\t\t\t};\n\n\t\t\t\tpaymentDataRequest.emailRequired = true;\n\t\t\t\tpaymentDataRequest.callbackIntents = [ 'PAYMENT_AUTHORIZATION' ];\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\tpaymentDataRequest.callbackIntents = [ 'SHIPPING_ADDRESS', 'SHIPPING_OPTION', 'PAYMENT_AUTHORIZATION' ];\n\t\t\t\t\tpaymentDataRequest.shippingAddressRequired = true;\n\t\t\t\t\tpaymentDataRequest.shippingAddressParameters = this.getGoogleShippingAddressParameters();\n\t\t\t\t\tpaymentDataRequest.shippingOptionRequired = true;\n\t\t\t\t}\n\n\t\t\t\tresolve( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Return an active PaymentsClient or initialize\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}\n\t\t * @returns {google.payments.api.PaymentsClient} Google Pay API client\n\t\t */\n\t\tgetGooglePaymentsClient() {\n\t\t\tif ( this.paymentsClient === null ) {\n\t\t\t\tlet args = {\n\t\t\t\t\tenvironment: this.environment,\n\t\t\t\t\tmerchantInfo: {\n\t\t\t\t\t\tmerchantName: this.merchantName,\n\t\t\t\t\t\tmerchantId: this.merchantID\n\t\t\t\t\t},\n\t\t\t\t\tpaymentDataCallbacks: {\n\t\t\t\t\t\tonPaymentAuthorized: ( paymentData ) => this.onPaymentAuthorized( paymentData ),\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif ( this.needsShipping ) {\n\t\t\t\t\targs.paymentDataCallbacks.onPaymentDataChanged = ( paymentData ) => this.onPaymentDataChanged( paymentData );\n\t\t\t\t}\n\n\t\t\t\tthis.paymentsClient = new google.payments.api.PaymentsClient( args );\n\t\t\t}\n\t\t\treturn this.paymentsClient;\n\t\t}\n\n\t\t/**\n\t\t * Handles payment authorization callback intent.\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after a payer approves payment.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @returns Promise<{object}> Promise object to complete or fail the transaction.\n\t\t */\n\t\tonPaymentAuthorized( paymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise( (resolve, reject) => {\n\n\t\t\t\t// handle the response\n\t\t\t\ttry {\n\t\t\t\t\tthis.processPayment( paymentData, resolve );\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\treject( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'PAYMENT_AUTHORIZATION',\n\t\t\t\t\t\t\tmessage: 'Payment could not be processed',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handles dynamic buy flow shipping address and shipping options callback intents.\n\t\t *\n\t\t * @param {object} intermediatePaymentData response from Google Pay API a shipping address or shipping option is selected in the payment sheet.\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#IntermediatePaymentData|IntermediatePaymentData object reference}\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t * @returns Promise<{object}> Promise of PaymentDataRequestUpdate object to update the payment sheet.\n\t\t */\n\t\tonPaymentDataChanged( intermediatePaymentData ) {\n\n\t\t\tthis.blockUI();\n\n\t\t\treturn new Promise(( resolve, reject ) => {\n\n\t\t\t\ttry {\n\t\t\t\t\tlet shippingAddress = intermediatePaymentData.shippingAddress;\n\t\t\t\t\tlet shippingOptionData = intermediatePaymentData.shippingOptionData;\n\t\t\t\t\tlet chosenShippingMethod = '';\n\n\t\t\t\t\tif ( intermediatePaymentData.callbackTrigger == 'SHIPPING_OPTION' ) {\n\t\t\t\t\t\tchosenShippingMethod = shippingOptionData.id;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.getUpdatedTotals( shippingAddress, chosenShippingMethod, ( paymentDataRequestUpdate ) => {\n\n\t\t\t\t\t\tif ( paymentDataRequestUpdate.newShippingOptionParameters.shippingOptions.length == 0 ) {\n\t\t\t\t\t\t\tpaymentDataRequestUpdate = {\n\t\t\t\t\t\t\t\terror: this.getGoogleUnserviceableAddressError()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( paymentDataRequestUpdate );\n\t\t\t\t\t} );\n\n\t\t\t\t}\tcatch( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load updated totals or process payment data request update. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment amount, currency, and amount status\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}\n\t\t *\n\t\t * @param {function} resolve callback\n\t\t * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleTransactionInfo( resolve ) {\n\n\t\t\t// get transaction info from cart\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_get_transaction_info`,\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not build transaction info. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Get updated totals and shipping options via AJAX for use in the PaymentDataRequest\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataRequestUpdate|PaymentDataRequestUpdate}\n\t\t *\n\t\t * @param {object} shippingAddress shipping address\n\t\t * @param {object} shippingMethod chosen shipping method\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tgetUpdatedTotals( shippingAddress, shippingMethod, resolve ) {\n\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_recalculate_totals`,\n\t\t\t\t'nonce': this.recalculateTotalsNonce,\n\t\t\t\tshippingAddress,\n\t\t\t\tshippingMethod\n\t\t\t}\n\n\t\t\tif ( this.productID ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\t$.post( this.ajaxURL, data, ( response ) => {\n\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( JSON.parse( response.data ) )\n\t\t\t\t} else {\n\t\t\t\t\tthis.failPayment( 'Could not recalculate totals. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with shipping address parameters when using dynamic buy flow.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ShippingAddressParameters|ShippingAddressParameters}\n\t\t * @returns {object} shipping address details, suitable for use as shippingAddressParameters property of PaymentDataRequest\n\t\t */\n\t\tgetGoogleShippingAddressParameters() {\n\n\t\t\treturn {\n\t\t\t\tallowedCountryCodes: this.availableCountries\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Provide Google Pay API with a payment data error.\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentDataError|PaymentDataError}\n\t\t * @returns {object} payment data error, suitable for use as error property of PaymentDataRequestUpdate\n\t\t */\n\t\tgetGoogleUnserviceableAddressError() {\n\t\t\treturn {\n\t\t\t\treason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\n\t\t\t\tmessage: 'Cannot ship to the selected address',\n\t\t\t\tintent: 'SHIPPING_ADDRESS'\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a Google Pay purchase button alongside an existing checkout button\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}\n\t\t * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}\n\t\t */\n\t\taddGooglePayButton() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tconst button = paymentsClient.createButton( {\n\t\t\t\tonClick: ( event ) => this.onGooglePaymentButtonClicked( event ),\n\t\t\t\tbuttonColor: this.buttonStyle,\n\t\t\t\tbuttonSizeMode: 'fill'\n\t\t\t} );\n\t\t\tdocument.getElementById( 'sv-wc-google-pay-button-container' ).appendChild( button );\n\t\t}\n\n\t\t/**\n\t\t * Prefetch payment data to improve performance\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}\n\t\t */\n\t\tprefetchGooglePaymentData() {\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\t// transactionInfo must be set but does not affect cache\n\t\t\t\tpaymentDataRequest.transactionInfo = {\n\t\t\t\t\ttotalPriceStatus: 'NOT_CURRENTLY_KNOWN',\n\t\t\t\t\tcurrencyCode: this.currencyCode\n\t\t\t\t};\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\tpaymentsClient.prefetchPaymentData( paymentDataRequest );\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Process payment data returned by the Google Pay API\n\t\t *\n\t\t * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}\n\t\t *\n\t\t * @param {object} paymentData response from Google Pay API after user approves payment\n\t\t * @param {function} resolve callback\n\t\t */\n\t\tprocessPayment( paymentData, resolve ) {\n\n\t\t\t// pass payment token to your gateway to process payment\n\t\t\tconst data = {\n\t\t\t\taction: `wc_${this.gatewayID}_google_pay_process_payment`,\n\t\t\t\tnonce: this.processNonce,\n\t\t\t\tpaymentData: JSON.stringify( paymentData ),\n\t\t\t}\n\n\t\t\tif ( this.productID && ! this.needsShipping ) {\n\t\t\t\tdata.productID = this.productID;\n\t\t\t}\n\n\t\t\treturn $.post( this.ajaxURL, data, ( response ) => {\n\t\t\t\tif ( response.success ) {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'SUCCESS'\n\t\t\t\t\t} );\n\t\t\t\t\twindow.location = response.data.redirect;\n\t\t\t\t} else {\n\t\t\t\t\tresolve( {\n\t\t\t\t\t\ttransactionState: 'ERROR',\n\t\t\t\t\t\terror: {\n\t\t\t\t\t\t\tintent: 'SHIPPING_ADDRESS',\n\t\t\t\t\t\t\tmessage: 'Invalid data',\n\t\t\t\t\t\t\treason: 'PAYMENT_DATA_INVALID'\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tthis.failPayment( 'Payment could not be processed. ' + response.data.message );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Show Google Pay payment sheet when Google Pay payment button is clicked\n\t\t */\n\t\tonGooglePaymentButtonClicked( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.blockUI();\n\n\t\t\tthis.getGooglePaymentDataRequest( ( paymentDataRequest ) => {\n\n\t\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\t\ttry {\n\t\t\t\t\tpaymentsClient.loadPaymentData( paymentDataRequest );\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tthis.failPayment( 'Could not load payment data. ' + err );\n\t\t\t\t}\n\n\t\t\t\tthis.unblockUI();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded\n\t\t *\n\t\t * Display a Google Pay payment button after confirmation of the viewer's\n\t\t * ability to pay.\n\t\t */\n\t\tinit() {\n\n\t\t\t// initialize for the various pages\n\t\t\tif ( $( 'form.cart' ).length ) {\n\t\t\t\tthis.initProductPage();\n\t\t\t} else if ( $( 'form.woocommerce-cart-form' ).length ) {\n\t\t\t\tthis.initCartPage();\n\t\t\t} else if ( $( 'form.woocommerce-checkout' ).length) {\n\t\t\t\tthis.initCheckoutPage()\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.initGooglePay();\n\t\t}\n\n\t\t/**\n\t\t * Initializes Google Pay.\n\t\t */\n\t\tinitGooglePay() {\n\n\t\t\tconst paymentsClient = this.getGooglePaymentsClient();\n\t\t\tpaymentsClient.isReadyToPay( this.getGoogleIsReadyToPayRequest() )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( response.result ) {\n\t\t\t\t\t\tthis.addGooglePayButton();\n\t\t\t\t\t\t// prefetch payment data to improve performance\n\t\t\t\t\t\tthis.prefetchGooglePaymentData();\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t\t.catch( ( err ) => {\n\t\t\t\t\tthis.failPayment( 'Google Pay is not ready. ' + err );\n\t\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the product page.\n\t\t */\n\t\tinitProductPage() {\n\t\t\tthis.uiElement = $( 'form.cart' );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the cart page.\n\t\t */\n\t\tinitCartPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-cart-form' ).parents( 'div.woocommerce' );\n\n\t\t\t// re-init if the cart totals are updated\n\t\t\t$( document.body ).on( 'updated_cart_totals', () => {\n\t\t\t\tthis.initGooglePay();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Initializes the checkout page.\n\t\t */\n\t\tinitCheckoutPage() {\n\t\t\tthis.uiElement = $( 'form.woocommerce-checkout' );\n\t\t}\n\n\t\t/**\n\t\t * Fails the purchase based on the gateway result.\n\t\t */\n\t\tfailPayment( error ) {\n\n\t\t\tconsole.error( '[Google Pay] ' + error );\n\n\t\t\tthis.unblockUI();\n\n\t\t\tthis.renderErrors( [ this.genericError ] );\n\t\t}\n\n\t\t/**\n\t\t * Renders any new errors and bring them into the viewport.\n \t\t */\n\t\trenderErrors( errors ) {\n\n\t\t\t// hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove();\n\n\t\t\t// add errors\n\t\t\tthis.uiElement.prepend( '
    • ' + errors.join( '
    • ' ) + '
    ' );\n\n\t\t\t// unblock UI\n\t\t\tthis.uiElement.removeClass( 'processing' ).unblock();\n\n\t\t\t// scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: this.uiElement.offset().top - 100 }, 1000 );\n\t\t}\n\n\t\t/**\n\t\t * Blocks the payment form UI.\n\t\t */\n\t\tblockUI() {\n\t\t\tthis.uiElement.block( { message: null, overlayCSS: { background: '#fff', opacity: 0.6 } } );\n\t\t}\n\n\t\t/**\n\t\t * Unblocks the payment form UI.\n\t\t */\n\t\tunblockUI() {\n\t\t\tthis.uiElement.unblock();\n\t\t}\n\t}\n\n\t$( document.body ).trigger( 'sv_wc_google_pay_handler_v5_15_6_loaded' );\n\n} );\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$c0249d4a3fc9bb83$export$71511d61b312f219","instance","Constructor","TypeError","$690246f0b6925227$var$_defineProperties","target","props","i","length","descriptor","writable","key","$690246f0b6925227$export$71511d61b312f219","protoProps","staticProps","prototype","$guLUH","$90XvN","jQuery","$","SV_WC_Google_Pay_Handler_v5_15_6","params","_","plugin_id","merchant_id","merchant_name","gateway_id","gateway_merchant_id","gateway_id_dasherized","environment","ajax_url","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","gatewayMerchantID","merchantID","merchantName","ajaxURL","recalculateTotalsNonce","processNonce","buttonStyle","availableCountries","currencyCode","needsShipping","genericError","product_id","productID","baseRequest","apiVersion","apiVersionMinor","tokenizationSpecification","type","parameters","baseCardPaymentMethod","allowedAuthMethods","allowedCardNetworks","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","cardPaymentMethod","assign","paymentsClient","value","allowedPaymentMethods","resolve","_this","getGoogleTransactionInfo","transactionInfo","paymentDataRequest","merchantInfo","merchantId","emailRequired","callbackIntents","shippingAddressRequired","shippingAddressParameters","getGoogleShippingAddressParameters","shippingOptionRequired","args","paymentDataCallbacks","onPaymentAuthorized","paymentData","onPaymentDataChanged","google","payments","api","PaymentsClient","blockUI","Promise","reject","processPayment","transactionState","error","intent","message","reason","unblockUI","intermediatePaymentData","shippingAddress","shippingOptionData","chosenShippingMethod","callbackTrigger","getUpdatedTotals","paymentDataRequestUpdate","newShippingOptionParameters","shippingOptions","getGoogleUnserviceableAddressError","failPayment","data","action","concat","post","response","success","JSON","parse","shippingMethod","allowedCountryCodes","button","getGooglePaymentsClient","createButton","onClick","event","onGooglePaymentButtonClicked","buttonColor","buttonSizeMode","document","getElementById","appendChild","getGooglePaymentDataRequest","totalPriceStatus","prefetchPaymentData","nonce","stringify","location","redirect","preventDefault","loadPaymentData","initProductPage","initCartPage","initCheckoutPage","initGooglePay","isReadyToPay","getGoogleIsReadyToPayRequest","then","result","addGooglePayButton","prefetchGooglePaymentData","catch","uiElement","parents","body","on","console","renderErrors","errors","remove","prepend","join","removeClass","unblock","animate","scrollTop","offset","top","block","overlayCSS","background","opacity","trigger"],"version":3,"file":"sv-wc-payment-gateway-google-pay.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js index 5dd9ba30e..032521b25 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js @@ -1,4 +1,2 @@ -parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c0&&e(o).find("td.woocommerce-PaymentMethod--method").html(i.html()),e(o).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return e(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(t,n){return e(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(t){var n,o;if(t.preventDefault(),0!==(o=(n=e(t.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return o.find("div.view").hide(),o.find("div.edit").show(),o.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(t){var n,o,i,a=this;if(t.preventDefault(),n=e(t.currentTarget),0!==(i=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),i.next(".error").remove(),o={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:i.find("input[name=token-id]").val(),data:i.find("input[name]").serialize()},e.post(this.ajax_url,o).done(function(e){return e.success?(null!=e.data.title&&i.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.nonce&&(a.ajax_nonce=e.data.nonce),n.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(a.i18n.edit_button).addClass("button"),i.removeClass("editing"),a.disable_editing_ui()):a.display_error(i,e.data)}).fail(function(e,t,n){return a.display_error(i,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(t){var n,o;if(t.preventDefault(),0!==(o=(n=e(t.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return o.find("div.view").show(),o.find("div.edit").hide(),o.removeClass("editing"),n.removeClass("cancel-edit").addClass("edit").text(this.i18n.edit_button).addClass("button"),this.disable_editing_ui()}},{key:"enable_editing_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").addClass("editing"),e('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),e('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(t,n){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),i||(i=this.i18n.save_error),o=e(".woocommerce-MyAccount-paymentMethods thead tr th").length,e(''+i+"").insertAfter(t).find("td").delay(8e3).slideUp(200)}}])}(),e(document.body).trigger("sv_wc_payment_methods_handler_v5_15_5_loaded")})}).call(this); -},{}]},{},["nDDW"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-my-payment-methods.js.map \ No newline at end of file +function e(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},o={},i=t.parcelRequire94c2;null==i&&((i=function(e){if(e in n)return n[e].exports;if(e in o){var t=o[e];delete o[e];var i={id:e,exports:{}};return n[e]=i,t.call(i.exports,i,i.exports),i.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){o[e]=t},t.parcelRequire94c2=i);var a=i.register;a("guLUH",function(t,n){e(t.exports,"_",function(){return o});function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}}),a("90XvN",function(t,n){function o(e,t){for(var n=0;n0&&e(o).find("td.woocommerce-PaymentMethod--method").html(i.html()),e(o).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return e(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(t,n){return e(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(t){var n,o;if(t.preventDefault(),0!==(o=(n=e(t.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return o.find("div.view").hide(),o.find("div.edit").show(),o.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(t){var n,o,i,a=this;if(t.preventDefault(),0!==(i=(n=e(t.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),i.next(".error").remove(),o={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:i.find("input[name=token-id]").val(),data:i.find("input[name]").serialize()},e.post(this.ajax_url,o).done(function(e){return e.success?(null!=e.data.title&&i.find(".woocommerce-PaymentMethod--method").html(e.data.title),null!=e.data.nonce&&(a.ajax_nonce=e.data.nonce),n.siblings(".cancel-edit").removeClass("cancel-edit").addClass("edit").text(a.i18n.edit_button).addClass("button"),i.removeClass("editing"),a.disable_editing_ui()):a.display_error(i,e.data)}).fail(function(e,t,n){return a.display_error(i,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(t){var n,o;if(t.preventDefault(),0!==(o=(n=e(t.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return o.find("div.view").show(),o.find("div.edit").hide(),o.removeClass("editing"),n.removeClass("cancel-edit").addClass("edit").text(this.i18n.edit_button).addClass("button"),this.disable_editing_ui()}},{key:"enable_editing_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").addClass("editing"),e('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),e('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return e(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(t,n){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),i||(i=this.i18n.save_error),o=e(".woocommerce-MyAccount-paymentMethods thead tr th").length,e(''+i+"").insertAfter(t).find("td").delay(8e3).slideUp(200)}}]),t}(),e(document.body).trigger("sv_wc_payment_methods_handler_v5_15_5_loaded")})}).call(void 0); +//# sourceMappingURL=sv-wc-payment-gateway-my-payment-methods.js.map diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map index dd8bbc875..c6c59435a 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-my-payment-methods.js.map @@ -1 +1 @@ -{"version":3,"sources":["frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"names":["jQuery","$","window","SV_WC_Payment_Methods_Handler_v5_15_5","args","replace_method_column","bind","remove_duplicate_default_marks","edit_method","save_method","cancel_edit","id","slug","i18n","ajax_url","ajax_nonce","on","event","row","currentTarget","parents","find","length","confirm","delete_ays","preventDefault","hasClass","each","index","element","titleColumn","remove","children","html","button","hide","show","addClass","text","cancel_button","removeClass","enable_editing_ui","data","block_ui","next","action","nonce","token_id","val","serialize","post","done","response","success","title","siblings","edit_button","disable_editing_ui","display_error","fail","jqXHR","textStatus","error","always","unblock_ui","parent","block","message","overlayCSS","background","opacity","unblock","columns","console","save_error","insertAfter","delay","slideUp","document","body","trigger","call"],"mappings":";AAAA,SAAA,EAAA,GAAA,OAAA,EAAA,mBAAA,QAAA,iBAAA,OAAA,SAAA,SAAA,GAAA,cAAA,GAAA,SAAA,GAAA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,IAAA,GAAA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,EAAA,KAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,OAAA,eAAA,EAAA,YAAA,CAAA,UAAA,IAAA,EAAA,SAAA,EAAA,GAAA,IAAA,EAAA,EAAA,EAAA,UAAA,MAAA,UAAA,EAAA,GAAA,EAAA,EAAA,GAAA,SAAA,EAAA,EAAA,GAAA,GAAA,UAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,OAAA,aAAA,QAAA,IAAA,EAAA,CAAA,IAAA,EAAA,EAAA,KAAA,EAAA,GAAA,WAAA,GAAA,UAAA,EAA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AS,KACTC,WAAY,CACVC,WAAY,OACZC,QAAS,QApNjB,CAAA,IAAA,aA4NE,MAAA,WACSrE,OAAAA,EAAE,yCAAyCgE,OAAO,OAAOM,YA7NpE,CAAA,IAAA,gBAuOE,MAAA,SAAcrD,EAAK4C,GAAOK,IACpBK,EADoBL,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAO3BlE,OALPwE,QAAQX,MAAMA,GACTK,IACHA,EAAU,KAAKtD,KAAK6D,YAEtBF,EAAUvE,EAAE,qDAAqDqB,OAC1DrB,EAAE,kCAAoCuE,EAAU,KAAOL,EAAU,cAAcQ,YAAYzD,GAAKG,KAAK,MAAMuD,MAAM,KAAMC,QAAQ,SA9O1I,GAmPO5E,EAAE6E,SAASC,MAAMC,QAAQ,oDAGjCC,KAAK","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */\n jQuery(function($) {\n \"use strict\";\n // The My Payment Methods handler.\n\n // @since 5.1.0\n window.SV_WC_Payment_Methods_Handler_v5_15_5 = class SV_WC_Payment_Methods_Handler_v5_15_5 {\n // Constructs the class.\n\n // @since 5.1.0\n\n // @param [Object] args, with the properties:\n // id: [String] plugin ID\n // slug: [String] plugin slug or dasherized ID\n // i18n: [Object] localized text strings\n // ajax_url: [String] URL for AJAX requests\n // ajax_nonce: [String] nonce for AJAX requests\n constructor(args) {\n // Replace Method column content with Title column content, for FW tokens.\n\n // @since 5.8.0\n this.replace_method_column = this.replace_method_column.bind(this);\n // Removes duplicate \"Default\" marks.\n\n // They are already hidden using CSS, but should also be removed for accessibility.\n\n // @since 5.8.0\n this.remove_duplicate_default_marks = this.remove_duplicate_default_marks.bind(this);\n // Edits a payment method.\n\n // @since 5.1.0\n\n // @param [Object] event jQuery event object\n this.edit_method = this.edit_method.bind(this);\n // Saves a payment method.\n\n // @since 5.1.0\n\n // @param [Object] event jQuery event object\n this.save_method = this.save_method.bind(this);\n // Cancels/stop editing a payment method.\n\n // @since 5.1.0\n\n // @param [Object] event jQuery event object\n this.cancel_edit = this.cancel_edit.bind(this);\n this.id = args.id;\n this.slug = args.slug;\n this.i18n = args.i18n;\n this.ajax_url = args.ajax_url;\n this.ajax_nonce = args.ajax_nonce;\n // replace the \"Method\" column content for FW tokens\n this.replace_method_column();\n // remove duplicate \"Default\" marks\n this.remove_duplicate_default_marks();\n // handle the edit action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.edit\", (event) => {\n return this.edit_method(event);\n });\n // handle the save action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.save\", (event) => {\n return this.save_method(event);\n });\n // handle the cancel action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .cancel-edit\", (event) => {\n return this.cancel_edit(event);\n });\n // handle the delete action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.delete\", (event) => {\n var button, row;\n button = $(event.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(`input[name=plugin-id][value=${this.slug}]`).length === 0) {\n return;\n }\n if (!confirm(this.i18n.delete_ays)) {\n return event.preventDefault();\n }\n });\n // don't follow the Add Payment Method button URL if it's disabled\n $('.button[href*=\"add-payment-method\"]').on('click', event(function() {\n if ($(this).hasClass('disabled')) {\n return event.preventDefault();\n }\n }));\n }\n\n replace_method_column() {\n return $('.woocommerce-MyAccount-paymentMethods').find('tr').each((index, element) => {\n var titleColumn;\n // check if the method belongs to this plugin\n if ($(element).find(`input[name=plugin-id][value=${this.slug}]`).length === 0) {\n return;\n }\n // delete the Title header\n $(element).find('th.woocommerce-PaymentMethod--title').remove();\n titleColumn = $(element).find('td.woocommerce-PaymentMethod--title');\n // Title column is not empty, this is a FW token\n if (titleColumn.children().length > 0) {\n // replace Method column\n $(element).find('td.woocommerce-PaymentMethod--method').html(titleColumn.html());\n }\n // delete Title column\n return $(element).find('td.woocommerce-PaymentMethod--title').remove();\n });\n }\n\n remove_duplicate_default_marks() {\n return $('.woocommerce-MyAccount-paymentMethods').find('tr').each((index, element) => {\n return $(element).find('td.woocommerce-PaymentMethod--default').find('mark.default:not(:first-child)').remove();\n });\n }\n\n edit_method(event) {\n var button, row;\n event.preventDefault();\n button = $(event.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(`input[name=plugin-id][value=${this.slug}]`).length === 0) {\n return;\n }\n row.find('div.view').hide();\n row.find('div.edit').show();\n row.addClass('editing');\n // change the Edit button to \"Cancel\"\n button.text(this.i18n.cancel_button).removeClass('edit').addClass('cancel-edit').removeClass('button');\n return this.enable_editing_ui();\n }\n\n save_method(event) {\n var button, data, row;\n event.preventDefault();\n button = $(event.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(`input[name=plugin-id][value=${this.slug}]`).length === 0) {\n return;\n }\n this.block_ui();\n // remove any previous errors\n row.next('.error').remove();\n data = {\n action: `wc_${this.id}_save_payment_method`,\n nonce: this.ajax_nonce,\n token_id: row.find('input[name=token-id]').val(),\n data: row.find('input[name]').serialize()\n };\n return $.post(this.ajax_url, data).done((response) => {\n if (!response.success) {\n return this.display_error(row, response.data);\n }\n if (response.data.title != null) {\n row.find('.woocommerce-PaymentMethod--method').html(response.data.title);\n }\n if (response.data.nonce != null) {\n this.ajax_nonce = response.data.nonce;\n }\n // change the \"Cancel\" button back to \"Edit\"\n button.siblings('.cancel-edit').removeClass('cancel-edit').addClass('edit').text(this.i18n.edit_button).addClass('button');\n row.removeClass('editing');\n return this.disable_editing_ui();\n }).fail((jqXHR, textStatus, error) => {\n return this.display_error(row, error);\n }).always(() => {\n return this.unblock_ui();\n });\n }\n\n cancel_edit(event) {\n var button, row;\n event.preventDefault();\n button = $(event.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(`input[name=plugin-id][value=${this.slug}]`).length === 0) {\n return;\n }\n row.find('div.view').show();\n row.find('div.edit').hide();\n row.removeClass('editing');\n // change the \"Cancel\" button back to \"Edit\"\n button.removeClass('cancel-edit').addClass('edit').text(this.i18n.edit_button).addClass('button');\n return this.disable_editing_ui();\n }\n\n // Sets the page UI to the \"editing\" state.\n\n // This brings proper focus to the method being edited and prevents\n // other available buttons/actions until the editing is finished or cancelled.\n\n // @since 5.1.1\n enable_editing_ui() {\n // set the methods table as 'editing'\n $(\".woocommerce-MyAccount-paymentMethods\").addClass('editing');\n // disable the Add Payment Method button\n return $('.button[href*=\"add-payment-method\"]').addClass('disabled');\n }\n\n // Sets the page UI back to the default state.\n\n // @since 5.1.1\n disable_editing_ui() {\n // removes the methods table's \"editing\" status\n $(\".woocommerce-MyAccount-paymentMethods\").removeClass('editing');\n // re-enable the Add Payment Method button\n return $('.button[href*=\"add-payment-method\"]').removeClass('disabled');\n }\n\n // Blocks the payment methods table UI.\n\n // @since 5.1.0\n block_ui() {\n return $(\".woocommerce-MyAccount-paymentMethods\").parent('div').block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n\n // Unblocks the payment methods table UI.\n\n // @since 5.1.0\n unblock_ui() {\n return $(\".woocommerce-MyAccount-paymentMethods\").parent('div').unblock();\n }\n\n // Displays an error message to the user.\n\n // @since 5.1.0\n\n // @param [Object] row payment method table row\n // @param [String] error raw error message\n // @param [String] message user error message\n display_error(row, error, message = '') {\n var columns;\n console.error(error);\n if (!message) {\n message = this.i18n.save_error;\n }\n columns = $(\".woocommerce-MyAccount-paymentMethods thead tr th\").length;\n return $('' + message + '').insertAfter(row).find('td').delay(8000).slideUp(200);\n }\n\n };\n // dispatch loaded event\n return $(document.body).trigger('sv_wc_payment_methods_handler_v5_15_5_loaded');\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A7D,EAAH,C,E,CAUZ,IAAA,gBAAA,MAAA,SAAiB,CAAF,CAAO,CAAP,EAAc,IAE/B,EAF+B,EAAA,UAAA,MAAA,CAAA,GAAA,AAAA,KAAA,IAAA,SAAA,CAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAU,GAOtC,OALA,QAAQ,KAAR,CAAe,GAEmB,GAAlC,CAAA,EAAU,IAAC,CAAA,IAAI,CAAC,UAAA,AAAA,EAChB,EAAU,EAAG,qDAAsD,MAAnE,CAEA,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,WAAjF,CAA8F,GAAM,IAApG,CAA0G,MAAO,KAAjH,CAAwH,KAAO,OAA/H,CAAwI,IAP1H,C,E,E,C,IAWhB,EAAG,SAAS,IAAZ,EAAmB,OAAnB,CAA4B,+CAxQtB,E,C,E,I,C,K","sources":["","node_modules/@swc/helpers/esm/_class_call_check.js","node_modules/@swc/helpers/esm/_create_class.js","woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"guLUH\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c0249d4a3fc9bb83$export$71511d61b312f219; });\nfunction $c0249d4a3fc9bb83$export$71511d61b312f219(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\n});\n\nparcelRegister(\"90XvN\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $690246f0b6925227$export$71511d61b312f219; });\nfunction $690246f0b6925227$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction $690246f0b6925227$export$71511d61b312f219(Constructor, protoProps, staticProps) {\n if (protoProps) $690246f0b6925227$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $690246f0b6925227$var$_defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n});\n\n\nvar $guLUH = parcelRequire(\"guLUH\");\n\nvar $90XvN = parcelRequire(\"90XvN\");\n(function() {\n /*\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */ jQuery(function($) {\n \"use strict\";\n // The My Payment Methods handler.\n // @since 5.1.0\n window.SV_WC_Payment_Methods_Handler_v5_15_5 = /*#__PURE__*/ function() {\n function SV_WC_Payment_Methods_Handler_v5_15_5(args) {\n var _this = this;\n (0, $guLUH._)(this, SV_WC_Payment_Methods_Handler_v5_15_5);\n // Replace Method column content with Title column content, for FW tokens.\n // @since 5.8.0\n this.replace_method_column = this.replace_method_column.bind(this);\n // Removes duplicate \"Default\" marks.\n // They are already hidden using CSS, but should also be removed for accessibility.\n // @since 5.8.0\n this.remove_duplicate_default_marks = this.remove_duplicate_default_marks.bind(this);\n // Edits a payment method.\n // @since 5.1.0\n // @param [Object] event jQuery event object\n this.edit_method = this.edit_method.bind(this);\n // Saves a payment method.\n // @since 5.1.0\n // @param [Object] event jQuery event object\n this.save_method = this.save_method.bind(this);\n // Cancels/stop editing a payment method.\n // @since 5.1.0\n // @param [Object] event jQuery event object\n this.cancel_edit = this.cancel_edit.bind(this);\n this.id = args.id;\n this.slug = args.slug;\n this.i18n = args.i18n;\n this.ajax_url = args.ajax_url;\n this.ajax_nonce = args.ajax_nonce;\n // replace the \"Method\" column content for FW tokens\n this.replace_method_column();\n // remove duplicate \"Default\" marks\n this.remove_duplicate_default_marks();\n // handle the edit action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.edit\", function(event1) {\n return _this.edit_method(event1);\n });\n // handle the save action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.save\", function(event1) {\n return _this.save_method(event1);\n });\n // handle the cancel action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .cancel-edit\", function(event1) {\n return _this.cancel_edit(event1);\n });\n // handle the delete action\n $(\".woocommerce-MyAccount-paymentMethods\").on('click', \".woocommerce-PaymentMethod--actions .button.delete\", function(event1) {\n var button, row;\n button = $(event1.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(\"input[name=plugin-id][value=\".concat(_this.slug, \"]\")).length === 0) return;\n if (!confirm(_this.i18n.delete_ays)) return event1.preventDefault();\n });\n // don't follow the Add Payment Method button URL if it's disabled\n $('.button[href*=\"add-payment-method\"]').on('click', event(function() {\n if ($(this).hasClass('disabled')) return event.preventDefault();\n }));\n }\n (0, $90XvN._)(SV_WC_Payment_Methods_Handler_v5_15_5, [\n {\n key: \"replace_method_column\",\n value: function replace_method_column() {\n var _this = this;\n return $('.woocommerce-MyAccount-paymentMethods').find('tr').each(function(index, element) {\n var titleColumn;\n // check if the method belongs to this plugin\n if ($(element).find(\"input[name=plugin-id][value=\".concat(_this.slug, \"]\")).length === 0) return;\n // delete the Title header\n $(element).find('th.woocommerce-PaymentMethod--title').remove();\n titleColumn = $(element).find('td.woocommerce-PaymentMethod--title');\n // Title column is not empty, this is a FW token\n if (titleColumn.children().length > 0) // replace Method column\n $(element).find('td.woocommerce-PaymentMethod--method').html(titleColumn.html());\n // delete Title column\n return $(element).find('td.woocommerce-PaymentMethod--title').remove();\n });\n }\n },\n {\n key: \"remove_duplicate_default_marks\",\n value: function remove_duplicate_default_marks() {\n return $('.woocommerce-MyAccount-paymentMethods').find('tr').each(function(index, element) {\n return $(element).find('td.woocommerce-PaymentMethod--default').find('mark.default:not(:first-child)').remove();\n });\n }\n },\n {\n key: \"edit_method\",\n value: function edit_method(event1) {\n var button, row;\n event1.preventDefault();\n button = $(event1.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(\"input[name=plugin-id][value=\".concat(this.slug, \"]\")).length === 0) return;\n row.find('div.view').hide();\n row.find('div.edit').show();\n row.addClass('editing');\n // change the Edit button to \"Cancel\"\n button.text(this.i18n.cancel_button).removeClass('edit').addClass('cancel-edit').removeClass('button');\n return this.enable_editing_ui();\n }\n },\n {\n key: \"save_method\",\n value: function save_method(event1) {\n var _this = this;\n var button, data, row;\n event1.preventDefault();\n button = $(event1.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(\"input[name=plugin-id][value=\".concat(this.slug, \"]\")).length === 0) return;\n this.block_ui();\n // remove any previous errors\n row.next('.error').remove();\n data = {\n action: \"wc_\".concat(this.id, \"_save_payment_method\"),\n nonce: this.ajax_nonce,\n token_id: row.find('input[name=token-id]').val(),\n data: row.find('input[name]').serialize()\n };\n return $.post(this.ajax_url, data).done(function(response) {\n if (!response.success) return _this.display_error(row, response.data);\n if (response.data.title != null) row.find('.woocommerce-PaymentMethod--method').html(response.data.title);\n if (response.data.nonce != null) _this.ajax_nonce = response.data.nonce;\n // change the \"Cancel\" button back to \"Edit\"\n button.siblings('.cancel-edit').removeClass('cancel-edit').addClass('edit').text(_this.i18n.edit_button).addClass('button');\n row.removeClass('editing');\n return _this.disable_editing_ui();\n }).fail(function(jqXHR, textStatus, error) {\n return _this.display_error(row, error);\n }).always(function() {\n return _this.unblock_ui();\n });\n }\n },\n {\n key: \"cancel_edit\",\n value: function cancel_edit(event1) {\n var button, row;\n event1.preventDefault();\n button = $(event1.currentTarget);\n row = button.parents('tr');\n // check if the method belongs to this plugin\n if (row.find(\"input[name=plugin-id][value=\".concat(this.slug, \"]\")).length === 0) return;\n row.find('div.view').show();\n row.find('div.edit').hide();\n row.removeClass('editing');\n // change the \"Cancel\" button back to \"Edit\"\n button.removeClass('cancel-edit').addClass('edit').text(this.i18n.edit_button).addClass('button');\n return this.disable_editing_ui();\n }\n },\n {\n // Sets the page UI to the \"editing\" state.\n // This brings proper focus to the method being edited and prevents\n // other available buttons/actions until the editing is finished or cancelled.\n // @since 5.1.1\n key: \"enable_editing_ui\",\n value: function enable_editing_ui() {\n // set the methods table as 'editing'\n $(\".woocommerce-MyAccount-paymentMethods\").addClass('editing');\n // disable the Add Payment Method button\n return $('.button[href*=\"add-payment-method\"]').addClass('disabled');\n }\n },\n {\n // Sets the page UI back to the default state.\n // @since 5.1.1\n key: \"disable_editing_ui\",\n value: function disable_editing_ui() {\n // removes the methods table's \"editing\" status\n $(\".woocommerce-MyAccount-paymentMethods\").removeClass('editing');\n // re-enable the Add Payment Method button\n return $('.button[href*=\"add-payment-method\"]').removeClass('disabled');\n }\n },\n {\n // Blocks the payment methods table UI.\n // @since 5.1.0\n key: \"block_ui\",\n value: function block_ui() {\n return $(\".woocommerce-MyAccount-paymentMethods\").parent('div').block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n },\n {\n // Unblocks the payment methods table UI.\n // @since 5.1.0\n key: \"unblock_ui\",\n value: function unblock_ui() {\n return $(\".woocommerce-MyAccount-paymentMethods\").parent('div').unblock();\n }\n },\n {\n // Displays an error message to the user.\n // @since 5.1.0\n // @param [Object] row payment method table row\n // @param [String] error raw error message\n // @param [String] message user error message\n key: \"display_error\",\n value: function display_error(row, error) {\n var message = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : '';\n var columns;\n console.error(error);\n if (!message) message = this.i18n.save_error;\n columns = $(\".woocommerce-MyAccount-paymentMethods thead tr th\").length;\n return $('' + message + '').insertAfter(row).find('td').delay(8000).slideUp(200);\n }\n }\n ]);\n return SV_WC_Payment_Methods_Handler_v5_15_5;\n }();\n // dispatch loaded event\n return $(document.body).trigger('sv_wc_payment_methods_handler_v5_15_5_loaded');\n });\n}).call(undefined);\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-my-payment-methods.js.map\n","function _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _class_call_check as _ };\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\t# The My Payment Methods handler.\n\t#\n\t# @since 5.1.0\n\tclass window.SV_WC_Payment_Methods_Handler_v5_15_5\n\n\n\t\t# Constructs the class.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] args, with the properties:\n\t\t# id: [String] plugin ID\n\t\t# slug: [String] plugin slug or dasherized ID\n\t\t# i18n: [Object] localized text strings\n\t\t# ajax_url: [String] URL for AJAX requests\n\t\t# ajax_nonce: [String] nonce for AJAX requests\n\t\tconstructor: ( args ) ->\n\n\t\t\t@id = args.id\n\t\t\t@slug = args.slug\n\t\t\t@i18n = args.i18n\n\t\t\t@ajax_url = args.ajax_url\n\t\t\t@ajax_nonce = args.ajax_nonce\n\n\t\t\t# replace the \"Method\" column content for FW tokens\n\t\t\tthis.replace_method_column()\n\n\t\t\t# remove duplicate \"Default\" marks\n\t\t\tthis.remove_duplicate_default_marks()\n\n\t\t\t# handle the edit action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.edit\", ( event ) => this.edit_method( event ) )\n\n\t\t\t# handle the save action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.save\", ( event ) => this.save_method( event ) )\n\n\t\t\t# handle the cancel action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .cancel-edit\", ( event ) => this.cancel_edit( event ) )\n\n\t\t\t# handle the delete action\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).on( 'click', \".woocommerce-PaymentMethod--actions .button.delete\", ( event ) =>\n\n\t\t\t\tbutton = $( event.currentTarget )\n\t\t\t\trow = button.parents( 'tr' )\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\tif not confirm( @i18n.delete_ays )\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t)\n\n\t\t\t# don't follow the Add Payment Method button URL if it's disabled\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).on 'click', event ->\n\t\t\t\tevent.preventDefault() if $( this ).hasClass( 'disabled' )\n\n\n\t\t# Replace Method column content with Title column content, for FW tokens.\n\t\t#\n\t\t# @since 5.8.0\n\t\treplace_method_column: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t# check if the method belongs to this plugin\n\t\t\t\tif $( element ).find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\t\treturn\n\n\t\t\t\t# delete the Title header\n\t\t\t\t$( element ).find( 'th.woocommerce-PaymentMethod--title' ).remove()\n\n\t\t\t\ttitleColumn = $( element ).find( 'td.woocommerce-PaymentMethod--title' )\n\n\t\t\t\t# Title column is not empty, this is a FW token\n\t\t\t\tif ( titleColumn.children().length > 0 )\n\n\t\t\t\t\t# replace Method column\n\t\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--method' ).html( titleColumn.html() )\n\n\t\t\t\t# delete Title column\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--title' ).remove()\n\n\n\t\t# Removes duplicate \"Default\" marks.\n\t\t#\n\t\t# They are already hidden using CSS, but should also be removed for accessibility.\n\t\t#\n\t\t# @since 5.8.0\n\t\tremove_duplicate_default_marks: =>\n\n\t\t\t$( '.woocommerce-MyAccount-paymentMethods' ).find( 'tr' ).each ( index, element ) =>\n\n\t\t\t\t$( element ).find( 'td.woocommerce-PaymentMethod--default' ).find( 'mark.default:not(:first-child)' ).remove()\n\n\n\t\t# Edits a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tedit_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).hide()\n\t\t\trow.find( 'div.edit' ).show()\n\t\t\trow.addClass( 'editing' )\n\n\t\t\t# change the Edit button to \"Cancel\"\n\t\t\tbutton.text( @i18n.cancel_button ).removeClass( 'edit' ).addClass( 'cancel-edit' ).removeClass( 'button' )\n\n\t\t\tthis.enable_editing_ui()\n\n\n\t\t# Saves a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tsave_method: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\tthis.block_ui()\n\n\t\t\t# remove any previous errors\n\t\t\trow.next( '.error' ).remove()\n\n\t\t\tdata =\n\t\t\t\taction: \"wc_#{@id}_save_payment_method\"\n\t\t\t\tnonce: @ajax_nonce\n\t\t\t\ttoken_id: row.find( 'input[name=token-id]' ).val()\n\t\t\t\tdata: row.find( 'input[name]' ).serialize()\n\n\t\t\t$.post( @ajax_url, data )\n\n\t\t\t\t.done ( response ) =>\n\n\t\t\t\t\treturn this.display_error( row, response.data ) unless response.success\n\n\t\t\t\t\tif response.data.title?\n\t\t\t\t\t\trow.find('.woocommerce-PaymentMethod--method').html( response.data.title )\n\n\t\t\t\t\tif response.data.nonce?\n\t\t\t\t\t\t@ajax_nonce = response.data.nonce\n\n\t\t\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\t\t\tbutton.siblings( '.cancel-edit' ).removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\t\t\trow.removeClass( 'editing' )\n\n\t\t\t\t\tthis.disable_editing_ui()\n\n\t\t\t\t.fail ( jqXHR, textStatus, error ) =>\n\n\t\t\t\t\tthis.display_error( row, error )\n\n\t\t\t\t.always =>\n\n\t\t\t\t\tthis.unblock_ui()\n\n\n\t\t# Cancels/stop editing a payment method.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] event jQuery event object\n\t\tcancel_edit: ( event ) =>\n\n\t\t\tevent.preventDefault()\n\n\t\t\tbutton = $( event.currentTarget )\n\t\t\trow = button.parents( 'tr' )\n\n\t\t\t# check if the method belongs to this plugin\n\t\t\tif row.find( \"input[name=plugin-id][value=#{@slug}]\" ).length is 0\n\t\t\t\treturn\n\n\t\t\trow.find( 'div.view' ).show()\n\t\t\trow.find( 'div.edit' ).hide()\n\t\t\trow.removeClass( 'editing' )\n\n\t\t\t# change the \"Cancel\" button back to \"Edit\"\n\t\t\tbutton.removeClass( 'cancel-edit' ).addClass( 'edit' ).text( @i18n.edit_button ).addClass( 'button' )\n\n\t\t\tthis.disable_editing_ui()\n\n\n\t\t# Sets the page UI to the \"editing\" state.\n\t\t#\n\t\t# This brings proper focus to the method being edited and prevents\n\t\t# other available buttons/actions until the editing is finished or cancelled.\n\t\t#\n\t\t# @since 5.1.1\n\t\tenable_editing_ui: ->\n\n\t\t\t# set the methods table as 'editing'\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).addClass( 'editing' )\n\n\t\t\t# disable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).addClass( 'disabled' )\n\n\n\t\t# Sets the page UI back to the default state.\n\t\t#\n\t\t# @since 5.1.1\n\t\tdisable_editing_ui: ->\n\n\t\t\t# removes the methods table's \"editing\" status\n\t\t\t$( \".woocommerce-MyAccount-paymentMethods\" ).removeClass( 'editing' )\n\n\t\t\t# re-enable the Add Payment Method button\n\t\t\t$( '.button[href*=\"add-payment-method\"]' ).removeClass( 'disabled' )\n\n\n\t\t# Blocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).block( message: null, overlayCSS: background: '#fff', opacity: 0.6 )\n\n\n\t\t# Unblocks the payment methods table UI.\n\t\t#\n\t\t# @since 5.1.0\n\t\tunblock_ui: -> $( \".woocommerce-MyAccount-paymentMethods\" ).parent( 'div' ).unblock()\n\n\n\t\t# Displays an error message to the user.\n\t\t#\n\t\t# @since 5.1.0\n\t\t#\n\t\t# @param [Object] row payment method table row\n\t\t# @param [String] error raw error message\n\t\t# @param [String] message user error message\n\t\tdisplay_error: ( row, error, message = '' ) ->\n\n\t\t\tconsole.error( error )\n\n\t\t\tmessage = @i18n.save_error unless message\n\t\t\tcolumns = $( \".woocommerce-MyAccount-paymentMethods thead tr th\" ).length\n\n\t\t\t$( '' + message + '' ).insertAfter( row ).find( 'td' ).delay( 8000 ).slideUp( 200 )\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_15_5_loaded' )\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$c0249d4a3fc9bb83$export$71511d61b312f219","instance","Constructor","TypeError","$690246f0b6925227$var$_defineProperties","target","props","i","length","descriptor","writable","key","$690246f0b6925227$export$71511d61b312f219","protoProps","staticProps","prototype","$guLUH","$90XvN","jQuery","$","SV_WC_Payment_Methods_Handler_v5_15_5","args","_this","_","replace_method_column","bind","remove_duplicate_default_marks","edit_method","save_method","cancel_edit","slug","i18n","ajax_url","ajax_nonce","on","event1","row","button","currentTarget","parents","find","concat","confirm","delete_ays","preventDefault","event","hasClass","value","each","index","element","titleColumn","remove","children","html","hide","show","addClass","text","cancel_button","removeClass","enable_editing_ui","data","block_ui","next","action","nonce","token_id","val","serialize","post","done","response","success","title","siblings","edit_button","disable_editing_ui","display_error","fail","jqXHR","textStatus","error","always","unblock_ui","parent","block","message","overlayCSS","background","opacity","unblock","columns","arguments","console","save_error","insertAfter","delay","slideUp","document","body","trigger","undefined"],"version":3,"file":"sv-wc-payment-gateway-my-payment-methods.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js index 384583adf..4e5224ad3 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js @@ -1,4 +1,2 @@ -parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c0&&e.trigger("change"),r.val()&&r.val().length>0&&r.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),a(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return n.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var t,r,n,i;return t=a(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=a(".js-sv-wc-payment-gateway-credit-card-form-expiry"),n=a(".js-sv-wc-payment-gateway-credit-card-form-csc"),r=a.payment.cardType(t.val()),e.call(this.enabled_card_types,r)<0?t.addClass("invalid-card-type"):t.removeClass("invalid-card-type"),a.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),a.payment.validateCardCVC(n.val())?n.addClass("identified"):n.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,r,n;return r=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&r.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&r.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||r.push(this.params.cvv_missing))),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),n=a.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&r.push(this.params.card_number_length_invalid),/\D/.test(e)&&r.push(this.params.card_number_digits_invalid),a.payment.validateCardNumber(e)||r.push(this.params.card_number_invalid)):r.push(this.params.card_number_missing),a.payment.validateCardExpiry(n)||r.push(this.params.card_exp_date_invalid)),r.length>0?(this.render_errors(r),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||(t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return a(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('
    • '+e.join("
    • ")+"
    "),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),a("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,r,n;if(n=this.id_dasherized,this.csc_required,r=this.csc_required_for_tokens,t=a("div.js-wc-".concat(n,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),a("input.js-wc-".concat(this.id_dasherized,"-payment-token")).on("change",function(){if(a("input.js-wc-".concat(n,"-payment-token:checked")).val()){if(t.slideUp(200),r)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),r)return e.removeClass("form-row-first").addClass("form-row-last"),t.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),a("input#createaccount").on("change",function(){var e;return e=a("input.js-wc-".concat(n,"-tokenize-payment-method")).closest("p.form-row"),a(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!a("input#createaccount").is(":checked"))return a("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}])}(),a(document.body).trigger("sv_wc_payment_form_handler_v5_15_5_loaded")})}).call(this); -},{}]},{},["7JA8"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map \ No newline at end of file +function e(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a={},n={},r=t.parcelRequire94c2;null==r&&((r=function(e){if(e in a)return a[e].exports;if(e in n){var t=n[e];delete n[e];var r={id:e,exports:{}};return a[e]=r,t.call(r.exports,r,r.exports),r.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){n[e]=t},t.parcelRequire94c2=r);var i=r.register;i("guLUH",function(t,a){e(t.exports,"_",function(){return n});function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}}),i("90XvN",function(t,a){function n(e,t){for(var a=0;a0&&e.trigger("change"),n.val()&&n.val().length>0&&n.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return r.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var a,n,r,i;return(a=t(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=t(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=t(".js-sv-wc-payment-gateway-credit-card-form-csc"),n=t.payment.cardType(a.val()),0>e.call(this.enabled_card_types,n)?a.addClass("invalid-card-type"):a.removeClass("invalid-card-type"),t.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),t.payment.validateCardCVC(r.val()))?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,a,n,r;return(n=[],null!=(a=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(a?(/\D/.test(a)&&n.push(this.params.cvv_digits_invalid),(a.length<3||a.length>4)&&n.push(this.params.cvv_length_invalid)):this.csc_required&&(!this.saved_payment_method_selected||this.csc_required_for_tokens)&&n.push(this.params.cvv_missing)),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),r=t.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&n.push(this.params.card_number_length_invalid),/\D/.test(e)&&n.push(this.params.card_number_digits_invalid),t.payment.validateCardNumber(e)||n.push(this.params.card_number_invalid)):n.push(this.params.card_number_missing),t.payment.validateCardExpiry(r)||n.push(this.params.card_exp_date_invalid)),n.length>0)?(this.render_errors(n),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||((t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0)?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('
    • '+e.join("
    • ")+"
    "),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),t("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,a,n,r;if(r=this.id_dasherized,this.csc_required,n=this.csc_required_for_tokens,e=(a=t("div.js-wc-".concat(r,"-new-payment-method-form"))).find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),t("input.js-wc-".concat(this.id_dasherized,"-payment-token")).on("change",function(){if(t("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(a.slideUp(200),n)return e.removeClass("form-row-last").addClass("form-row-first"),a.after(e)}else if(a.slideDown(200),n)return e.removeClass("form-row-first").addClass("form-row-last"),a.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),t("input#createaccount").on("change",function(){var e;return(e=t("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),t(this).is(":checked"))?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!t("input#createaccount").is(":checked"))return t("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}]),a}(),t(document.body).trigger("sv_wc_payment_form_handler_v5_15_5_loaded")})}).call(void 0); +//# sourceMappingURL=sv-wc-payment-gateway-payment-form.js.map diff --git a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map index 3ae4e3271..8a27df693 100644 --- a/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map +++ b/woocommerce/payment-gateway/assets/dist/frontend/sv-wc-payment-gateway-payment-form.js.map @@ -1 +1 @@ -{"version":3,"sources":["frontend/sv-wc-payment-gateway-payment-form.coffee"],"names":["indexOf","jQuery","$","window","SV_WC_Payment_Form_Handler_v5_15_5","args","id","id_dasherized","plugin_id","type","csc_required","csc_required_for_tokens","enabled_card_types","length","form","handle_checkout_page","handle_pay_page","console","log","handle_add_payment_method_page","params","on","handle_sample_check_hint","document","trigger","instance","body","format_credit_card_inputs","set_payment_fields","handle_saved_payment_methods","validate_payment_data","submit","val","$required_fields","payment_fields","find","each","i","input","handler","valid","is","saved_payment_method_selected","validate_card_data","validate_account_data","triggerHandler","payment_form","passed_validation","$card_number","$csc","$expiry","payment","do_inline_credit_card_validation","$card_type","cardType","call","addClass","removeClass","validateCardExpiry","validateCardCVC","account_number","csc","errors","expiry","test","push","cvv_digits_invalid","cvv_length_invalid","cvv_missing","cardExpiryVal","replace","card_number_length_invalid","card_number_digits_invalid","validateCardNumber","card_number_invalid","card_number_missing","card_exp_date_invalid","render_errors","routing_number","routing_number_length_invalid","routing_number_digits_invalid","routing_number_missing","account_number_length_invalid","account_number_invalid","account_number_missing","remove","prepend","join","unblock","blur","animate","scrollTop","offset","top","$csc_field","$new_payment_method_selection","closest","tokenized_payment_method_selected","slideUp","after","slideDown","change","$parent_row","next","show","hide","$sample_check","block","message","overlayCSS","background","opacity"],"mappings":";AAAA,SAAA,EAAA,GAAA,OAAA,EAAA,mBAAA,QAAA,iBAAA,OAAA,SAAA,SAAA,GAAA,cAAA,GAAA,SAAA,GAAA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,IAAA,GAAA,SAAA,EAAA,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,cAAA,EAAA,UAAA,IAAA,EAAA,UAAA,GAAA,OAAA,eAAA,EAAA,EAAA,EAAA,KAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,OAAA,eAAA,EAAA,YAAA,CAAA,UAAA,IAAA,EAAA,SAAA,EAAA,GAAA,IAAA,EAAA,EAAA,EAAA,UAAA,MAAA,UAAA,EAAA,GAAA,EAAA,EAAA,GAAA,SAAA,EAAA,EAAA,GAAA,GAAA,UAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,OAAA,aAAA,QAAA,IAAA,EAAA,CAAA,IAAA,EAAA,EAAA,KAAA,EAAA,GAAA,WAAA,GAAA,UAAA,EAAA,GAAA,OAAA,EAAA,MAAA,IAAA,UAAA,gDAAA,OAAA,WAAA,EAAA,OAAA,QAAA,IAAA,WASMA,IAAAA,EAAU,GAAGA,QAEjBC,OAAO,SAASC,GACd,aAsZOA,OArZPC,OAAOC,mCAAP,WAAA,OAAA,EAWcC,SAAAA,EAAAA,GAAM,IAAA,EAAA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,QAAQ,iDAGjC+B,KAAK","file":"sv-wc-payment-gateway-payment-form.js","sourceRoot":"../js","sourcesContent":["(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */\n var indexOf = [].indexOf;\n\n jQuery(function($) {\n \"use strict\";\n window.SV_WC_Payment_Form_Handler_v5_15_5 = class SV_WC_Payment_Form_Handler_v5_15_5 {\n // Public: Instantiate Payment Form Handler\n\n // args - object with properties:\n // id - gateway ID\n // id_dasherized - gateway ID dasherized\n // plugin_id - plugin ID\n // type - gateway type, either `credit-card` or `echeck`\n // csc_required - true if the gateway requires the CSC field to be displayed\n\n // Returns SV_WC_Payment_Form_Handler_v5_15_5 instance\n constructor(args) {\n this.id = args.id;\n this.id_dasherized = args.id_dasherized;\n this.plugin_id = args.plugin_id;\n this.type = args.type;\n this.csc_required = args.csc_required;\n this.csc_required_for_tokens = args.csc_required_for_tokens;\n this.enabled_card_types = args.enabled_card_types;\n // which payment form?\n if ($('form.checkout').length) {\n this.form = $('form.checkout');\n this.handle_checkout_page();\n } else if ($('form#order_review').length) {\n this.form = $('form#order_review');\n this.handle_pay_page();\n } else if ($('form#add_payment_method').length) {\n this.form = $('form#add_payment_method');\n this.handle_add_payment_method_page();\n } else {\n console.log('No payment form found!');\n return;\n }\n // localized error messages\n this.params = window[\"sv_wc_payment_gateway_payment_form_params\"];\n if (this.type === 'echeck') {\n // handle sample check image hint\n this.form.on('click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', () => {\n return this.handle_sample_check_hint();\n });\n }\n $(document).trigger('sv_wc_payment_form_handler_init', {\n id: this.id,\n instance: this\n });\n }\n\n // Public: Handle required actions on the checkout page\n\n // Returns nothing.\n handle_checkout_page() {\n if (this.type === 'credit-card') {\n // format/validate credit card inputs using jQuery.payment\n $(document.body).on('updated_checkout', () => {\n return this.format_credit_card_inputs();\n });\n }\n // updated payment fields jQuery object on each checkout update (prevents stale data)\n $(document.body).on('updated_checkout', () => {\n return this.set_payment_fields();\n });\n // handle saved payment methods\n // note on the checkout page, this is bound to `updated_checkout` so it\n // fires even when other parts of the checkout are changed\n $(document.body).on('updated_checkout', () => {\n return this.handle_saved_payment_methods();\n });\n // validate payment data before order is submitted\n return this.form.on(`checkout_place_order_${this.id}`, () => {\n return this.validate_payment_data();\n });\n }\n\n // Public: Handle required actions on the Order > Pay page\n\n // Returns nothing.\n handle_pay_page() {\n this.set_payment_fields();\n // format/validate credit card inputs using jQuery.payment\n if (this.type === 'credit-card') {\n this.format_credit_card_inputs();\n }\n // handle saved payment methods\n this.handle_saved_payment_methods();\n // validate payment data before order is submitted\n return this.form.submit(() => {\n if ($('#order_review input[name=payment_method]:checked').val() === this.id) {\n // but only when one of our payment gateways is selected\n return this.validate_payment_data();\n }\n });\n }\n\n // Public: Handle required actions on the Add Payment Method page\n\n // Returns nothing.\n handle_add_payment_method_page() {\n this.set_payment_fields();\n // format/validate credit card inputs using jQuery.payment\n if (this.type === 'credit-card') {\n this.format_credit_card_inputs();\n }\n // validate payment data before order is submitted\n return this.form.submit(() => {\n if ($('#add_payment_method input[name=payment_method]:checked').val() === this.id) {\n // but only when one of our payment gateways is selected\n return this.validate_payment_data();\n }\n });\n }\n\n // Public: Set payment fields class variable, this is done\n // during the updated_checkout event as otherwise the reference to\n // the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n\n // This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n\n // Returns nothing.\n set_payment_fields() {\n var $required_fields;\n this.payment_fields = $(`.payment_method_${this.id}`);\n $required_fields = this.payment_fields.find('.validate-required .input-text');\n return $required_fields.each((i, input) => {\n // if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n if ($(input).val()) {\n return false;\n }\n // otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n return $(input).trigger('input');\n });\n }\n\n // Public: Validate Payment data when order is placed\n\n // Returns boolean, true if payment data is valid, false otherwise\n validate_payment_data() {\n var handler, valid;\n if (this.form.is('.processing')) {\n // bail when already processing\n return false;\n }\n this.saved_payment_method_selected = this.payment_fields.find('.js-sv-wc-payment-gateway-payment-token:checked').val();\n // perform internal validations (all fields present & valid, etc)\n valid = this.type === 'credit-card' ? this.validate_card_data() : this.validate_account_data();\n // let gateways perform their own validation prior to form submission\n handler = $(document.body).triggerHandler('sv_wc_payment_form_valid_payment_data', {\n payment_form: this,\n passed_validation: valid\n }) !== false;\n return valid && handler;\n }\n\n // Public: format card data using jQuery.Payment\n\n // Returns nothing.\n format_credit_card_inputs() {\n var $card_number, $csc, $expiry;\n $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n if ($card_number.val() && $card_number.val().length > 0) {\n $card_number.trigger('change');\n }\n if ($expiry.val() && $expiry.val().length > 0) {\n $expiry.trigger('change');\n }\n if ($csc.val() && $csc.val().length > 0) {\n $csc.trigger('change');\n }\n // perform inline validation on credit card inputs\n return $('.js-sv-wc-payment-gateway-credit-card-form-input').on('change paste keyup', () => {\n return this.do_inline_credit_card_validation();\n });\n }\n\n // Public: perform inline validation on credit card fields\n\n // Returns nothing.\n do_inline_credit_card_validation() {\n var $card_number, $card_type, $csc, $expiry;\n $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number');\n $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry');\n $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc');\n $card_type = $.payment.cardType($card_number.val());\n if (indexOf.call(this.enabled_card_types, $card_type) < 0) {\n $card_number.addClass('invalid-card-type');\n } else {\n $card_number.removeClass('invalid-card-type');\n }\n if ($.payment.validateCardExpiry($expiry.payment('cardExpiryVal'))) {\n $expiry.addClass('identified');\n } else {\n $expiry.removeClass('identified');\n }\n if ($.payment.validateCardCVC($csc.val())) {\n return $csc.addClass('identified');\n } else {\n return $csc.removeClass('identified');\n }\n }\n\n // Public: Perform validation on the credit card info entered\n\n // Return boolean, true if credit card info is valid, false otherwise\n validate_card_data() {\n var account_number, csc, errors, expiry;\n errors = [];\n csc = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-csc').val();\n // always validate the CSC if present\n if (csc != null) {\n if (csc) {\n if (/\\D/.test(csc)) {\n errors.push(this.params.cvv_digits_invalid);\n }\n if (csc.length < 3 || csc.length > 4) {\n errors.push(this.params.cvv_length_invalid);\n }\n } else if (this.csc_required) {\n if (!this.saved_payment_method_selected || this.csc_required_for_tokens) {\n errors.push(this.params.cvv_missing);\n }\n }\n }\n // Only validate the other CC fields if necessary\n if (!this.saved_payment_method_selected) {\n account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val();\n expiry = $.payment.cardExpiryVal(this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').val());\n // replace any dashes or spaces in the card number\n account_number = account_number.replace(/-|\\s/g, '');\n // validate card number\n if (!account_number) {\n errors.push(this.params.card_number_missing);\n } else {\n if (account_number.length < 12 || account_number.length > 19) {\n errors.push(this.params.card_number_length_invalid);\n }\n if (/\\D/.test(account_number)) {\n errors.push(this.params.card_number_digits_invalid);\n }\n if (!$.payment.validateCardNumber(account_number)) { // performs luhn check\n errors.push(this.params.card_number_invalid);\n }\n }\n if (!$.payment.validateCardExpiry(expiry)) { // validates future date\n \n // validate expiration date\n errors.push(this.params.card_exp_date_invalid);\n }\n }\n if (errors.length > 0) {\n this.render_errors(errors);\n return false;\n } else {\n // get rid of any space/dash characters\n this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val(account_number);\n return true;\n }\n }\n\n // Public: Perform validation on the eCheck info entered\n\n // Return boolean, true if eCheck info is valid, false otherwise\n validate_account_data() {\n var account_number, errors, routing_number;\n if (this.saved_payment_method_selected) {\n return true;\n }\n errors = [];\n routing_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val();\n account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val();\n // validate routing number\n if (!routing_number) {\n errors.push(this.params.routing_number_missing);\n } else {\n if (9 !== routing_number.length) {\n errors.push(this.params.routing_number_length_invalid);\n }\n if (/\\D/.test(routing_number)) {\n errors.push(this.params.routing_number_digits_invalid);\n }\n }\n // validate account number\n if (!account_number) {\n errors.push(this.params.account_number_missing);\n } else {\n if (account_number.length < 3 || account_number.length > 17) {\n errors.push(this.params.account_number_length_invalid);\n }\n if (/\\D/.test(account_number)) {\n errors.push(this.params.account_number_invalid);\n }\n }\n if (errors.length > 0) {\n this.render_errors(errors);\n return false;\n } else {\n // get rid of any space/dash characters\n this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val(account_number);\n return true;\n }\n }\n\n // Public: Render any new errors and bring them into the viewport\n\n // Returns nothing.\n render_errors(errors) {\n // hide and remove any previous errors\n $('.woocommerce-error, .woocommerce-message').remove();\n // add errors\n this.form.prepend('
    • ' + errors.join('
    • ') + '
    ');\n // unblock UI\n this.form.removeClass('processing').unblock();\n this.form.find('.input-text, select').blur();\n // scroll to top\n return $('html, body').animate({\n scrollTop: this.form.offset().top - 100\n }, 1000);\n }\n\n // Public: Handle associated actions for saved payment methods\n\n // Returns nothing.\n handle_saved_payment_methods() {\n var $csc_field, $new_payment_method_selection, csc_required, csc_required_for_tokens, id_dasherized;\n // make available inside change events\n id_dasherized = this.id_dasherized;\n csc_required = this.csc_required;\n csc_required_for_tokens = this.csc_required_for_tokens;\n $new_payment_method_selection = $(`div.js-wc-${id_dasherized}-new-payment-method-form`);\n $csc_field = $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-csc').closest('.form-row');\n // show/hide the saved payment methods when a saved payment method is de-selected/selected\n $(`input.js-wc-${this.id_dasherized}-payment-token`).on('change', function() {\n var tokenized_payment_method_selected;\n tokenized_payment_method_selected = $(`input.js-wc-${id_dasherized}-payment-token:checked`).val();\n if (tokenized_payment_method_selected) {\n // using an existing tokenized payment method, hide the 'new method' fields\n $new_payment_method_selection.slideUp(200);\n // move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n if (csc_required_for_tokens) {\n $csc_field.removeClass('form-row-last').addClass('form-row-first');\n return $new_payment_method_selection.after($csc_field);\n }\n } else {\n // use new payment method, display the 'new method' fields\n $new_payment_method_selection.slideDown(200);\n // move the CSC field back into its regular spot\n if (csc_required_for_tokens) {\n $csc_field.removeClass('form-row-first').addClass('form-row-last');\n return $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').closest('.form-row').after($csc_field);\n }\n }\n }).change();\n // display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n // but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n $('input#createaccount').on('change', function() {\n var $parent_row;\n $parent_row = $(`input.js-wc-${id_dasherized}-tokenize-payment-method`).closest('p.form-row');\n if ($(this).is(':checked')) {\n $parent_row.slideDown();\n return $parent_row.next().show();\n } else {\n $parent_row.hide();\n return $parent_row.next().hide();\n }\n });\n if (!$('input#createaccount').is(':checked')) {\n return $('input#createaccount').change();\n }\n }\n\n // Public: Handle showing/hiding the sample check image\n\n // Returns nothing.\n handle_sample_check_hint() {\n var $sample_check;\n $sample_check = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-sample-check');\n if ($sample_check.is(\":visible\")) {\n return $sample_check.slideUp();\n } else {\n return $sample_check.slideDown();\n }\n }\n\n // Blocks the payment form UI\n\n // @since 3.0.0\n block_ui() {\n return this.form.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n\n // Unblocks the payment form UI\n\n // @since 3.0.0\n unblock_ui() {\n return this.form.unblock();\n }\n\n };\n // dispatch loaded event\n return $(document.body).trigger(\"sv_wc_payment_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AAZ,GACA,EAAY,IAAZ,GAAmB,IAAnB,KAEA,EAAY,IAAZ,GACA,EAAY,IAAZ,GAAmB,IAAnB,GARsC,GAUxC,CAA2C,EAAG,uBAAwB,EAA3B,CAA+B,YAA1E,OAAA,EAAG,uBAAwB,MAA3B,EAhD6B,C,E,CAsD9B,IAAA,2BAAA,MAAA,WAEF,IAAA,QAEG,AAAG,AAFH,CAAA,EAAgB,IAAC,CAAA,cAAc,CAAC,IAAhB,CAAsB,qDAAtC,EAEiB,EAAd,CAAkB,YAAkB,EAAc,OAAd,GAA6B,EAAc,SAAd,EAJ3C,C,E,CAW1B,IAAA,WAAA,MAAA,WAAa,OAAA,IAAC,CAAA,IAAI,CAAC,KAAN,CAAa,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,EAA5B,CAA3B,EAAhB,C,E,CAMV,IAAA,aAAA,MAAA,WAAe,OAAA,IAAC,CAAA,IAAI,CAAC,OAAN,EAAH,C,E,E,C,IAIb,EAAG,SAAS,IAAZ,EAAmB,OAAnB,CAA4B,4CA3XtB,E,C,E,I,C,K","sources":["","node_modules/@swc/helpers/esm/_class_call_check.js","node_modules/@swc/helpers/esm/_create_class.js","woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.coffee"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire94c2\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"guLUH\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c0249d4a3fc9bb83$export$71511d61b312f219; });\nfunction $c0249d4a3fc9bb83$export$71511d61b312f219(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\n});\n\nparcelRegister(\"90XvN\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $690246f0b6925227$export$71511d61b312f219; });\nfunction $690246f0b6925227$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction $690246f0b6925227$export$71511d61b312f219(Constructor, protoProps, staticProps) {\n if (protoProps) $690246f0b6925227$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $690246f0b6925227$var$_defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n});\n\n\nvar $guLUH = parcelRequire(\"guLUH\");\n\nvar $90XvN = parcelRequire(\"90XvN\");\n(function() {\n /*\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n */ var indexOf = [].indexOf;\n jQuery(function($) {\n \"use strict\";\n window.SV_WC_Payment_Form_Handler_v5_15_5 = /*#__PURE__*/ function() {\n function SV_WC_Payment_Form_Handler_v5_15_5(args) {\n var _this = this;\n (0, $guLUH._)(this, SV_WC_Payment_Form_Handler_v5_15_5);\n this.id = args.id;\n this.id_dasherized = args.id_dasherized;\n this.plugin_id = args.plugin_id;\n this.type = args.type;\n this.csc_required = args.csc_required;\n this.csc_required_for_tokens = args.csc_required_for_tokens;\n this.enabled_card_types = args.enabled_card_types;\n // which payment form?\n if ($('form.checkout').length) {\n this.form = $('form.checkout');\n this.handle_checkout_page();\n } else if ($('form#order_review').length) {\n this.form = $('form#order_review');\n this.handle_pay_page();\n } else if ($('form#add_payment_method').length) {\n this.form = $('form#add_payment_method');\n this.handle_add_payment_method_page();\n } else {\n console.log('No payment form found!');\n return;\n }\n // localized error messages\n this.params = window[\"sv_wc_payment_gateway_payment_form_params\"];\n if (this.type === 'echeck') // handle sample check image hint\n this.form.on('click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', function() {\n return _this.handle_sample_check_hint();\n });\n $(document).trigger('sv_wc_payment_form_handler_init', {\n id: this.id,\n instance: this\n });\n }\n (0, $90XvN._)(SV_WC_Payment_Form_Handler_v5_15_5, [\n {\n // Public: Handle required actions on the checkout page\n // Returns nothing.\n key: \"handle_checkout_page\",\n value: function handle_checkout_page() {\n var _this = this;\n if (this.type === 'credit-card') // format/validate credit card inputs using jQuery.payment\n $(document.body).on('updated_checkout', function() {\n return _this.format_credit_card_inputs();\n });\n // updated payment fields jQuery object on each checkout update (prevents stale data)\n $(document.body).on('updated_checkout', function() {\n return _this.set_payment_fields();\n });\n // handle saved payment methods\n // note on the checkout page, this is bound to `updated_checkout` so it\n // fires even when other parts of the checkout are changed\n $(document.body).on('updated_checkout', function() {\n return _this.handle_saved_payment_methods();\n });\n // validate payment data before order is submitted\n return this.form.on(\"checkout_place_order_\".concat(this.id), function() {\n return _this.validate_payment_data();\n });\n }\n },\n {\n // Public: Handle required actions on the Order > Pay page\n // Returns nothing.\n key: \"handle_pay_page\",\n value: function handle_pay_page() {\n var _this = this;\n this.set_payment_fields();\n // format/validate credit card inputs using jQuery.payment\n if (this.type === 'credit-card') this.format_credit_card_inputs();\n // handle saved payment methods\n this.handle_saved_payment_methods();\n // validate payment data before order is submitted\n return this.form.submit(function() {\n if ($('#order_review input[name=payment_method]:checked').val() === _this.id) // but only when one of our payment gateways is selected\n return _this.validate_payment_data();\n });\n }\n },\n {\n // Public: Handle required actions on the Add Payment Method page\n // Returns nothing.\n key: \"handle_add_payment_method_page\",\n value: function handle_add_payment_method_page() {\n var _this = this;\n this.set_payment_fields();\n // format/validate credit card inputs using jQuery.payment\n if (this.type === 'credit-card') this.format_credit_card_inputs();\n // validate payment data before order is submitted\n return this.form.submit(function() {\n if ($('#add_payment_method input[name=payment_method]:checked').val() === _this.id) // but only when one of our payment gateways is selected\n return _this.validate_payment_data();\n });\n }\n },\n {\n // Public: Set payment fields class variable, this is done\n // during the updated_checkout event as otherwise the reference to\n // the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n // This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n // Returns nothing.\n key: \"set_payment_fields\",\n value: function set_payment_fields() {\n var $required_fields;\n this.payment_fields = $(\".payment_method_\".concat(this.id));\n $required_fields = this.payment_fields.find('.validate-required .input-text');\n return $required_fields.each(function(i, input) {\n // if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n if ($(input).val()) return false;\n // otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n return $(input).trigger('input');\n });\n }\n },\n {\n // Public: Validate Payment data when order is placed\n // Returns boolean, true if payment data is valid, false otherwise\n key: \"validate_payment_data\",\n value: function validate_payment_data() {\n var handler, valid;\n if (this.form.is('.processing')) // bail when already processing\n return false;\n this.saved_payment_method_selected = this.payment_fields.find('.js-sv-wc-payment-gateway-payment-token:checked').val();\n // perform internal validations (all fields present & valid, etc)\n valid = this.type === 'credit-card' ? this.validate_card_data() : this.validate_account_data();\n // let gateways perform their own validation prior to form submission\n handler = $(document.body).triggerHandler('sv_wc_payment_form_valid_payment_data', {\n payment_form: this,\n passed_validation: valid\n }) !== false;\n return valid && handler;\n }\n },\n {\n // Public: format card data using jQuery.Payment\n // Returns nothing.\n key: \"format_credit_card_inputs\",\n value: function format_credit_card_inputs() {\n var _this = this;\n var $card_number, $csc, $expiry;\n $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n if ($card_number.val() && $card_number.val().length > 0) $card_number.trigger('change');\n if ($expiry.val() && $expiry.val().length > 0) $expiry.trigger('change');\n if ($csc.val() && $csc.val().length > 0) $csc.trigger('change');\n // perform inline validation on credit card inputs\n return $('.js-sv-wc-payment-gateway-credit-card-form-input').on('change paste keyup', function() {\n return _this.do_inline_credit_card_validation();\n });\n }\n },\n {\n // Public: perform inline validation on credit card fields\n // Returns nothing.\n key: \"do_inline_credit_card_validation\",\n value: function do_inline_credit_card_validation() {\n var $card_number, $card_type, $csc, $expiry;\n $card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number');\n $expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry');\n $csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc');\n $card_type = $.payment.cardType($card_number.val());\n if (indexOf.call(this.enabled_card_types, $card_type) < 0) $card_number.addClass('invalid-card-type');\n else $card_number.removeClass('invalid-card-type');\n if ($.payment.validateCardExpiry($expiry.payment('cardExpiryVal'))) $expiry.addClass('identified');\n else $expiry.removeClass('identified');\n if ($.payment.validateCardCVC($csc.val())) return $csc.addClass('identified');\n else return $csc.removeClass('identified');\n }\n },\n {\n // Public: Perform validation on the credit card info entered\n // Return boolean, true if credit card info is valid, false otherwise\n key: \"validate_card_data\",\n value: function validate_card_data() {\n var account_number, csc, errors, expiry;\n errors = [];\n csc = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-csc').val();\n // always validate the CSC if present\n if (csc != null) {\n if (csc) {\n if (/\\D/.test(csc)) errors.push(this.params.cvv_digits_invalid);\n if (csc.length < 3 || csc.length > 4) errors.push(this.params.cvv_length_invalid);\n } else if (this.csc_required) {\n if (!this.saved_payment_method_selected || this.csc_required_for_tokens) errors.push(this.params.cvv_missing);\n }\n }\n // Only validate the other CC fields if necessary\n if (!this.saved_payment_method_selected) {\n account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val();\n expiry = $.payment.cardExpiryVal(this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').val());\n // replace any dashes or spaces in the card number\n account_number = account_number.replace(/-|\\s/g, '');\n // validate card number\n if (!account_number) errors.push(this.params.card_number_missing);\n else {\n if (account_number.length < 12 || account_number.length > 19) errors.push(this.params.card_number_length_invalid);\n if (/\\D/.test(account_number)) errors.push(this.params.card_number_digits_invalid);\n if (!$.payment.validateCardNumber(account_number)) errors.push(this.params.card_number_invalid);\n }\n if (!$.payment.validateCardExpiry(expiry)) // validate expiration date\n errors.push(this.params.card_exp_date_invalid);\n }\n if (errors.length > 0) {\n this.render_errors(errors);\n return false;\n } else {\n // get rid of any space/dash characters\n this.payment_fields.find('.js-sv-wc-payment-gateway-credit-card-form-account-number').val(account_number);\n return true;\n }\n }\n },\n {\n // Public: Perform validation on the eCheck info entered\n // Return boolean, true if eCheck info is valid, false otherwise\n key: \"validate_account_data\",\n value: function validate_account_data() {\n var account_number, errors, routing_number;\n if (this.saved_payment_method_selected) return true;\n errors = [];\n routing_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val();\n account_number = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val();\n // validate routing number\n if (!routing_number) errors.push(this.params.routing_number_missing);\n else {\n if (9 !== routing_number.length) errors.push(this.params.routing_number_length_invalid);\n if (/\\D/.test(routing_number)) errors.push(this.params.routing_number_digits_invalid);\n }\n // validate account number\n if (!account_number) errors.push(this.params.account_number_missing);\n else {\n if (account_number.length < 3 || account_number.length > 17) errors.push(this.params.account_number_length_invalid);\n if (/\\D/.test(account_number)) errors.push(this.params.account_number_invalid);\n }\n if (errors.length > 0) {\n this.render_errors(errors);\n return false;\n } else {\n // get rid of any space/dash characters\n this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val(account_number);\n return true;\n }\n }\n },\n {\n // Public: Render any new errors and bring them into the viewport\n // Returns nothing.\n key: \"render_errors\",\n value: function render_errors(errors) {\n // hide and remove any previous errors\n $('.woocommerce-error, .woocommerce-message').remove();\n // add errors\n this.form.prepend('
    • ' + errors.join('
    • ') + '
    ');\n // unblock UI\n this.form.removeClass('processing').unblock();\n this.form.find('.input-text, select').blur();\n // scroll to top\n return $('html, body').animate({\n scrollTop: this.form.offset().top - 100\n }, 1000);\n }\n },\n {\n // Public: Handle associated actions for saved payment methods\n // Returns nothing.\n key: \"handle_saved_payment_methods\",\n value: function handle_saved_payment_methods() {\n var $csc_field, $new_payment_method_selection, csc_required, csc_required_for_tokens, id_dasherized;\n // make available inside change events\n id_dasherized = this.id_dasherized;\n csc_required = this.csc_required;\n csc_required_for_tokens = this.csc_required_for_tokens;\n $new_payment_method_selection = $(\"div.js-wc-\".concat(id_dasherized, \"-new-payment-method-form\"));\n $csc_field = $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-csc').closest('.form-row');\n // show/hide the saved payment methods when a saved payment method is de-selected/selected\n $(\"input.js-wc-\".concat(this.id_dasherized, \"-payment-token\")).on('change', function() {\n var tokenized_payment_method_selected;\n tokenized_payment_method_selected = $(\"input.js-wc-\".concat(id_dasherized, \"-payment-token:checked\")).val();\n if (tokenized_payment_method_selected) {\n // using an existing tokenized payment method, hide the 'new method' fields\n $new_payment_method_selection.slideUp(200);\n // move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n if (csc_required_for_tokens) {\n $csc_field.removeClass('form-row-last').addClass('form-row-first');\n return $new_payment_method_selection.after($csc_field);\n }\n } else {\n // use new payment method, display the 'new method' fields\n $new_payment_method_selection.slideDown(200);\n // move the CSC field back into its regular spot\n if (csc_required_for_tokens) {\n $csc_field.removeClass('form-row-first').addClass('form-row-last');\n return $new_payment_method_selection.find('.js-sv-wc-payment-gateway-credit-card-form-expiry').closest('.form-row').after($csc_field);\n }\n }\n }).change();\n // display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n // but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n $('input#createaccount').on('change', function() {\n var $parent_row;\n $parent_row = $(\"input.js-wc-\".concat(id_dasherized, \"-tokenize-payment-method\")).closest('p.form-row');\n if ($(this).is(':checked')) {\n $parent_row.slideDown();\n return $parent_row.next().show();\n } else {\n $parent_row.hide();\n return $parent_row.next().hide();\n }\n });\n if (!$('input#createaccount').is(':checked')) return $('input#createaccount').change();\n }\n },\n {\n // Public: Handle showing/hiding the sample check image\n // Returns nothing.\n key: \"handle_sample_check_hint\",\n value: function handle_sample_check_hint() {\n var $sample_check;\n $sample_check = this.payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-sample-check');\n if ($sample_check.is(\":visible\")) return $sample_check.slideUp();\n else return $sample_check.slideDown();\n }\n },\n {\n // Blocks the payment form UI\n // @since 3.0.0\n key: \"block_ui\",\n value: function block_ui() {\n return this.form.block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n },\n {\n // Unblocks the payment form UI\n // @since 3.0.0\n key: \"unblock_ui\",\n value: function unblock_ui() {\n return this.form.unblock();\n }\n }\n ]);\n return SV_WC_Payment_Form_Handler_v5_15_5;\n }();\n // dispatch loaded event\n return $(document.body).trigger(\"sv_wc_payment_form_handler_v5_15_5_loaded\");\n });\n}).call(undefined);\n\n\n//# sourceMappingURL=sv-wc-payment-gateway-payment-form.js.map\n","function _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _class_call_check as _ };\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0\n\n Copyright (c) 2014-2024, SkyVerge, Inc.\n Licensed under the GNU General Public License v3.0\n http://www.gnu.org/licenses/gpl-3.0.html\n###\njQuery ( $ ) ->\n\t\"use strict\"\n\n\n\tclass window.SV_WC_Payment_Form_Handler_v5_15_5\n\n\n\t\t# Public: Instantiate Payment Form Handler\n\t\t#\n\t\t# args - object with properties:\n\t\t# id - gateway ID\n\t\t# id_dasherized - gateway ID dasherized\n\t\t# plugin_id - plugin ID\n\t\t# type - gateway type, either `credit-card` or `echeck`\n\t\t# csc_required - true if the gateway requires the CSC field to be displayed\n\t\t#\n\t\t# Returns SV_WC_Payment_Form_Handler_v5_15_5 instance\n\t\tconstructor: (args) ->\n\n\t\t\t@id = args.id\n\t\t\t@id_dasherized = args.id_dasherized\n\t\t\t@plugin_id = args.plugin_id\n\t\t\t@type = args.type\n\t\t\t@csc_required = args.csc_required\n\t\t\t@csc_required_for_tokens = args.csc_required_for_tokens\n\t\t\t@enabled_card_types = args.enabled_card_types\n\n\t\t\t# which payment form?\n\t\t\tif $( 'form.checkout' ).length\n\t\t\t\t@form = $( 'form.checkout' )\n\t\t\t\tthis.handle_checkout_page()\n\n\t\t\telse if $( 'form#order_review' ).length\n\t\t\t\t@form = $( 'form#order_review' )\n\t\t\t\tthis.handle_pay_page()\n\n\t\t\telse if $( 'form#add_payment_method' ).length\n\t\t\t\t@form = $( 'form#add_payment_method' )\n\t\t\t\tthis.handle_add_payment_method_page()\n\n\t\t\telse\n\t\t\t\tconsole.log( 'No payment form found!' )\n\t\t\t\treturn\n\n\t\t\t# localized error messages\n\t\t\t@params = window[ \"sv_wc_payment_gateway_payment_form_params\" ]\n\n\t\t\t# handle sample check image hint\n\t\t\t@form.on( 'click', '.js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check', => this.handle_sample_check_hint() ) if @type is 'echeck'\n\n\t\t\t$( document ).trigger( 'sv_wc_payment_form_handler_init', { id: @id, instance: @ } )\n\n\n\t\t# Public: Handle required actions on the checkout page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_checkout_page: ->\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\t$( document.body ).on( 'updated_checkout', => this.format_credit_card_inputs() ) if @type is 'credit-card'\n\n\t\t\t# updated payment fields jQuery object on each checkout update (prevents stale data)\n\t\t\t$( document.body ).on( 'updated_checkout', => this.set_payment_fields() )\n\n\t\t\t# handle saved payment methods\n\t\t\t# note on the checkout page, this is bound to `updated_checkout` so it\n\t\t\t# fires even when other parts of the checkout are changed\n\t\t\t$( document.body ).on( 'updated_checkout', => this.handle_saved_payment_methods() )\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.on( \"checkout_place_order_#{ @id }\", => this.validate_payment_data() )\n\n\n\t\t# Public: Handle required actions on the Order > Pay page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_pay_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# handle saved payment methods\n\t\t\tthis.handle_saved_payment_methods()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#order_review input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Handle required actions on the Add Payment Method page\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_add_payment_method_page: ->\n\n\t\t\tthis.set_payment_fields()\n\n\t\t\t# format/validate credit card inputs using jQuery.payment\n\t\t\tif @type is 'credit-card'\n\t\t\t\tthis.format_credit_card_inputs()\n\n\t\t\t# validate payment data before order is submitted\n\t\t\t@form.submit =>\n\n\t\t\t\t# but only when one of our payment gateways is selected\n\t\t\t\treturn this.validate_payment_data() if $( '#add_payment_method input[name=payment_method]:checked' ).val() is @id\n\n\n\t\t# Public: Set payment fields class variable, this is done\n\t\t# during the updated_checkout event as otherwise the reference to\n\t\t# the checkout fields becomes stale (somehow ¯\\_(ツ)_/¯)\n\t\t#\n\t\t# This ensures payment fields are not marked as \"invalid\" before the customer has interacted with them.\n\t\t#\n\t\t# Returns nothing.\n\t\tset_payment_fields: ->\n\n\t\t\t@payment_fields = $( \".payment_method_#{ @id }\" )\n\n\t\t\t$required_fields = @payment_fields.find( '.validate-required .input-text' )\n\n\t\t\t$required_fields.each( ( i, input ) =>\n\n\t\t\t\t# if any of the required fields have a value, bail this loop and proceed with WooCommerce validation\n\t\t\t\tif $( input ).val()\n\t\t\t\t\treturn false\n\n\t\t\t\t# otherwise remove all validation result classes from the inputs, since the form is freshly loaded\n\t\t\t\t$( input ).trigger( 'input' )\n\t\t\t)\n\n\n\t\t# Public: Validate Payment data when order is placed\n\t\t#\n\t\t# Returns boolean, true if payment data is valid, false otherwise\n\t\tvalidate_payment_data: ->\n\n\t\t\t# bail when already processing\n\t\t\treturn false if @form.is( '.processing' )\n\n\t\t\t@saved_payment_method_selected = @payment_fields.find( '.js-sv-wc-payment-gateway-payment-token:checked' ).val()\n\n\t\t\t# perform internal validations (all fields present & valid, etc)\n\t\t\tvalid = if @type is 'credit-card' then this.validate_card_data() else this.validate_account_data()\n\n\t\t\t# let gateways perform their own validation prior to form submission\n\t\t\thandler = $( document.body ).triggerHandler( 'sv_wc_payment_form_valid_payment_data', { payment_form: this, passed_validation: valid } ) isnt false\n\n\t\t\treturn valid && handler\n\n\n\t\t# Public: format card data using jQuery.Payment\n\t\t#\n\t\t# Returns nothing.\n\t\tformat_credit_card_inputs: ->\n\t\t\t$card_number = $('.js-sv-wc-payment-gateway-credit-card-form-account-number').payment('formatCardNumber');\n\t\t\t$expiry = $('.js-sv-wc-payment-gateway-credit-card-form-expiry').payment('formatCardExpiry');\n\t\t\t$csc = $('.js-sv-wc-payment-gateway-credit-card-form-csc').payment('formatCardCVC');\n\n\t\t\t# trigger a 'change' event for non empty fields only\n\t\t\t$card_number.trigger( 'change') if $card_number.val() && $card_number.val().length > 0\n\t\t\t$expiry.trigger( 'change') if $expiry.val() && $expiry.val().length > 0\n\t\t\t$csc.trigger( 'change') if $csc.val() && $csc.val().length > 0\n\n\t\t\t# perform inline validation on credit card inputs\n\t\t\t$( '.js-sv-wc-payment-gateway-credit-card-form-input' ).on( 'change paste keyup', => this.do_inline_credit_card_validation() )\n\n\n\t\t# Public: perform inline validation on credit card fields\n\t\t#\n\t\t# Returns nothing.\n\t\tdo_inline_credit_card_validation: ->\n\n\t\t\t$card_number = $( '.js-sv-wc-payment-gateway-credit-card-form-account-number' )\n\t\t\t$expiry = $( '.js-sv-wc-payment-gateway-credit-card-form-expiry' )\n\t\t\t$csc = $( '.js-sv-wc-payment-gateway-credit-card-form-csc' )\n\n\t\t\t$card_type = $.payment.cardType( $card_number.val() )\n\n\t\t\tif $card_type not in @enabled_card_types\n\t\t\t\t$card_number.addClass( 'invalid-card-type' )\n\t\t\telse\n\t\t\t\t$card_number.removeClass( 'invalid-card-type' )\n\n\t\t\tif $.payment.validateCardExpiry( $expiry.payment( 'cardExpiryVal' ) )\n\t\t\t\t$expiry.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$expiry.removeClass( 'identified' )\n\n\t\t\tif $.payment.validateCardCVC( $csc.val() )\n\t\t\t\t$csc.addClass( 'identified' )\n\t\t\telse\n\t\t\t\t$csc.removeClass( 'identified' )\n\n\n\t\t# Public: Perform validation on the credit card info entered\n\t\t#\n\t\t# Return boolean, true if credit card info is valid, false otherwise\n\t\tvalidate_card_data: ->\n\n\t\t\terrors = []\n\n\t\t\tcsc = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).val()\n\n\t\t\t# always validate the CSC if present\n\t\t\tif csc?\n\n\t\t\t\tif csc\n\t\t\t\t\terrors.push( @params.cvv_digits_invalid ) if /\\D/.test( csc )\n\t\t\t\t\terrors.push( @params.cvv_length_invalid ) if csc.length < 3 || csc.length > 4\n\t\t\t\telse if @csc_required\n\t\t\t\t\tif not @saved_payment_method_selected or @csc_required_for_tokens\n\t\t\t\t\t\terrors.push( @params.cvv_missing )\n\n\t\t\t# Only validate the other CC fields if necessary\n\t\t\tif not @saved_payment_method_selected\n\n\t\t\t\taccount_number = @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val()\n\t\t\t\texpiry = $.payment.cardExpiryVal( @payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).val() )\n\n\t\t\t\t# replace any dashes or spaces in the card number\n\t\t\t\taccount_number = account_number.replace( /-|\\s/g, '' )\n\n\t\t\t\t# validate card number\n\t\t\t\tif not account_number\n\t\t\t\t\terrors.push( @params.card_number_missing )\n\t\t\t\telse\n\t\t\t\t\terrors.push( @params.card_number_length_invalid ) if account_number.length < 12 || account_number.length > 19\n\t\t\t\t\terrors.push( @params.card_number_digits_invalid ) if /\\D/.test( account_number )\n\t\t\t\t\terrors.push( @params.card_number_invalid ) unless $.payment.validateCardNumber( account_number ) # performs luhn check\n\n\t\t\t\t# validate expiration date\n\t\t\t\terrors.push( @params.card_exp_date_invalid ) unless $.payment.validateCardExpiry( expiry ) # validates future date\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-credit-card-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Perform validation on the eCheck info entered\n\t\t#\n\t\t# Return boolean, true if eCheck info is valid, false otherwise\n\t\tvalidate_account_data: ->\n\n\t\t\treturn true if @saved_payment_method_selected\n\n\t\t\terrors = []\n\n\t\t\trouting_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-routing-number').val()\n\t\t\taccount_number = @payment_fields.find('.js-sv-wc-payment-gateway-echeck-form-account-number').val()\n\n\t\t\t# validate routing number\n\t\t\tif not routing_number\n\t\t\t\terrors.push( @params.routing_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.routing_number_length_invalid ) if 9 != routing_number.length\n\t\t\t\terrors.push( @params.routing_number_digits_invalid ) if /\\D/.test( routing_number )\n\n\t\t\t# validate account number\n\t\t\tif not account_number\n\t\t\t\terrors.push( @params.account_number_missing )\n\t\t\telse\n\t\t\t\terrors.push( @params.account_number_length_invalid ) if account_number.length < 3 || account_number.length > 17\n\t\t\t\terrors.push( @params.account_number_invalid ) if /\\D/.test( account_number )\n\n\t\t\tif errors.length > 0\n\t\t\t\tthis.render_errors( errors )\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\t# get rid of any space/dash characters\n\t\t\t\t@payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-account-number' ).val( account_number )\n\t\t\t\treturn true\n\n\n\t\t# Public: Render any new errors and bring them into the viewport\n\t\t#\n\t\t# Returns nothing.\n\t\trender_errors: (errors) ->\n\n\t\t\t# hide and remove any previous errors\n\t\t\t$( '.woocommerce-error, .woocommerce-message' ).remove()\n\n\t\t\t# add errors\n\t\t\t@form.prepend '
    • ' + errors.join( '
    • ' ) + '
    '\n\n\t\t\t# unblock UI\n\t\t\t@form.removeClass( 'processing' ).unblock()\n\t\t\t@form.find( '.input-text, select' ).blur()\n\n\t\t\t# scroll to top\n\t\t\t$( 'html, body' ).animate( { scrollTop: @form.offset().top - 100 }, 1000 )\n\n\n\t\t# Public: Handle associated actions for saved payment methods\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_saved_payment_methods: ->\n\n\t\t\t# make available inside change events\n\t\t\tid_dasherized = @id_dasherized\n\n\t\t\tcsc_required = @csc_required\n\t\t\tcsc_required_for_tokens = @csc_required_for_tokens\n\n\t\t\t$new_payment_method_selection = $( \"div.js-wc-#{ id_dasherized }-new-payment-method-form\" )\n\t\t\t$csc_field = $new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-csc' ).closest( '.form-row' )\n\n\t\t\t# show/hide the saved payment methods when a saved payment method is de-selected/selected\n\t\t\t$( \"input.js-wc-#{ @id_dasherized }-payment-token\" ).on 'change', ->\n\n\t\t\t\ttokenized_payment_method_selected = $( \"input.js-wc-#{ id_dasherized }-payment-token:checked\" ).val()\n\n\t\t\t\tif tokenized_payment_method_selected\n\n\t\t\t\t\t# using an existing tokenized payment method, hide the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideUp( 200 )\n\n\t\t\t\t\t# move the CSC field out of the 'new method' fields so it can be used with the tokenized transaction\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-last' ).addClass( 'form-row-first' )\n\t\t\t\t\t\t$new_payment_method_selection.after( $csc_field )\n\n\t\t\t\telse\n\t\t\t\t\t# use new payment method, display the 'new method' fields\n\t\t\t\t\t$new_payment_method_selection.slideDown( 200 )\n\n\t\t\t\t\t# move the CSC field back into its regular spot\n\t\t\t\t\tif csc_required_for_tokens\n\t\t\t\t\t\t$csc_field.removeClass( 'form-row-first' ).addClass( 'form-row-last' )\n\t\t\t\t\t\t$new_payment_method_selection.find( '.js-sv-wc-payment-gateway-credit-card-form-expiry' ).closest( '.form-row' ).after( $csc_field )\n\t\t\t.change()\n\n\t\t\t# display the 'save payment method' option for guest checkouts if the 'create account' option is checked\n\t\t\t# but only hide the input if there is a 'create account' checkbox (some themes just display the password)\n\t\t\t$( 'input#createaccount' ).on 'change', ->\n\t\t\t\t$parent_row = $( \"input.js-wc-#{ id_dasherized }-tokenize-payment-method\" ).closest( 'p.form-row' )\n\n\t\t\t\tif $( this ).is( ':checked' )\n\t\t\t\t\t$parent_row.slideDown()\n\t\t\t\t\t$parent_row.next().show()\n\t\t\t\telse\n\t\t\t\t\t$parent_row.hide()\n\t\t\t\t\t$parent_row.next().hide()\n\n\t\t\t$( 'input#createaccount' ).change() unless $( 'input#createaccount' ).is( ':checked' )\n\n\n\t\t# Public: Handle showing/hiding the sample check image\n\t\t#\n\t\t# Returns nothing.\n\t\thandle_sample_check_hint: ->\n\n\t\t\t$sample_check = @payment_fields.find( '.js-sv-wc-payment-gateway-echeck-form-sample-check' )\n\n\t\t\tif $sample_check.is( \":visible\" ) then $sample_check.slideUp() else $sample_check.slideDown()\n\n\n\n\t\t# Blocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tblock_ui: -> @form.block( message: null, overlayCSS: background: '#fff',opacity: 0.6 )\n\n\n\t\t# Unblocks the payment form UI\n\t\t#\n\t\t# @since 3.0.0\n\t\tunblock_ui: -> @form.unblock()\n\n\n\t# dispatch loaded event\n\t$( document.body ).trigger( \"sv_wc_payment_form_handler_v5_15_5_loaded\" )\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$c0249d4a3fc9bb83$export$71511d61b312f219","instance","Constructor","TypeError","$690246f0b6925227$var$_defineProperties","target","props","i","length","descriptor","writable","key","$690246f0b6925227$export$71511d61b312f219","protoProps","staticProps","prototype","$guLUH","$90XvN","indexOf","jQuery","$","SV_WC_Payment_Form_Handler_v5_15_5","args","_this","_","id_dasherized","plugin_id","type","csc_required","csc_required_for_tokens","enabled_card_types","form","handle_checkout_page","handle_pay_page","handle_add_payment_method_page","console","log","params","on","handle_sample_check_hint","document","trigger","value","body","format_credit_card_inputs","set_payment_fields","handle_saved_payment_methods","concat","validate_payment_data","submit","val","payment_fields","$required_fields","find","each","input","handler","valid","is","saved_payment_method_selected","validate_card_data","validate_account_data","triggerHandler","payment_form","passed_validation","$card_number","$csc","$expiry","payment","do_inline_credit_card_validation","$card_type","cardType","addClass","removeClass","validateCardExpiry","validateCardCVC","account_number","csc","errors","expiry","test","push","cvv_digits_invalid","cvv_length_invalid","cvv_missing","cardExpiryVal","replace","card_number_length_invalid","card_number_digits_invalid","validateCardNumber","card_number_invalid","card_number_missing","card_exp_date_invalid","render_errors","routing_number","routing_number_length_invalid","routing_number_digits_invalid","routing_number_missing","account_number_length_invalid","account_number_invalid","account_number_missing","remove","prepend","join","unblock","blur","animate","scrollTop","offset","top","$csc_field","$new_payment_method_selection","closest","slideUp","after","slideDown","change","$parent_row","next","show","hide","$sample_check","block","message","overlayCSS","background","opacity","undefined"],"version":3,"file":"sv-wc-payment-gateway-payment-form.js.map","sourceRoot":"../../../../../"} \ No newline at end of file diff --git a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js index 1dd7d38c1..7ae415fbe 100644 --- a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js +++ b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-google-pay.js @@ -7,9 +7,9 @@ jQuery( function( $ ) { * * @since 5.10.0 * - * @type {SV_WC_Google_Pay_Handler_v5_15_5} object + * @type {SV_WC_Google_Pay_Handler_v5_15_6} object */ - window.SV_WC_Google_Pay_Handler_v5_15_5 = class SV_WC_Google_Pay_Handler_v5_15_5 { + window.SV_WC_Google_Pay_Handler_v5_15_6 = class SV_WC_Google_Pay_Handler_v5_15_6 { /** * Handler constructor. @@ -612,6 +612,6 @@ jQuery( function( $ ) { } } - $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_15_5_loaded' ); + $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_15_6_loaded' ); } ); diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php index 833a1d1a1..39f40d6fc 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php @@ -22,13 +22,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Blocks\Blocks_Handler; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Blocks\Blocks_Handler; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Direct' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Direct' ) ) : /** diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php index 3279a13ea..ffbe458ab 100755 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Helper' ) ) : /** diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php index 1c7ff81db..22290d9fc 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Hosted' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Hosted' ) ) : /** diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php index e99a2e701..069b3096d 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) : /** @@ -174,9 +174,9 @@ public function maybe_enqueue_styles_scripts() { wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip.min.js', [ 'jquery' ], $wc_version ); - wp_enqueue_style( "$handle-v5_15_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', [ 'dashicons' ], $fw_version ); + wp_enqueue_style( "$handle-v5_15_6", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', [ 'dashicons' ], $fw_version ); - wp_enqueue_script( "$handle-v5_15_5", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', [ 'jquery-tiptip', 'jquery' ], $fw_version ); + wp_enqueue_script( "$handle-v5_15_6", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', [ 'jquery-tiptip', 'jquery' ], $fw_version ); } diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php index 6c7520dd1..eeabc9361 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php @@ -22,15 +22,15 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Blocks\Blocks_Handler; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Enums\PaymentFormContext; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Blocks\Gateway_Checkout_Block_Integration; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Blocks\Blocks_Handler; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Enums\PaymentFormContext; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Blocks\Gateway_Checkout_Block_Integration; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Payment_Form' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Payment_Form' ) ) : /** @@ -1180,7 +1180,7 @@ protected function get_js_handler_args() { if ( is_array( $card_types ) && ! empty( $card_types ) ) { - $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_15_5\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types ); + $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_15_6\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types ); } } diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php index e2446b8d4..f15dc864b 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php @@ -22,16 +22,16 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note; use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Blocks\Gateway_Blocks_Handler; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Blocks\Gateway_Blocks_Handler; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Plugin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Plugin' ) ) : /** diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php index 33ab23304..83a27ed8d 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Privacy' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Privacy' ) ) : /** diff --git a/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php b/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php index ad7a11189..e8e79e380 100755 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php @@ -22,16 +22,16 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; use Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Blocks\Blocks_Handler; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway\Blocks\Gateway_Checkout_Block_Integration; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Blocks\Blocks_Handler; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway\Blocks\Gateway_Checkout_Block_Integration; use stdClass; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway' ) ) : /** @@ -473,7 +473,7 @@ protected function enqueue_payment_form_assets() { } $handle = 'sv-wc-payment-gateway-payment-form'; - $versioned_handle = $handle . '-v5_15_5'; + $versioned_handle = $handle . '-v5_15_6'; // Frontend JS wp_enqueue_script( $versioned_handle, $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-payment' ), SV_WC_Plugin::VERSION, true ); diff --git a/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php b/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php index 41f3bc4a8..1bd70a808 100644 --- a/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php +++ b/woocommerce/payment-gateway/exceptions/class-sv-wc-payment-gateway-exception.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Exception' ) ) : /** diff --git a/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php b/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php index b2611f44d..ddc29ddae 100644 --- a/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php +++ b/woocommerce/payment-gateway/integrations/abstract-sv-wc-payment-gateway-integration.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Integration' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Integration' ) ) : /** diff --git a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php index a12554ab9..ef2d65bbf 100644 --- a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php +++ b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) : /** diff --git a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php index 1a9475b21..582760178 100644 --- a/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +++ b/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) : /** diff --git a/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php b/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php index e81eec05b..1e8c6e8ce 100644 --- a/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php +++ b/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-token.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Payment_Token' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Payment_Token' ) ) : /** diff --git a/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php b/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php index 8f58f09a5..1dac1ec4a 100644 --- a/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php +++ b/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) : /** diff --git a/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php b/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php index 42c2da3c0..43ccb09f7 100644 --- a/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php +++ b/woocommerce/payment-gateway/rest-api/class-sv-wc-payment-gateway-plugin-rest-api.php @@ -22,19 +22,19 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\Payment_Gateway; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\Payment_Gateway; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\REST_API as Plugin_REST_API; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\REST_API as Plugin_REST_API; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\Payment_Gateway\\REST_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\Payment_Gateway\\REST_API' ) ) : /** * The payment gateway plugin REST API handler class. * - * @see \SkyVerge\WooCommerce\PluginFramework\v5_15_5\REST_API + * @see \SkyVerge\WooCommerce\PluginFramework\v5_15_6\REST_API * * @since 5.2.0 */ @@ -47,7 +47,7 @@ class REST_API extends Plugin_REST_API { * * Plugins can override this to add their own data. * - * @see \SkyVerge\WooCommerce\PluginFramework\v5_15_5\REST_API::get_system_status_data() + * @see \SkyVerge\WooCommerce\PluginFramework\v5_15_6\REST_API::get_system_status_data() * * @since 5.2.0 * diff --git a/woocommerce/rest-api/Controllers/Settings.php b/woocommerce/rest-api/Controllers/Settings.php index 51958701c..23a124a2d 100644 --- a/woocommerce/rest-api/Controllers/Settings.php +++ b/woocommerce/rest-api/Controllers/Settings.php @@ -22,14 +22,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5\REST_API\Controllers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6\REST_API\Controllers; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Settings_API\Abstract_Settings; -use SkyVerge\WooCommerce\PluginFramework\v5_15_5\Settings_API\Setting; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Settings_API\Abstract_Settings; +use SkyVerge\WooCommerce\PluginFramework\v5_15_6\Settings_API\Setting; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\REST_API\\Controllers\\Settings' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\REST_API\\Controllers\\Settings' ) ) : /** diff --git a/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php b/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php index 7eb3932e1..4c05276bd 100644 --- a/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php +++ b/woocommerce/rest-api/class-sv-wc-plugin-rest-api.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\REST_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\REST_API' ) ) : /** diff --git a/woocommerce/utilities/class-sv-wp-async-request.php b/woocommerce/utilities/class-sv-wp-async-request.php index 9a2110e2c..6bd911449 100644 --- a/woocommerce/utilities/class-sv-wp-async-request.php +++ b/woocommerce/utilities/class-sv-wp-async-request.php @@ -23,11 +23,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WP_Async_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WP_Async_Request' ) ) : /** diff --git a/woocommerce/utilities/class-sv-wp-background-job-handler.php b/woocommerce/utilities/class-sv-wp-background-job-handler.php index cf1ca64b5..fa93a6ae1 100644 --- a/woocommerce/utilities/class-sv-wp-background-job-handler.php +++ b/woocommerce/utilities/class-sv-wp-background-job-handler.php @@ -23,11 +23,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; +namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WP_Background_Job_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WP_Background_Job_Handler' ) ) : /** diff --git a/woocommerce/utilities/class-sv-wp-job-batch-handler.php b/woocommerce/utilities/class-sv-wp-job-batch-handler.php index ffe54e5d7..8adb93571 100644 --- a/woocommerce/utilities/class-sv-wp-job-batch-handler.php +++ b/woocommerce/utilities/class-sv-wp-job-batch-handler.php @@ -22,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ - namespace SkyVerge\WooCommerce\PluginFramework\v5_15_5; + namespace SkyVerge\WooCommerce\PluginFramework\v5_15_6; defined( 'ABSPATH' ) or exit; - if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_5\\SV_WP_Job_Batch_Handler' ) ) : + if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_15_6\\SV_WP_Job_Batch_Handler' ) ) : /**