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.0 .0
11
+ * Version: 5.2 .0
12
12
* Author: BitPay
13
13
* Author URI: mailto:[email protected] ?subject=BitPay Checkout for WooCommerce
14
14
*/
@@ -28,7 +28,6 @@ public function __construct() {
28
28
29
29
if ( empty ( $ _GET ['woo-bitpay-return ' ] ) ) { // phpcs:ignore
30
30
$ this ->order_button_text = __ ( 'Pay with BitPay ' , 'woocommerce-gateway-bitpay_checkout_gateway ' );
31
-
32
31
}
33
32
34
33
$ this ->init_form_fields ();
@@ -40,13 +39,15 @@ public function __construct() {
40
39
41
40
add_action ( 'woocommerce_update_options_payment_gateways_ ' . $ this ->id , array ( $ this , 'process_admin_options ' ) );
42
41
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 );
43
43
}
44
44
public function email_instructions ( $ order , $ sent_to_admin , $ plain_text = false ) {
45
45
if ( $ this ->instructions && ! $ sent_to_admin && 'bitpay_checkout_gateway ' === $ order ->get_payment_method () && $ order ->has_status ( 'processing ' ) ) {
46
46
echo wp_kses_post ( wpautop ( wptexturize ( $ this ->instructions ) ) . PHP_EOL );
47
47
}
48
48
}
49
49
public function init_form_fields () {
50
+ $ settings = new BitPayPaymentSettings ();
50
51
$ wc_statuses_arr = wc_get_order_statuses ();
51
52
unset( $ wc_statuses_arr ['wc-cancelled ' ] );
52
53
unset( $ wc_statuses_arr ['wc-refunded ' ] );
@@ -62,6 +63,39 @@ public function init_form_fields() {
62
63
'description ' => '' ,
63
64
'default ' => 'no ' ,
64
65
),
66
+ 'bitpay_logo ' => array (
67
+ 'title ' => __ ( 'BitPay Logo ' , 'woocommerce ' ),
68
+ 'type ' => 'select ' ,
69
+ 'description ' => '' ,
70
+ 'options ' => array (
71
+ 'BitPay-Accepted-CardGroup ' => 'BitPay Accepted ' ,
72
+ 'BitPay-Accepted-CardGroup-DarkMode ' => 'BitPay Accepted (Dark mode) ' ,
73
+ 'Pay-with-BitPay-CardGroup ' => 'Pay with BitPay ' ,
74
+ 'Pay-with-BitPay-CardGroup-DarkMode ' => 'Pay with BitPay (Dark mode) ' ,
75
+ 'BitPay-Accepted-Card-Alt ' => 'BitPay Accepted Card - Alt ' ,
76
+ 'BitPay-Accepted-Card-Alt-DarkMode ' => 'BitPay Accepted Card - Alt (Dark mode) ' ,
77
+ 'BitPay-Accepted-Card ' => 'BitPay Accepted Card ' ,
78
+ 'BitPay-Accepted-Card-DarkMode ' => 'BitPay Accepted Card (Dark mode) ' ,
79
+ 'BitPay-Accepted-Card-GrayScale ' => 'BitPay Accepted Card - Grayscale ' ,
80
+ 'PayWith-BitPay-Card2x ' => 'Pay with BitPay Card ' ,
81
+ 'PayWith-BitPay-Card-Alt ' => 'Pay with BitPay Card - Alt ' ,
82
+ 'PayWith-BitPay-Card-GrayScale ' => 'Pay with BitPay Card - Grayscale ' ,
83
+ 'PayWith-BitPay-Card-DarkMode ' => 'Pay with BitPay Card (Dark mode) ' ,
84
+ ),
85
+ 'default ' => 'BitPay-Accepted-CardGroup ' ,
86
+ ),
87
+ 'bitpay_logo_image_white ' => array (
88
+ 'id ' => 'bitpay_logo ' ,
89
+ 'description ' => '<img src=" ' . $ settings ->get_payment_logo_url ()
90
+ . '" style="background-color: white;"/> ' ,
91
+ 'type ' => 'title ' ,
92
+ ),
93
+ 'bitpay_logo_image_dark ' => array (
94
+ 'id ' => 'bitpay_logo ' ,
95
+ 'description ' => '<img src=" ' . $ settings ->get_payment_logo_url ()
96
+ . '" style="background-color: black;"/> ' ,
97
+ 'type ' => 'title ' ,
98
+ ),
65
99
'bitpay_checkout_info ' => array (
66
100
'description ' => __ ( 'You should not ship any products until BitPay has finalized your transaction.<br>The order will stay in a <b>Hold</b> and/or <b>Processing</b> state, and will automatically change to <b>Completed</b> after the payment has been confirmed. ' , 'woocommerce ' ),
67
101
'type ' => 'title ' ,
@@ -244,8 +278,9 @@ public function process_payment( $order_id ) {
244
278
}
245
279
246
280
private function get_icon_on_payment_page (): string {
247
- $ brand = '//bitpay.com/cdn/merchant-resources/pay-with-bitpay-card-group.svg ' ;
248
- return $ brand . '" class="bitpay_logo" ' ;
281
+ $ settings = new BitPayPaymentSettings ();
282
+
283
+ return $ settings ->get_payment_logo_url () . '" id="bitpay_logo ' ;
249
284
}
250
285
251
286
private function get_processing_link (): string {
0 commit comments