8
8
* Plugin Name: BitPay Checkout for WooCommerce
9
9
* Plugin URI: https://www.bitpay.com
10
10
* Description: BitPay Checkout Plugin
11
- * Version: 5.3.2
11
+ * Version: 5.4.0
12
12
* Author: BitPay
13
13
* Author URI: mailto:[email protected] ?subject=BitPay Checkout for WooCommerce
14
14
*/
15
15
class WcGatewayBitpay extends \WC_Payment_Gateway {
16
16
17
17
public const IGNORE_STATUS_VALUE = 'bitpay-ignore ' ;
18
+ public const GATEWAY_NAME = 'bitpay_checkout_gateway ' ;
19
+ public const TITLE = 'BitPay ' ;
20
+
18
21
private string $ instructions ;
19
22
20
23
public function __construct () {
21
- $ this ->id = ' bitpay_checkout_gateway ' ;
24
+ $ this ->id = self :: GATEWAY_NAME ;
22
25
$ this ->icon = $ this ->get_icon_on_payment_page ();
23
26
24
27
$ this ->has_fields = true ;
@@ -33,16 +36,23 @@ public function __construct() {
33
36
$ this ->init_form_fields ();
34
37
$ this ->init_settings ();
35
38
36
- $ this ->title = ' BitPay ' ;
39
+ $ this ->title = self :: TITLE ;
37
40
$ this ->description = $ this ->get_option ( 'description ' ) . '<br> ' ;
38
41
$ this ->instructions = $ this ->get_option ( 'instructions ' , $ this ->description );
39
42
40
43
add_action ( 'woocommerce_update_options_payment_gateways_ ' . $ this ->id , array ( $ this , 'process_admin_options ' ) );
41
44
add_action ( 'woocommerce_email_before_order_table ' , array ( $ this , 'email_instructions ' ), 10 , 3 );
42
- wp_enqueue_script ( 'bitpay_wc_gateway ' , plugins_url ( '../../js/wc_gateway_bitpay.js ' , __FILE__ ), null , 1 , false );
45
+ wp_enqueue_script ( 'jquery ' );
46
+ wp_enqueue_script (
47
+ 'bitpay_wc_gateway ' ,
48
+ plugins_url ( '../../js/wc_gateway_bitpay.js ' , __FILE__ ),
49
+ null ,
50
+ 1 ,
51
+ false
52
+ );
43
53
}
44
54
public function email_instructions ( $ order , $ sent_to_admin , $ plain_text = false ) {
45
- if ( $ this ->instructions && ! $ sent_to_admin && ' bitpay_checkout_gateway ' === $ order ->get_payment_method () && $ order ->has_status ( 'processing ' ) ) {
55
+ if ( $ this ->instructions && ! $ sent_to_admin && self :: GATEWAY_NAME === $ order ->get_payment_method () && $ order ->has_status ( 'processing ' ) ) {
46
56
echo wp_kses_post ( wpautop ( wptexturize ( $ this ->instructions ) ) . PHP_EOL );
47
57
}
48
58
}
0 commit comments