diff --git a/package.json b/package.json index 5a0be8df2..b6216ee13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wc-plugin-framework", - "version": "5.10.15", + "version": "5.11.0", "title": "WooCommerce Plugin Framework", "author": "SkyVerge Team", "homepage": "https://github.com/skyverge/wc-plugin-framework#readme", diff --git a/woocommerce-framework-plugin-loader-sample.php b/woocommerce-framework-plugin-loader-sample.php index c17f645b8..57a8d9e00 100644 --- a/woocommerce-framework-plugin-loader-sample.php +++ b/woocommerce-framework-plugin-loader-sample.php @@ -60,7 +60,7 @@ class SV_WC_Framework_Plugin_Loader { const MINIMUM_WC_VERSION = '3.5'; /** SkyVerge plugin framework version used by this plugin */ - const FRAMEWORK_VERSION = '5.10.15'; // TODO: framework version + const FRAMEWORK_VERSION = '5.11.0'; // TODO: framework version /** the plugin name, for displaying notices */ const PLUGIN_NAME = 'WooCommerce Framework Plugin'; // TODO: plugin name diff --git a/woocommerce/Addresses/Address.php b/woocommerce/Addresses/Address.php index 4574fe0f3..652534fd8 100644 --- a/woocommerce/Addresses/Address.php +++ b/woocommerce/Addresses/Address.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_10_15\Addresses; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Addresses; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Addresses\\Address' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Addresses\\Address' ) ) : /** diff --git a/woocommerce/Addresses/Customer_Address.php b/woocommerce/Addresses/Customer_Address.php index e92c8835b..3151d8b69 100644 --- a/woocommerce/Addresses/Customer_Address.php +++ b/woocommerce/Addresses/Customer_Address.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_10_15\Addresses; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Addresses; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Addresses\\Customer_Address' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Addresses\\Customer_Address' ) ) : /** diff --git a/woocommerce/Country_Helper.php b/woocommerce/Country_Helper.php index 78ec769c7..7bd5f3e6f 100644 --- a/woocommerce/Country_Helper.php +++ b/woocommerce/Country_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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Country_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Country_Helper' ) ) : /** diff --git a/woocommerce/Handlers/Script_Handler.php b/woocommerce/Handlers/Script_Handler.php index 86224be72..679d2cd90 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_10_15\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Plugin_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Plugin_Exception; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Handlers\\Script_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Handlers\\Script_Handler' ) ) : /** @@ -79,7 +79,7 @@ protected function add_hooks() { */ protected function get_js_handler_class_name() { - return sprintf( '%s_v5_10_15', $this->js_handler_base_class_name ); + return sprintf( '%s_v5_11_0', $this->js_handler_base_class_name ); } diff --git a/woocommerce/Lifecycle.php b/woocommerce/Lifecycle.php index c0f3e43d0..67339e844 100644 --- a/woocommerce/Lifecycle.php +++ b/woocommerce/Lifecycle.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_10_15\Plugin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Admin\Notes_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Plugin; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Plugin_Compatibility; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Admin\Notes_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Plugin_Compatibility; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Plugin\\Lifecycle' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Plugin\\Lifecycle' ) ) : /** diff --git a/woocommerce/Settings_API/Abstract_Settings.php b/woocommerce/Settings_API/Abstract_Settings.php index 91d0ae217..6d0c9d00c 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_10_15\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Settings_API\\Abstract_Settings' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Settings_API\\Abstract_Settings' ) ) : /** * The base settings handler. diff --git a/woocommerce/Settings_API/Control.php b/woocommerce/Settings_API/Control.php index bff3645fe..fe0f582cc 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_10_15\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Settings_API\\Control' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Settings_API\\Control' ) ) : /** * The base control object. diff --git a/woocommerce/Settings_API/Setting.php b/woocommerce/Settings_API/Setting.php index 4346b1bd4..c97614eeb 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_10_15\Settings_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Settings_API; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Settings_API\\Setting' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Settings_API\\Setting' ) ) : /** * The base setting object. diff --git a/woocommerce/admin/Notes_Helper.php b/woocommerce/admin/Notes_Helper.php index b7cd4db74..b759e48eb 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_10_15\Admin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Admin; use Automattic\WooCommerce\Admin\Notes as WooCommerce_Admin_Notes; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Admin\\Notes_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Admin\\Notes_Helper' ) ) : /** * Helper class for WooCommerce enhanced admin notes. 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 5bf09e9f4..1a3d3ef87 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_10_15\Admin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Admin; defined( 'ABSPATH' ) or exit; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Admin\\Setup_Wizard' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Admin\\Setup_Wizard' ) ) : /** diff --git a/woocommerce/api/Abstract_Cacheable_API_Base.php b/woocommerce/api/Abstract_Cacheable_API_Base.php index 7b9f892fb..22ee9240d 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_10_15\API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\API; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_API_Base; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\API\Traits\Cacheable_Request_Trait; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_API_Base; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\API\Traits\Cacheable_Request_Trait; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\API\\Abstract_Cacheable_API_Base' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\API\\Abstract_Cacheable_API_Base' ) ) : /** diff --git a/woocommerce/api/abstract-sv-wc-api-json-request.php b/woocommerce/api/abstract-sv-wc-api-json-request.php index 29bd9b062..4b440ca18 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_JSON_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 f70ced831..105e8f2b8 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_JSON_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 969d4763d..9c1dc33be 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_XML_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 d2c56d6ca..ca5e05a19 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_XML_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 2d80139a5..d8ed557d8 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_Base' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 db08c69e7..c5a324696 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 8c55bcc8b..a5aafb02f 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_Request' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 2d2fef4ba..f789ef14b 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_API_Response' ) ) : /** diff --git a/woocommerce/api/traits/Cacheable_Request_Trait.php b/woocommerce/api/traits/Cacheable_Request_Trait.php index 4064a8bed..f59125a6f 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_10_15\API\Traits; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\API\Traits; defined( 'ABSPATH' ) or exit; -if ( ! trait_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\API\\Traits\\Cacheable_Request_Trait' ) ) : +if ( ! trait_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\API\\Traits\\Cacheable_Request_Trait' ) ) : /** * This trait can be used to add response caching support to API requests. diff --git a/woocommerce/class-sv-wc-admin-notice-handler.php b/woocommerce/class-sv-wc-admin-notice-handler.php index ef6b6a3d1..1580a024d 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Admin_Notice_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Admin_Notice_Handler' ) ) : /** diff --git a/woocommerce/class-sv-wc-helper.php b/woocommerce/class-sv-wc-helper.php index d74e40ce6..42298de0d 100644 --- a/woocommerce/class-sv-wc-helper.php +++ b/woocommerce/class-sv-wc-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Helper' ) ) : /** diff --git a/woocommerce/class-sv-wc-hook-deprecator.php b/woocommerce/class-sv-wc-hook-deprecator.php index b47a84f8e..47a8dd225 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Hook_Deprecator' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Hook_Deprecator' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-compatibility.php b/woocommerce/class-sv-wc-plugin-compatibility.php index 66e2ebace..6a560e819 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; use Automattic\WooCommerce\Utilities\OrderUtil; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Plugin_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Plugin_Compatibility' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-dependencies.php b/woocommerce/class-sv-wc-plugin-dependencies.php index b2541dc9a..b8e654b4b 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Plugin_Dependencies' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Plugin_Dependencies' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin-exception.php b/woocommerce/class-sv-wc-plugin-exception.php index f4be9fc47..9429f67c0 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Plugin_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Plugin_Exception' ) ) : /** diff --git a/woocommerce/class-sv-wc-plugin.php b/woocommerce/class-sv-wc-plugin.php index 32cf4ca4f..1a62d2c92 100644 --- a/woocommerce/class-sv-wc-plugin.php +++ b/woocommerce/class-sv-wc-plugin.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Plugin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Plugin' ) ) : /** diff --git a/woocommerce/class-sv-wp-admin-message-handler.php b/woocommerce/class-sv-wp-admin-message-handler.php index dbcbf773b..5d6a42f43 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WP_Admin_Message_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 90a8ca521..51e133bde 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Data_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Data_Compatibility' ) ) : /** diff --git a/woocommerce/compatibility/class-sv-wc-datetime.php b/woocommerce/compatibility/class-sv-wc-datetime.php index b2bc714fb..cc2d73516 100644 --- a/woocommerce/compatibility/class-sv-wc-datetime.php +++ b/woocommerce/compatibility/class-sv-wc-datetime.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; use DateTimeZone; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_DateTime' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_DateTime' ) ) : /** diff --git a/woocommerce/compatibility/class-sv-wc-order-compatibility.php b/woocommerce/compatibility/class-sv-wc-order-compatibility.php index 7c82797be..e466f7b33 100644 --- a/woocommerce/compatibility/class-sv-wc-order-compatibility.php +++ b/woocommerce/compatibility/class-sv-wc-order-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; use Automattic\WooCommerce\Utilities\OrderUtil; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Order_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Order_Compatibility' ) ) : /** diff --git a/woocommerce/compatibility/class-sv-wc-product-compatibility.php b/woocommerce/compatibility/class-sv-wc-product-compatibility.php index 1f940a81e..93076a96d 100644 --- a/woocommerce/compatibility/class-sv-wc-product-compatibility.php +++ b/woocommerce/compatibility/class-sv-wc-product-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Product_Compatibility' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Product_Compatibility' ) ) : /** diff --git a/woocommerce/payment-gateway/External_Checkout/Admin.php b/woocommerce/payment-gateway/External_Checkout/Admin.php index 19510af5f..08e855039 100644 --- a/woocommerce/payment-gateway/External_Checkout/Admin.php +++ b/woocommerce/payment-gateway/External_Checkout/Admin.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_10_15\Payment_Gateway\External_Checkout; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Helper; defined( 'ABSPATH' ) or exit; diff --git a/woocommerce/payment-gateway/External_Checkout/External_Checkout.php b/woocommerce/payment-gateway/External_Checkout/External_Checkout.php index 09da92305..9d13c3852 100644 --- a/woocommerce/payment-gateway/External_Checkout/External_Checkout.php +++ b/woocommerce/payment-gateway/External_Checkout/External_Checkout.php @@ -22,10 +22,10 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; diff --git a/woocommerce/payment-gateway/External_Checkout/Frontend.php b/woocommerce/payment-gateway/External_Checkout/Frontend.php index d47ac8736..06f5df786 100644 --- a/woocommerce/payment-gateway/External_Checkout/Frontend.php +++ b/woocommerce/payment-gateway/External_Checkout/Frontend.php @@ -23,16 +23,16 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Handlers\Script_Handler; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Handlers\Script_Handler; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\External_Checkout\\Frontend' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\External_Checkout\\Frontend' ) ) : /** @@ -322,7 +322,7 @@ public function render_terms_notice() { */ public function enqueue_scripts() { - wp_enqueue_style( 'sv-wc-external-checkout-v5_10_15', $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 + wp_enqueue_style( 'sv-wc-external-checkout-v5_11_0', $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 a1331eb4d..5602d3997 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_10_15\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Exception; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\External_Checkout\\Google_Pay\\AJAX' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 843ea58f8..97867bcc9 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_10_15\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Helper; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\External_Checkout\\Google_Pay\\Admin' ) ) : /** @@ -36,7 +36,7 @@ * * @since 5.10.0 */ -class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Admin { +class Admin extends \SkyVerge\WooCommerce\PluginFramework\v5_11_0\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 95e80686a..39d343d25 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_10_15\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Exception; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\External_Checkout\\Google_Pay\\Frontend' ) ) : /** @@ -37,7 +37,7 @@ * * @since 5.10.0 */ -class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Frontend { +class Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Frontend { /** @var string JS handler base class name, without the FW version */ @@ -94,7 +94,7 @@ public function enqueue_scripts() { parent::enqueue_scripts(); wp_enqueue_script( 'google-pay-js-library', 'https://pay.google.com/gp/p/js/pay.js', array(), null, true ); - wp_enqueue_script( 'sv-wc-google-pay-v5_10_15', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $this->get_plugin()->get_version(), true ); + wp_enqueue_script( 'sv-wc-google-pay-v5_11_0', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-google-pay.js', [ 'google-pay-js-library', 'jquery' ], $this->get_plugin()->get_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 2c15b9c9d..62eb398b4 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_10_15\Payment_Gateway\External_Checkout\Google_Pay; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Google_Pay; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Orders; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Exception; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Helper; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\SV_WC_Payment_Gateway_Plugin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\External_Checkout; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Orders; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Exception; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Helper; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\SV_WC_Payment_Gateway_Plugin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\External_Checkout\\Google_Pay\\Google_Pay' ) ) : /** @@ -675,7 +675,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_10_15\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); + $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 599257a85..0eb9229b6 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_10_15\Payment_Gateway\External_Checkout; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 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 c9dddf1d5..95f604dbe 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_API_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 4e20125a5..2935a42f3 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 1a49ff4c7..b3fb13fca 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Apple_Pay_API' ) ) : /** @@ -57,7 +57,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_10_15\\SV_WC_Payment_Gateway_Apple_Pay_API_Response' ); + $this->set_response_handler( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 e6aff7178..0bc611980 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_Payment_Response' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 dc986e092..9d89adfc3 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Admin; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Admin; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_Admin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 3800e4840..ec44e7101 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_AJAX' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 7474bcc49..db5e95b4e 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Apple_Pay_Frontend' ) ) : /** @@ -34,7 +34,7 @@ * * @since 4.7.0 */ -class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Frontend { +class SV_WC_Payment_Gateway_Apple_Pay_Frontend extends \SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Frontend { /** @var string JS handler base class name, without the FW version */ @@ -108,9 +108,9 @@ public function enqueue_scripts() { parent::enqueue_scripts(); - wp_enqueue_style( 'sv-wc-apple-pay-v5_10_15', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', array(), $this->get_plugin()->get_version() ); // TODO: min + wp_enqueue_style( 'sv-wc-apple-pay-v5_11_0', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/sv-wc-payment-gateway-apple-pay.css', array(), $this->get_plugin()->get_version() ); // TODO: min - wp_enqueue_script( 'sv-wc-apple-pay-v5_10_15', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', array( 'jquery' ), $this->get_plugin()->get_version(), true ); + wp_enqueue_script( 'sv-wc-apple-pay-v5_11_0', $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/sv-wc-payment-gateway-apple-pay.js', array( 'jquery' ), $this->get_plugin()->get_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 bcef09027..e04aed698 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Orders; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Orders; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Apple_Pay' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Apple_Pay' ) ) : /** @@ -940,7 +940,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_10_15\\SV_WC_Payment_Gateway_Helper::normalize_card_type', $accepted_card_types ); + $accepted_card_types = array_map( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 0846d1102..295840a43 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_10_15\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as FrameworkBase; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as FrameworkBase; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\Handlers\\Abstract_Hosted_Payment_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 c5d1a4c10..90cc78836 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_10_15\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as FrameworkBase; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as FrameworkBase; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\Handlers\\Abstract_Payment_Handler' ) ) : /** diff --git a/woocommerce/payment-gateway/Handlers/Capture.php b/woocommerce/payment-gateway/Handlers/Capture.php index 99f032f9d..9f73c0164 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_10_15\Payment_Gateway\Handlers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\Handlers; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\Handlers\\Capture' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\Handlers\\Capture' ) ) : /** diff --git a/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php b/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php index b410687ae..d605c1953 100644 --- a/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-plugin-admin-setup-wizard.php +++ b/woocommerce/payment-gateway/admin/abstract-sv-wc-payment-gateway-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_10_15\Payment_Gateway\Admin; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\Admin; defined( 'ABSPATH' ) or exit; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15 as Framework; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0 as Framework; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\Admin\\Setup_Wizard' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\Admin\\Setup_Wizard' ) ) : /** diff --git a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php index cff6fbdd0..dd83bf25f 100644 --- a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php +++ b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Admin_Order' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Admin_Order' ) ) : /** diff --git a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php index 58c5c87af..b78121355 100644 --- a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php +++ b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Admin_Payment_Token_Editor' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Admin_Payment_Token_Editor' ) ) : /** diff --git a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php index 674bc965d..8d1f5d6ca 100644 --- a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php +++ b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Admin_User_Handler' ) ) : /** diff --git a/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php b/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php index 8371094d9..1d5e895f4 100644 --- a/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php +++ b/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Response_Message_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Response_Message_Helper' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php index 64b41d961..bc9110e0e 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-authorization-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Authorization_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Authorization_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php index 90e15b1fb..813a73476 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-create-payment-token-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Create_Payment_Token_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Create_Payment_Token_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php index 0732d8675..0903b1e55 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-customer-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Customer_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Customer_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php index dec54b5cd..f6361cf10 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-get-tokenized-payment-methods-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_API_Get_Tokenized_Payment_Methods_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_API_Get_Tokenized_Payment_Methods_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php index aee8906da..949727448 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-credit-card-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Payment_Notification_Credit_Card_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Payment_Notification_Credit_Card_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php index db5bf37f0..1e989cfbc 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-echeck-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Payment_Notification_eCheck_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Payment_Notification_eCheck_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php index 727834228..3dea90c32 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Payment_Notification_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Payment_Notification_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php index ce4b8e431..23ed3abe1 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-payment-notification-tokenization-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Payment_Notification_Tokenization_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Payment_Notification_Tokenization_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php index 8811b2495..d796bd747 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-request.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Request' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Request' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php index 73ef98577..ec067ab53 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api-response.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API_Response' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API_Response' ) ) : /** diff --git a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php index d315d1e41..6870cfe39 100644 --- a/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-api.php +++ b/woocommerce/payment-gateway/api/interface-sv-wc-payment-gateway-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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_API' ) ) : +if ( ! interface_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_API' ) ) : /** 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 9105affcd..3610baf3c 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,4 @@ 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 t(e.button).show(),t(e.wrapper).show(),e.payment_request=JSON.parse(n),e.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),t(e.button).hide(),1===t(e.container).children().length&&t(e.wrapper).hide(),e.unblock_ui()})}},{key:"get_payment_request",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},t.extend(e,o),t.post(n.ajax_url,e,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('"),this.ui_element.removeClass("processing").unblock(),t("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()}}]),i}(),t(document.body).trigger("sv_wc_apple_pay_handler_v5_10_15_loaded")})}).call(this); +function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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 t(e.button).show(),t(e.wrapper).show(),e.payment_request=JSON.parse(n),e.unblock_ui()},function(n){return console.error("[Apple Pay] Could not build payment request. "+n.message),t(e.button).hide(),1===t(e.container).children().length&&t(e.wrapper).hide(),e.unblock_ui()})}},{key:"get_payment_request",value:function(e){var n=this;return new Promise(function(i,a){var o;return o={action:"wc_".concat(n.gateway_id,"_apple_pay_get_payment_request")},t.extend(e,o),t.post(n.ajax_url,e,function(e){return e.success?i(e.data):a(e.data)})})}},{key:"render_errors",value:function(e){return t(".woocommerce-error, .woocommerce-message").remove(),this.ui_element.prepend('"),this.ui_element.removeClass("processing").unblock(),t("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()}}]),i}(),t(document.body).trigger("sv_wc_apple_pay_handler_v5_11_0_loaded")})}).call(this); },{}]},{},["L57g"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-apple-pay.js.map \ No newline at end of file +//# sourceMappingURL=../frontend/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 75b5a38e6..5435c1700 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":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAEH,OAAO,SAAE,GAAF,aAibN,OA1aM,OAAO,iCAAP,WAMS,SAAA,EAAA,GAAD,EAAA,KAAA,GAoFb,KAAA,kBAAA,KAAA,kBAAA,KAAA,MAQA,KAAA,eAAA,KAAA,eAAA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AY,OAAQ,QAAS,QAhanF,CAAA,IAAA,aAsaL,MAAA,WAAe,OAAA,KAAC,WAAW,cAtatB,EAAA,GA0aN,EAAG,SAAS,MAAO,QAAS,+CAnb1B,KAAA","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["###\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_10_15\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 ''\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_10_15_loaded' )\n"]} \ No newline at end of file +{"version":3,"sources":["frontend/sv-wc-payment-gateway-apple-pay.coffee"],"names":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAEH,OAAO,SAAE,GAAF,aAibN,OA1aM,OAAO,iCAAP,WAMS,SAAA,EAAA,GAAD,EAAA,KAAA,GAoFb,KAAA,kBAAA,KAAA,kBAAA,KAAA,MA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QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QAhanF,CAAA,IAAA,aAsaL,MAAA,WAAe,OAAA,KAAC,WAAW,cAtatB,EAAA,GA0aN,EAAG,SAAS,MAAO,QAAS,+CAnb1B,KAAA","file":"sv-wc-payment-gateway-apple-pay.js","sourceRoot":"../js","sourcesContent":["###\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_11_0\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 ''\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_11_0_loaded' )\n"]} 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 b70ce622b..29b312725 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,4 @@ 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
  • '+e.join("
  • ")+"
  • "),this.uiElement.removeClass("processing").unblock(),t("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()}}]),n}(),t(document.body).trigger("sv_wc_google_pay_handler_v5_10_15_loaded")}); +function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a
  • '+e.join("
  • ")+"
  • "),this.uiElement.removeClass("processing").unblock(),t("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()}}]),n}(),t(document.body).trigger("sv_wc_google_pay_handler_v5_11_0_loaded")}); },{}]},{},["O8A1"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-google-pay.js.map \ No newline at end of file +//# sourceMappingURL=../frontend/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 3c10c3e2d..476ecbd27 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_10_15","params","plugin_id","merchant_id","merchant_name","gateway_id","ajax_url","gateway_id_dasherized","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","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,EAAA,GAAA,KAAA,aAAA,GAAA,MAAA,IAAA,UAAA,qCAAA,SAAA,EAAA,EAAA,GAAA,IAAA,IAAA,EAAA,EAAA,EAAA,EA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AAUc,SAASC,IAAM,KAAO,OAlkB/E,CAAA,IAAA,UAwkBC,MAAA,WACMf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBC,MAAA,WACMnB,KAAAA,UAAUW,cAhlBjB,EAAA,GAolBAlJ,EAAGgH,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_10_15} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_10_15 = class SV_WC_Google_Pay_Handler_v5_10_15 {\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.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\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.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\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.merchantID\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\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_10_15_loaded' );\n\n} );\n"]} \ No newline at end of file +{"version":3,"sources":["frontend/sv-wc-payment-gateway-google-pay.js"],"names":["jQuery","$","window","SV_WC_Google_Pay_Handler_v5_11_0","params","plugin_id","merchant_id","merchant_name","gateway_id","ajax_url","gateway_id_dasherized","recalculate_totals_nonce","process_nonce","button_style","card_types","available_countries","currency_code","needs_shipping","generic_error","gatewayID","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,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,EAAAA,OAAQ,SAAUC,GAEjB,aASAC,OAAOC,kCAAP,WAwBcC,SAAAA,EAAAA,GAAS,EAAA,KAAA,GAGpBC,IAAAA,EAcGD,EAdHC,UACAC,EAaGF,EAbHE,YACAC,EAYGH,EAZHG,cACAC,EAWGJ,EAXHI,WAEAC,GASGL,EAVHM,sBAUGN,EATHK,UACAE,EAQGP,EARHO,yBACAC,EAOGR,EAPHQ,cACAC,EAMGT,EANHS,aACAC,EAKGV,EALHU,WACAC,EAIGX,EAJHW,oBACAC,EAGGZ,EAHHY,cACAC,EAEGb,EAFHa,eACAC,EACGd,EADHc,cAGIC,KAAAA,UAAyBX,EACzBY,KAAAA,WAAyBd,EACzBe,KAAAA,aAAyBd,EACzBe,KAAAA,QAAyBb,EACzBc,KAAAA,uBAAyBZ,EACzBa,KAAAA,aAAyBZ,EACzBa,KAAAA,YAAyBZ,EACzBa,KAAAA,mBAAyBX,EACzBY,KAAAA,aAAyBX,EACzBY,KAAAA,cAAyBX,EACzBY,KAAA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AAG,+BApiBtB,CAAA,IAAA,cA0iBC,MAAA,SAAa6E,GAEZ8D,QAAQ9D,MAAO,gBAAkBA,GAE5BI,KAAAA,YAEA2D,KAAAA,aAAc,CAAE,KAAKhH,iBAhjB5B,CAAA,IAAA,eAsjBC,MAAA,SAAciH,GAGb7I,EAAG,4CAA6C8I,SAG3CP,KAAAA,UAAUQ,QAAS,qCAAuCF,EAAOG,KAAM,aAAgB,cAGvFT,KAAAA,UAAUU,YAAa,cAAeC,UAG3ClJ,EAAG,cAAemJ,QAAS,CAAEC,UAAW,KAAKb,UAAUc,SAASC,IAAM,KAAO,OAlkB/E,CAAA,IAAA,UAwkBC,MAAA,WACMf,KAAAA,UAAUgB,MAAO,CAAExE,QAAS,KAAMyE,WAAY,CAAEC,WAAY,OAAQC,QAAS,QAzkBpF,CAAA,IAAA,YA+kBC,MAAA,WACMnB,KAAAA,UAAUW,cAhlBjB,EAAA,GAolBAlJ,EAAGgH,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_11_0} object\n\t */\n\twindow.SV_WC_Google_Pay_Handler_v5_11_0 = class SV_WC_Google_Pay_Handler_v5_11_0 {\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.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\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.merchantID = merchant_id;\n\t\t\tthis.merchantName = merchant_name;\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.merchantID\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\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_11_0_loaded' );\n\n} );\n"]} 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 723a0f8fc..e8f996065 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,4 @@ 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&&t(i).find("td.woocommerce-PaymentMethod--method").html(o.html()),t(i).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(e,n){return t(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").hide(),i.find("div.edit").show(),i.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(e){var n,i,o,a=this;if(e.preventDefault(),n=t(e.currentTarget),0!==(o=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),o.next(".error").remove(),i={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:o.find("input[name=token-id]").val(),data:o.find("input[name]").serialize()},t.post(this.ajax_url,i).done(function(e){return e.success?(null!=e.data.title&&o.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"),a.disable_editing_ui()):a.display_error(o,e.data)}).fail(function(e,t,n){return a.display_error(o,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").show(),i.find("div.edit").hide(),i.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 t(".woocommerce-MyAccount-paymentMethods").addClass("editing"),t('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),t('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),o||(o=this.i18n.save_error),i=t(".woocommerce-MyAccount-paymentMethods thead tr th").length,t(''+o+"").insertAfter(e).find("td").delay(8e3).slideUp(200)}}]),i}(),t(document.body).trigger("sv_wc_payment_methods_handler_v5_10_15_loaded")})}).call(this); +function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n0&&t(i).find("td.woocommerce-PaymentMethod--method").html(o.html()),t(i).find("td.woocommerce-PaymentMethod--title").remove()})}},{key:"remove_duplicate_default_marks",value:function(){return t(".woocommerce-MyAccount-paymentMethods").find("tr").each(function(e,n){return t(n).find("td.woocommerce-PaymentMethod--default").find("mark.default:not(:first-child)").remove()})}},{key:"edit_method",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").hide(),i.find("div.edit").show(),i.addClass("editing"),n.text(this.i18n.cancel_button).removeClass("edit").addClass("cancel-edit").removeClass("button"),this.enable_editing_ui()}},{key:"save_method",value:function(e){var n,i,o,a=this;if(e.preventDefault(),n=t(e.currentTarget),0!==(o=n.parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return this.block_ui(),o.next(".error").remove(),i={action:"wc_".concat(this.id,"_save_payment_method"),nonce:this.ajax_nonce,token_id:o.find("input[name=token-id]").val(),data:o.find("input[name]").serialize()},t.post(this.ajax_url,i).done(function(e){return e.success?(null!=e.data.title&&o.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"),a.disable_editing_ui()):a.display_error(o,e.data)}).fail(function(e,t,n){return a.display_error(o,n)}).always(function(){return a.unblock_ui()})}},{key:"cancel_edit",value:function(e){var n,i;if(e.preventDefault(),0!==(i=(n=t(e.currentTarget)).parents("tr")).find("input[name=plugin-id][value=".concat(this.slug,"]")).length)return i.find("div.view").show(),i.find("div.edit").hide(),i.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 t(".woocommerce-MyAccount-paymentMethods").addClass("editing"),t('.button[href*="add-payment-method"]').addClass("disabled")}},{key:"disable_editing_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").removeClass("editing"),t('.button[href*="add-payment-method"]').removeClass("disabled")}},{key:"block_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return t(".woocommerce-MyAccount-paymentMethods").parent("div").unblock()}},{key:"display_error",value:function(e,n){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return console.error(n),o||(o=this.i18n.save_error),i=t(".woocommerce-MyAccount-paymentMethods thead tr th").length,t(''+o+"").insertAfter(e).find("td").delay(8e3).slideUp(200)}}]),i}(),t(document.body).trigger("sv_wc_payment_methods_handler_v5_11_0_loaded")})}).call(this); },{}]},{},["nDDW"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-my-payment-methods.js.map \ No newline at end of file +//# sourceMappingURL=../frontend/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 33d0e8f6b..b4716dd99 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":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WACH,OAAO,SAAE,GAAF,aAsQN,OAhQM,OAAO,uCAAP,WAaU,SAAA,EAAA,GAAF,IAAA,EAAA,KAAA,EAAA,KAAA,GA8Cb,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,+BAAA,KAAA,+BAAA,KAAA,MAYA,KAAA,YAAA,KAAA,YAAA,KAAA,MA0BA,KAAA,YAAA,KAAA,YAAA,KAAA,MAqDA,KAAA,YAAA,KAAA,YAAA,KAAA,MAnKE,KAAA,GAAa,EAAK,GAClB,KAAA,KAAa,EAAK,KAClB,KAAA,KAAa,EAAK,KAClB,KAAA,SAAa,EAAK,SAClB,KAAA,WAAa,EAAK,WAGd,KAAA,wBAGA,KAAA,iCAGL,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,SAAE,GAAW,OAAA,EAAK,YAAa,KAG7I,EAAG,yCAA0C,GAAI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A,IAAA,qBAyNL,MAAA,WAMC,OAHA,EAAG,yCAA0C,YAAa,WAG1D,EAAG,uCAAwC,YAAa,cA/NpD,CAAA,IAAA,WAqOL,MAAA,WAAa,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QArOpI,CAAA,IAAA,aA2OL,MAAA,WAAe,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,YA3OvE,CAAA,IAAA,gBAqPL,MAAA,SAAiB,EAAK,GAAO,IAE/B,EAF+B,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAOtC,OALA,QAAQ,MAAO,GAEmB,IAAlC,EAAU,KAAC,KAAK,YAChB,EAAU,EAAG,qDAAsD,OAEnE,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,YAAa,GAAM,KAAM,MAAO,MAAO,KAAO,QAAS,SA5PpI,EAAA,GAgQN,EAAG,SAAS,MAAO,QAAS,qDAvQ1B,KAAA","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2023, 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_10_15\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\"]' ).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\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_10_15_loaded' )\n"]} \ No newline at end of file +{"version":3,"sources":["frontend/sv-wc-payment-gateway-my-payment-methods.coffee"],"names":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WACH,OAAO,SAAE,GAAF,aAsQN,OAhQM,OAAO,uCAAP,WAaU,SAAA,EAAA,GAAF,IAAA,EAAA,KAAA,EAAA,KAAA,GA8Cb,KAAA,sBAAA,KAAA,sBAAA,KAAA,MA4BA,KAAA,+BAAA,KAAA,+BAAA,KAAA,MAYA,KAAA,YAAA,KAAA,YAAA,KAAA,MA0BA,KAAA,YAAA,KAAA,YAAA,KAAA,MAqDA,KAAA,YAAA,KAAA,YAAA,KAAA,MAnKE,KAAA,GAAa,EAAK,GAClB,KAAA,KAAa,EAAK,KAClB,KAAA,KAAa,EAAK,KAClB,KAAA,SAAa,EAAK,SAClB,KAAA,WAAa,EAAK,WAGd,KAAA,wBAGA,KAAA,iCAGL,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,SAAE,GAAW,OAAA,EAAK,YAAa,KAG7I,EAAG,yCAA0C,GAAI,QAAS,mDAAoD,S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MAAA,WAMC,OAHA,EAAG,yCAA0C,YAAa,WAG1D,EAAG,uCAAwC,YAAa,cA/NpD,CAAA,IAAA,WAqOL,MAAA,WAAa,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAQ,QAAS,QArOpI,CAAA,IAAA,aA2OL,MAAA,WAAe,OAAA,EAAG,yCAA0C,OAAQ,OAAQ,YA3OvE,CAAA,IAAA,gBAqPL,MAAA,SAAiB,EAAK,GAAO,IAE/B,EAF+B,EAAU,UAAA,OAAA,QAAA,IAAA,UAAA,GAAA,UAAA,GAAA,GAOtC,OALA,QAAQ,MAAO,GAEmB,IAAlC,EAAU,KAAC,KAAK,YAChB,EAAU,EAAG,qDAAsD,OAEnE,EAAG,kCAAoC,EAAU,KAAO,EAAU,cAAe,YAAa,GAAM,KAAM,MAAO,MAAO,KAAO,QAAS,SA5PpI,EAAA,GAgQN,EAAG,SAAS,MAAO,QAAS,qDAvQ1B,KAAA","file":"sv-wc-payment-gateway-my-payment-methods.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway My Payment Methods CoffeeScript\n Version 5.1.0\n\n Copyright (c) 2014-2023, 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_11_0\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\"]' ).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\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_11_0_loaded' )\n"]} 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 85ffa9344..8d71ce25d 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,4 @@ 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"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".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 e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.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=n.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)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!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 n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('
    • '+e.join("
    • ")+"
    "),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)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(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("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()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_10_15_loaded")})}).call(this); +function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a0&&e.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".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 e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>4)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.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=n.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)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!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 n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('
    • '+e.join("
    • ")+"
    "),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)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(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("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()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_11_0_loaded")})}).call(this); },{}]},{},["JA8d"], null) -//# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map \ No newline at end of file +//# sourceMappingURL=../frontend/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 f9fc2b188..6c39034ff 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":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAAA,IAAA,EAAA,GAAA,QACH,OAAO,SAAE,GACR,aA0XA,OAvXM,OAAO,oCAAP,WAaS,SAAA,EAAA,GAAD,IAAA,EAAA,KAWT,GAXS,EAAA,KAAA,GAEX,KAAA,GAA0B,EAAK,GAC/B,KAAA,cAA0B,EAAK,cAC/B,KAAA,UAA0B,EAAK,UAC/B,KAAA,KAA0B,EAAK,KAC/B,KAAA,aAA0B,EAAK,aAC/B,KAAA,wBAA0B,EAAK,wBAC/B,KAAA,mBAA0B,EAAK,mBAG7B,EAAG,iBAAkB,OACtB,KAAA,KAAO,EAAG,iBACN,KAAA,4BAED,GAAG,EAAG,qBAAsB,OAC/B,KAAA,KAAO,EAAG,qBACN,KAAA,sBAED,CAAA,IAAG,EAAG,2BAA4B,OAMtC,YADA,QAA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,KAAK,cAnXhB,EAAA,GAuXN,EAAG,SAAS,MAAO,QAAS,kDA5X1B,KAAA","file":"sv-wc-payment-gateway-payment-form.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0-beta\n\n Copyright (c) 2014-2023, 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_10_15\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_10_15 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\" ).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' ).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_10_15_loaded\" )\n"]} \ No newline at end of file +{"version":3,"sources":["frontend/sv-wc-payment-gateway-payment-form.coffee"],"names":[],"mappings":";AAOG,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,IAAA,IAAA,SAAA,EAAA,EAAA,EAAA,GAAA,OAAA,GAAA,EAAA,EAAA,UAAA,GAAA,GAAA,EAAA,EAAA,GAAA,GAAA,WAAA,IAAA,EAAA,GAAA,QACH,OAAO,SAAE,GACR,aA0XA,OAvXM,OAAO,oCAAP,WAaS,SAAA,EAAA,GAAD,IAAA,EAAA,KAWT,GAXS,EAAA,KAAA,GAEX,KAAA,GAA0B,EAAK,GAC/B,KAAA,cAA0B,EAAK,cAC/B,KAAA,UAA0B,EAAK,UAC/B,KAAA,KAA0B,EAA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MAAA,WAEF,IAAA,EAEM,OAFH,EAAgB,KAAC,eAAe,KAAM,uDAErB,GAAI,YAAkB,EAAc,UAAe,EAAc,cAtW9E,CAAA,IAAA,WA6WL,MAAA,WAAa,OAAA,KAAC,KAAK,MAAO,CAAA,QAAS,KAAM,WAAY,CAAA,WAAY,OAAO,QAAS,QA7W5E,CAAA,IAAA,aAmXL,MAAA,WAAe,OAAA,KAAC,KAAK,cAnXhB,EAAA,GAuXN,EAAG,SAAS,MAAO,QAAS,kDA5X1B,KAAA","file":"sv-wc-payment-gateway-payment-form.js","sourceRoot":"../js","sourcesContent":["###\n WooCommerce SkyVerge Payment Gateway Framework Payment Form CoffeeScript\n Version 4.3.0-beta\n\n Copyright (c) 2014-2023, 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_11_0\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_11_0 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\" ).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' ).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_11_0_loaded\" )\n"]} diff --git a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.coffee b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.coffee index c4efa8d73..f23924b5a 100644 --- a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.coffee +++ b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-apple-pay.coffee @@ -14,7 +14,7 @@ jQuery ( $ ) -> # The WooCommerce Apple Pay handler base class. # # @since 4.7.0 - class window.SV_WC_Apple_Pay_Handler_v5_10_15 + class window.SV_WC_Apple_Pay_Handler_v5_11_0 # Constructs the handler. @@ -440,4 +440,4 @@ jQuery ( $ ) -> # dispatch loaded event - $( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_10_15_loaded' ) + $( document.body ).trigger( 'sv_wc_apple_pay_handler_v5_11_0_loaded' ) 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 650a3f1c2..3067ba585 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_10_15} object + * @type {SV_WC_Google_Pay_Handler_v5_11_0} object */ - window.SV_WC_Google_Pay_Handler_v5_10_15 = class SV_WC_Google_Pay_Handler_v5_10_15 { + window.SV_WC_Google_Pay_Handler_v5_11_0 = class SV_WC_Google_Pay_Handler_v5_11_0 { /** * Handler constructor. @@ -605,6 +605,6 @@ jQuery( function( $ ) { } } - $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_10_15_loaded' ); + $( document.body ).trigger( 'sv_wc_google_pay_handler_v5_11_0_loaded' ); } ); diff --git a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.coffee b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.coffee index aadc319c7..2b51266cc 100644 --- a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.coffee +++ b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-my-payment-methods.coffee @@ -12,7 +12,7 @@ jQuery ( $ ) -> # The My Payment Methods handler. # # @since 5.1.0 - class window.SV_WC_Payment_Methods_Handler_v5_10_15 + class window.SV_WC_Payment_Methods_Handler_v5_11_0 # Constructs the class. @@ -268,4 +268,4 @@ jQuery ( $ ) -> # dispatch loaded event - $( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_10_15_loaded' ) + $( document.body ).trigger( 'sv_wc_payment_methods_handler_v5_11_0_loaded' ) diff --git a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.coffee b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.coffee index 535257dc4..61dade39e 100644 --- a/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.coffee +++ b/woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-payment-form.coffee @@ -10,7 +10,7 @@ jQuery ( $ ) -> "use strict" - class window.SV_WC_Payment_Form_Handler_v5_10_15 + class window.SV_WC_Payment_Form_Handler_v5_11_0 # Public: Instantiate Payment Form Handler @@ -22,7 +22,7 @@ jQuery ( $ ) -> # type - gateway type, either `credit-card` or `echeck` # csc_required - true if the gateway requires the CSC field to be displayed # - # Returns SV_WC_Payment_Form_Handler_v5_10_15 instance + # Returns SV_WC_Payment_Form_Handler_v5_11_0 instance constructor: (args) -> @id = args.id @@ -385,4 +385,4 @@ jQuery ( $ ) -> # dispatch loaded event - $( document.body ).trigger( "sv_wc_payment_form_handler_v5_10_15_loaded" ) + $( document.body ).trigger( "sv_wc_payment_form_handler_v5_11_0_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 82ae7c8cb..86e1ef033 100644 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Direct' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 d665975d7..77595cc75 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Helper' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 5ca725ddd..481a8b88d 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Hosted' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 a30bd5c9e..d347c8a0c 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_My_Payment_Methods' ) ) : /** @@ -169,9 +169,9 @@ public function maybe_enqueue_styles_scripts() { wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), WC_VERSION, true ); - wp_enqueue_style( "$handle-v5_10_15", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array( 'dashicons' ), SV_WC_Plugin::VERSION ); + wp_enqueue_style( "$handle-v5_11_0", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/css/frontend/' . $handle . '.min.css', array( 'dashicons' ), SV_WC_Plugin::VERSION ); - wp_enqueue_script( "$handle-v5_10_15", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::VERSION ); + wp_enqueue_script( "$handle-v5_11_0", $this->get_plugin()->get_payment_gateway_framework_assets_url() . '/dist/frontend/' . $handle . '.js', array( 'jquery-tiptip', 'jquery' ), SV_WC_Plugin::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 0c8304dcf..f299ea0b1 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,11 +22,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Payment_Form' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway_Payment_Form' ) ) : /** @@ -1103,7 +1103,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_10_15\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ], $card_types ); + $args['enabled_card_types'] = array_map( [ 'SkyVerge\WooCommerce\PluginFramework\v5_11_0\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 d74ba2fd0..e7f989ade 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note; use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\External_Checkout; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\External_Checkout; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway\External_Checkout\Google_Pay\Google_Pay; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Plugin' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 a8908db8b..297387c44 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Privacy' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 27a40e393..4cfac88e2 100755 --- a/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +++ b/woocommerce/payment-gateway/class-sv-wc-payment-gateway.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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WC_Payment_Gateway' ) ) : /** @@ -460,7 +460,7 @@ protected function enqueue_payment_form_assets() { } $handle = 'sv-wc-payment-gateway-payment-form'; - $versioned_handle = $handle . '-v5_10_15'; + $versioned_handle = $handle . '-v5_11_0'; // 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 54925e7e1..a860a08a6 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Exception' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 79692e538..6737180d6 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Integration' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 7eacf78d0..58b53a433 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Integration_Pre_Orders' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 256955598..99709d691 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Integration_Subscriptions' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 797849514..0cea3ef67 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Payment_Token' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 18e9a7139..333e864c1 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WC_Payment_Gateway_Payment_Tokens_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 9b31111e9..5efdd54fc 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,18 +22,18 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ -namespace SkyVerge\WooCommerce\PluginFramework\v5_10_15\Payment_Gateway; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\REST_API as Plugin_REST_API; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\Payment_Gateway; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\REST_API as Plugin_REST_API; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\Payment_Gateway\\REST_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\Payment_Gateway\\REST_API' ) ) : /** * The payment gateway plugin REST API handler class. * - * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_15\REST_API + * @see \SkyVerge\WooCommerce\PluginFramework\v5_11_0\REST_API * * @since 5.2.0 */ @@ -45,7 +45,7 @@ class REST_API extends Plugin_REST_API { * * Plugins can override this to add their own data. * - * @see \SkyVerge\WooCommerce\PluginFramework\v5_10_15\REST_API::get_system_status_data() + * @see \SkyVerge\WooCommerce\PluginFramework\v5_11_0\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 31260e28a..e37f333e5 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_10_15\REST_API\Controllers; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0\REST_API\Controllers; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Settings_API\Abstract_Settings; -use SkyVerge\WooCommerce\PluginFramework\v5_10_15\Settings_API\Setting; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Settings_API\Abstract_Settings; +use SkyVerge\WooCommerce\PluginFramework\v5_11_0\Settings_API\Setting; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\REST_API\\Controllers\\Settings' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\REST_API\\Controllers\\Settings' ) ) : /** * The settings controller class. 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 13a81e496..5700f37c0 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\REST_API' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\REST_API' ) ) : /** diff --git a/woocommerce/utilities/class-sv-wp-async-request.php b/woocommerce/utilities/class-sv-wp-async-request.php index dfd9916f8..dfb6a3077 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WP_Async_Request' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 12d0464a7..31725a60e 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_10_15; +namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; -if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WP_Background_Job_Handler' ) ) : +if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\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 358d3eb17..7fe84204f 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_10_15; + namespace SkyVerge\WooCommerce\PluginFramework\v5_11_0; defined( 'ABSPATH' ) or exit; - if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_10_15\\SV_WP_Job_Batch_Handler' ) ) : + if ( ! class_exists( '\\SkyVerge\\WooCommerce\\PluginFramework\\v5_11_0\\SV_WP_Job_Batch_Handler' ) ) : /**