Skip to content

Commit

Permalink
Merge pull request #23 from ndeet/fix-js-error
Browse files Browse the repository at this point in the history
Fix edgecase JS error on payment selection.
  • Loading branch information
ndeet authored Aug 22, 2023
2 parents 72ba07c + cca8750 commit d752bbd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions assets/js/modalCheckout.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ jQuery(function ($) {
var selected_gateway = $('form[name="checkout"] input[name="payment_method"]:checked').val();
unblockElement('.woocommerce-checkout-payment');

if (!selected_gateway) {
return;
}

if (selected_gateway.startsWith('btcpaygf_')) {
// Bind our custom event handler to the checkout button.
checkout_form.on('checkout_place_order', submitOrder);
Expand Down
4 changes: 2 additions & 2 deletions btcpay-greenfield-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://btcpayserver.org
* Text Domain: btcpay-greenfield-for-woocommerce
* Domain Path: /languages
* Version: 2.2.1
* Version: 2.2.2
* Requires PHP: 7.4
* Tested up to: 6.3
* Requires at least: 5.2
Expand All @@ -25,7 +25,7 @@

defined( 'ABSPATH' ) || exit();

define( 'BTCPAYSERVER_VERSION', '2.2.1' );
define( 'BTCPAYSERVER_VERSION', '2.2.2' );
define( 'BTCPAYSERVER_VERSION_KEY', 'btcpay_gf_version' );
define( 'BTCPAYSERVER_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) );
define( 'BTCPAYSERVER_PLUGIN_URL', plugin_dir_url(__FILE__ ) );
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: bitcoin, btcpay, BTCPay Server, btcpayserver, WooCommerce, payment gateway
Requires at least: 5.2
Tested up to: 6.3
Requires PHP: 7.4
Stable tag: 2.2.1
Stable tag: 2.2.2
License: MIT
License URI: https://github.com/btcpayserver/woocommerce-greenfield-plugin/blob/master/license.txt

Expand Down Expand Up @@ -104,6 +104,9 @@ You'll find extensive documentation and answers to many of your questions on [BT

== Changelog ==

= 2.2.2 :: 2023-08-22 =
* Fix edgecase JS error on payment method selection.

= 2.2.1 :: 2023-08-17 =
* Add tooltip with webhook callback information

Expand Down

0 comments on commit d752bbd

Please sign in to comment.