diff --git a/BitPayLib/class-bitpaycancelorder.php b/BitPayLib/class-bitpaycancelorder.php index 988aec5b..4b087894 100644 --- a/BitPayLib/class-bitpaycancelorder.php +++ b/BitPayLib/class-bitpaycancelorder.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpaycart.php b/BitPayLib/class-bitpaycart.php index f3d5b09c..41993d80 100644 --- a/BitPayLib/class-bitpaycart.php +++ b/BitPayLib/class-bitpaycart.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpaycheckouttransactions.php b/BitPayLib/class-bitpaycheckouttransactions.php index 843717ae..65afde2f 100644 --- a/BitPayLib/class-bitpaycheckouttransactions.php +++ b/BitPayLib/class-bitpaycheckouttransactions.php @@ -11,7 +11,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpayclientfactory.php b/BitPayLib/class-bitpayclientfactory.php index 1be7b887..08f58baf 100644 --- a/BitPayLib/class-bitpayclientfactory.php +++ b/BitPayLib/class-bitpayclientfactory.php @@ -13,7 +13,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpayinvoicecreate.php b/BitPayLib/class-bitpayinvoicecreate.php index f9bcbca0..2f863aa4 100644 --- a/BitPayLib/class-bitpayinvoicecreate.php +++ b/BitPayLib/class-bitpayinvoicecreate.php @@ -13,7 +13,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -89,6 +89,7 @@ public function execute(): void { wp_redirect( $bitpay_invoice->getRedirectURL() ); // phpcs:ignore exit(); } catch ( BitPayException $e ) { + $this->bitpay_logger->execute( $e->getMessage(), 'NEW BITPAY INVOICE', false, true ); $error_url = get_home_url() . '/' . $bitpay_checkout_options['bitpay_checkout_error']; $order = new \WC_Order( $order_id ); $items = $order->get_items(); @@ -106,6 +107,7 @@ public function execute(): void { wp_redirect( $error_url ); // phpcs:ignore die(); } catch ( \Exception $e ) { + $this->bitpay_logger->execute( $e->getMessage(), 'NEW BITPAY INVOICE', false, true ); global $woocommerce; $cart_url = $woocommerce->cart->get_cart_url(); wp_redirect( $cart_url ); // phpcs:ignore diff --git a/BitPayLib/class-bitpayipnprocess.php b/BitPayLib/class-bitpayipnprocess.php index 77e89862..f1f2d798 100644 --- a/BitPayLib/class-bitpayipnprocess.php +++ b/BitPayLib/class-bitpayipnprocess.php @@ -13,7 +13,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpaylogger.php b/BitPayLib/class-bitpaylogger.php index 482574cd..ce550e23 100644 --- a/BitPayLib/class-bitpaylogger.php +++ b/BitPayLib/class-bitpaylogger.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpaypages.php b/BitPayLib/class-bitpaypages.php index fc4749fa..e08646de 100644 --- a/BitPayLib/class-bitpaypages.php +++ b/BitPayLib/class-bitpaypages.php @@ -7,7 +7,7 @@ /** * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-bitpaypaymentsettings.php b/BitPayLib/class-bitpaypaymentsettings.php index 5733adb6..191ee0db 100644 --- a/BitPayLib/class-bitpaypaymentsettings.php +++ b/BitPayLib/class-bitpaypaymentsettings.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -137,14 +137,6 @@ public function get_checkout_message(): string { return $this->get_bitpay_gateway_setting( 'bitpay_checkout_checkout_message', '' ); } - private function get_bitpay_gateway_setting( string $setting_name, $default_value = null ): ?string { - return $this->get_bitpay_gateway_settings()[ $setting_name ] ?? $default_value; - } - - private function get_bitpay_gateway_settings(): array { - return get_option( 'woocommerce_bitpay_checkout_gateway_settings', array() ); - } - public function get_close_url(): ?string { return $this->get_bitpay_gateway_setting( 'bitpay_close_url', null ); } @@ -170,4 +162,18 @@ public function get_checkout_slug(): ?string { return $slug; } + + public function get_payment_logo_url(): string { + $logo = $this->get_bitpay_gateway_setting( 'bitpay_logo', 'BitPay-Accepted-CardGroup' ); + + return plugins_url( '../../images/', __FILE__ ) . $logo . '.svg'; + } + + private function get_bitpay_gateway_setting( string $setting_name, $default_value = null ): ?string { + return $this->get_bitpay_gateway_settings()[ $setting_name ] ?? $default_value; + } + + private function get_bitpay_gateway_settings(): array { + return get_option( 'woocommerce_bitpay_checkout_gateway_settings', array() ); + } } diff --git a/BitPayLib/class-bitpaypluginsetup.php b/BitPayLib/class-bitpaypluginsetup.php index 16c25e3c..9416107e 100644 --- a/BitPayLib/class-bitpaypluginsetup.php +++ b/BitPayLib/class-bitpaypluginsetup.php @@ -10,7 +10,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/BitPayLib/class-wcgatewaybitpay.php b/BitPayLib/class-wcgatewaybitpay.php index ef21b3e2..757279c1 100644 --- a/BitPayLib/class-wcgatewaybitpay.php +++ b/BitPayLib/class-wcgatewaybitpay.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -28,7 +28,6 @@ public function __construct() { if ( empty( $_GET['woo-bitpay-return'] ) ) { // phpcs:ignore $this->order_button_text = __( 'Pay with BitPay', 'woocommerce-gateway-bitpay_checkout_gateway' ); - } $this->init_form_fields(); @@ -40,6 +39,7 @@ public function __construct() { add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 ); + wp_enqueue_script( 'bitpay_wc_gateway', plugins_url( '../../js/wc_gateway_bitpay.js', __FILE__ ), null, 1, false ); } public function email_instructions( $order, $sent_to_admin, $plain_text = false ) { if ( $this->instructions && ! $sent_to_admin && 'bitpay_checkout_gateway' === $order->get_payment_method() && $order->has_status( 'processing' ) ) { @@ -47,6 +47,7 @@ public function email_instructions( $order, $sent_to_admin, $plain_text = false } } public function init_form_fields() { + $settings = new BitPayPaymentSettings(); $wc_statuses_arr = wc_get_order_statuses(); unset( $wc_statuses_arr['wc-cancelled'] ); unset( $wc_statuses_arr['wc-refunded'] ); @@ -62,6 +63,39 @@ public function init_form_fields() { 'description' => '', 'default' => 'no', ), + 'bitpay_logo' => array( + 'title' => __( 'BitPay Logo', 'woocommerce' ), + 'type' => 'select', + 'description' => '', + 'options' => array( + 'BitPay-Accepted-CardGroup' => 'BitPay Accepted', + 'BitPay-Accepted-CardGroup-DarkMode' => 'BitPay Accepted (Dark mode)', + 'Pay-with-BitPay-CardGroup' => 'Pay with BitPay', + 'Pay-with-BitPay-CardGroup-DarkMode' => 'Pay with BitPay (Dark mode)', + 'BitPay-Accepted-Card-Alt' => 'BitPay Accepted Card - Alt', + 'BitPay-Accepted-Card-Alt-DarkMode' => 'BitPay Accepted Card - Alt (Dark mode)', + 'BitPay-Accepted-Card' => 'BitPay Accepted Card', + 'BitPay-Accepted-Card-DarkMode' => 'BitPay Accepted Card (Dark mode)', + 'BitPay-Accepted-Card-GrayScale' => 'BitPay Accepted Card - Grayscale', + 'PayWith-BitPay-Card2x' => 'Pay with BitPay Card', + 'PayWith-BitPay-Card-Alt' => 'Pay with BitPay Card - Alt', + 'PayWith-BitPay-Card-GrayScale' => 'Pay with BitPay Card - Grayscale', + 'PayWith-BitPay-Card-DarkMode' => 'Pay with BitPay Card (Dark mode)', + ), + 'default' => 'BitPay-Accepted-CardGroup', + ), + 'bitpay_logo_image_white' => array( + 'id' => 'bitpay_logo', + 'description' => '', + 'type' => 'title', + ), + 'bitpay_logo_image_dark' => array( + 'id' => 'bitpay_logo', + 'description' => '', + 'type' => 'title', + ), 'bitpay_checkout_info' => array( 'description' => __( 'You should not ship any products until BitPay has finalized your transaction.
The order will stay in a Hold and/or Processing state, and will automatically change to Completed after the payment has been confirmed.', 'woocommerce' ), 'type' => 'title', @@ -244,8 +278,9 @@ public function process_payment( $order_id ) { } private function get_icon_on_payment_page(): string { - $brand = '//bitpay.com/cdn/merchant-resources/pay-with-bitpay-card-group.svg'; - return $brand . '" class="bitpay_logo"'; + $settings = new BitPayPaymentSettings(); + + return $settings->get_payment_logo_url() . '" id="bitpay_logo'; } private function get_processing_link(): string { diff --git a/BitPayLib/trait-wpdbhelper.php b/BitPayLib/trait-wpdbhelper.php index 8d68cc97..3edb4208 100644 --- a/BitPayLib/trait-wpdbhelper.php +++ b/BitPayLib/trait-wpdbhelper.php @@ -10,7 +10,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/CHANGELOG.md b/CHANGELOG.md index 82a6e871..94101f03 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +# 5.2.0 +* Add admin option to allow users to select their BitPay button +* log create invoice issues + # 5.1.0 * Generate vendors to avoid potential conflicts between plugins (inconsistent version of same vendor) diff --git a/images/BitPay-Accepted-Card-Alt-DarkMode.svg b/images/BitPay-Accepted-Card-Alt-DarkMode.svg new file mode 100644 index 00000000..ecec9f00 --- /dev/null +++ b/images/BitPay-Accepted-Card-Alt-DarkMode.svg @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/BitPay-Accepted-Card-Alt.svg b/images/BitPay-Accepted-Card-Alt.svg new file mode 100644 index 00000000..6fb77b95 --- /dev/null +++ b/images/BitPay-Accepted-Card-Alt.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/BitPay-Accepted-Card-DarkMode.svg b/images/BitPay-Accepted-Card-DarkMode.svg new file mode 100644 index 00000000..90c1c26b --- /dev/null +++ b/images/BitPay-Accepted-Card-DarkMode.svg @@ -0,0 +1,30 @@ + + + + BitPay-Accepted-Card-DarkMode + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/BitPay-Accepted-Card-GrayScale.svg b/images/BitPay-Accepted-Card-GrayScale.svg new file mode 100644 index 00000000..08a6bc80 --- /dev/null +++ b/images/BitPay-Accepted-Card-GrayScale.svg @@ -0,0 +1,34 @@ + + + + BitPay-Accepted-Card-GrayScale + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/BitPay-Accepted-Card.svg b/images/BitPay-Accepted-Card.svg new file mode 100644 index 00000000..1423c717 --- /dev/null +++ b/images/BitPay-Accepted-Card.svg @@ -0,0 +1,30 @@ + + + + BitPay-Accepted-Card + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/BitPay-Accepted-CardGroup-DarkMode.svg b/images/BitPay-Accepted-CardGroup-DarkMode.svg new file mode 100644 index 00000000..3d6f70a5 --- /dev/null +++ b/images/BitPay-Accepted-CardGroup-DarkMode.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/BitPay-Accepted-CardGroup.svg b/images/BitPay-Accepted-CardGroup.svg new file mode 100644 index 00000000..96e6a000 --- /dev/null +++ b/images/BitPay-Accepted-CardGroup.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/Pay-with-BitPay-CardGroup-DarkMode.svg b/images/Pay-with-BitPay-CardGroup-DarkMode.svg new file mode 100644 index 00000000..5663d134 --- /dev/null +++ b/images/Pay-with-BitPay-CardGroup-DarkMode.svg @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/Pay-with-BitPay-CardGroup.svg b/images/Pay-with-BitPay-CardGroup.svg new file mode 100644 index 00000000..43132242 --- /dev/null +++ b/images/Pay-with-BitPay-CardGroup.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/PayWith-BitPay-Card-Alt.svg b/images/PayWith-BitPay-Card-Alt.svg new file mode 100644 index 00000000..3073bdf8 --- /dev/null +++ b/images/PayWith-BitPay-Card-Alt.svg @@ -0,0 +1,37 @@ + + + + PayWith-BitPay-Card-Alt + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/PayWith-BitPay-Card-DarkMode.svg b/images/PayWith-BitPay-Card-DarkMode.svg new file mode 100644 index 00000000..78a25f0c --- /dev/null +++ b/images/PayWith-BitPay-Card-DarkMode.svg @@ -0,0 +1,35 @@ + + + + PayWith-BitPay-Card-DarkMode + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/PayWith-BitPay-Card-GrayScale.svg b/images/PayWith-BitPay-Card-GrayScale.svg new file mode 100644 index 00000000..238fb9db --- /dev/null +++ b/images/PayWith-BitPay-Card-GrayScale.svg @@ -0,0 +1,37 @@ + + + + PayWith-BitPay-Card-GrayScale + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/PayWith-BitPay-Card2x.svg b/images/PayWith-BitPay-Card2x.svg new file mode 100644 index 00000000..166214ae --- /dev/null +++ b/images/PayWith-BitPay-Card2x.svg @@ -0,0 +1,35 @@ + + + + PayWith-BitPay-Card + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.php b/index.php index 93cfe9d0..fbe43a75 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/js/wc_gateway_bitpay.js b/js/wc_gateway_bitpay.js new file mode 100644 index 00000000..e7712708 --- /dev/null +++ b/js/wc_gateway_bitpay.js @@ -0,0 +1,21 @@ +jQuery( document ).ready( + function () { + const logo = jQuery( "#woocommerce_bitpay_checkout_gateway_bitpay_logo" ); + if ( logo.length === 0 ) { + return; + } + + logo.on( + "change", + function () { + const white = jQuery( "#woocommerce_bitpay_checkout_gateway_bitpay_logo_image_white" ).next(); + const dark = jQuery( "#woocommerce_bitpay_checkout_gateway_bitpay_logo_image_dark" ).next(); + const url = window.location.origin + '/wp-content/plugins/bitpay-checkout-for-woocommerce/images/' + + this.value + '.svg' + + white.html( '' ); + dark.html( '' ); + } + ) + } +); diff --git a/readme.txt b/readme.txt index 6c7afcbe..3ac153aa 100644 --- a/readme.txt +++ b/readme.txt @@ -111,6 +111,10 @@ You can contact our support team via the following form https://bitpay.com/reque == Changelog == += 5.2.0 = +* Add admin option to allow users to select their BitPay button +* log create invoice issues + = 5.1.0 = * Generate vendors to avoid potential conflicts between plugins (inconsistent version of same vendor) diff --git a/vendorPrefixed/BitPayLib/class-bitpaycancelorder.php b/vendorPrefixed/BitPayLib/class-bitpaycancelorder.php index f8e0d884..b14e5f5f 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaycancelorder.php +++ b/vendorPrefixed/BitPayLib/class-bitpaycancelorder.php @@ -7,7 +7,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/BitPayLib/class-bitpaycart.php b/vendorPrefixed/BitPayLib/class-bitpaycart.php index 3ecdc63a..14a3948c 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaycart.php +++ b/vendorPrefixed/BitPayLib/class-bitpaycart.php @@ -7,7 +7,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/BitPayLib/class-bitpaycheckouttransactions.php b/vendorPrefixed/BitPayLib/class-bitpaycheckouttransactions.php index d1bd8f4e..431b22a7 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaycheckouttransactions.php +++ b/vendorPrefixed/BitPayLib/class-bitpaycheckouttransactions.php @@ -9,7 +9,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/BitPayLib/class-bitpayclientfactory.php b/vendorPrefixed/BitPayLib/class-bitpayclientfactory.php index 2136cb7e..3d4c388b 100644 --- a/vendorPrefixed/BitPayLib/class-bitpayclientfactory.php +++ b/vendorPrefixed/BitPayLib/class-bitpayclientfactory.php @@ -11,7 +11,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -40,6 +40,6 @@ private function get_environment() : string if ('production' === \strtolower($environment)) { return Env::PROD; } - throw new \RuntimeException('Wrong environment ' . $environment); + throw new \RuntimeException('Wrong environment ' . esc_html($environment)); } } diff --git a/vendorPrefixed/BitPayLib/class-bitpayinvoicecreate.php b/vendorPrefixed/BitPayLib/class-bitpayinvoicecreate.php index 6acb2a4e..b47dc427 100644 --- a/vendorPrefixed/BitPayLib/class-bitpayinvoicecreate.php +++ b/vendorPrefixed/BitPayLib/class-bitpayinvoicecreate.php @@ -11,7 +11,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -71,6 +71,7 @@ public function execute() : void // phpcs:ignore exit; } catch (BitPayException $e) { + $this->bitpay_logger->execute($e->getMessage(), 'NEW BITPAY INVOICE', \false, \true); $error_url = get_home_url() . '/' . $bitpay_checkout_options['bitpay_checkout_error']; $order = new \WC_Order($order_id); $items = $order->get_items(); @@ -89,6 +90,7 @@ public function execute() : void // phpcs:ignore die; } catch (\Exception $e) { + $this->bitpay_logger->execute($e->getMessage(), 'NEW BITPAY INVOICE', \false, \true); global $woocommerce; $cart_url = $woocommerce->cart->get_cart_url(); wp_redirect($cart_url); diff --git a/vendorPrefixed/BitPayLib/class-bitpayipnprocess.php b/vendorPrefixed/BitPayLib/class-bitpayipnprocess.php index b20330df..b8958ab0 100644 --- a/vendorPrefixed/BitPayLib/class-bitpayipnprocess.php +++ b/vendorPrefixed/BitPayLib/class-bitpayipnprocess.php @@ -11,7 +11,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -102,7 +102,7 @@ private function validate_bitpay_status_in_available_statuses(Invoice $bitpay_in if (!\in_array($status, $available_statuses, \true)) { $message = 'Wrong BitPay status. Status: ' . $status . ' available statuses: ' . \print_r($available_statuses, \true); // phpcs:ignore - throw new \RuntimeException($message); + throw new \RuntimeException(esc_html($message)); } } private function get_wc_order_statuses() : array @@ -118,7 +118,7 @@ private function get_bitpay_dashboard_link(string $invoice_id) : string if ('test' === $env) { return '//test.bitpay.com/dashboard/payments/' . $invoice_id; } - throw new \RuntimeException('Wrong BitPay Environment ' . $env); + throw new \RuntimeException('Wrong BitPay Environment ' . esc_html($env)); } private function process_confirmed(Invoice $bitpay_invoice, WC_Order $order) : void { diff --git a/vendorPrefixed/BitPayLib/class-bitpaylogger.php b/vendorPrefixed/BitPayLib/class-bitpaylogger.php index 87752b21..6627b45e 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaylogger.php +++ b/vendorPrefixed/BitPayLib/class-bitpaylogger.php @@ -7,7 +7,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -18,7 +18,7 @@ public function execute($msg, string $type, bool $is_array = \false, $error = \f $bitpay_checkout_options = get_option('woocommerce_bitpay_checkout_gateway_settings'); $log_directory = plugin_dir_path(__FILE__) . '..' . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'logs/'; if (!\file_exists($log_directory) && !\mkdir($log_directory) && !\is_dir($log_directory)) { - throw new \RuntimeException(\sprintf('Directory "%s" was not created', $log_directory)); + throw new \RuntimeException(\sprintf('Directory "%s" was not created', esc_html($log_directory))); } $transaction_log = $log_directory . \date('Ymd') . '_transactions.log'; // phpcs:ignore diff --git a/vendorPrefixed/BitPayLib/class-bitpaypages.php b/vendorPrefixed/BitPayLib/class-bitpaypages.php index 59f957cc..cd08fcb1 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaypages.php +++ b/vendorPrefixed/BitPayLib/class-bitpaypages.php @@ -6,7 +6,7 @@ /** * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/BitPayLib/class-bitpaypaymentsettings.php b/vendorPrefixed/BitPayLib/class-bitpaypaymentsettings.php index c6287e6f..bd8a3062 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaypaymentsettings.php +++ b/vendorPrefixed/BitPayLib/class-bitpaypaymentsettings.php @@ -7,7 +7,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -130,14 +130,6 @@ public function get_checkout_message() : string { return $this->get_bitpay_gateway_setting('bitpay_checkout_checkout_message', ''); } - private function get_bitpay_gateway_setting(string $setting_name, $default_value = null) : ?string - { - return $this->get_bitpay_gateway_settings()[$setting_name] ?? $default_value; - } - private function get_bitpay_gateway_settings() : array - { - return get_option('woocommerce_bitpay_checkout_gateway_settings', array()); - } public function get_close_url() : ?string { return $this->get_bitpay_gateway_setting('bitpay_close_url', null); @@ -162,4 +154,17 @@ public function get_checkout_slug() : ?string } return $slug; } + public function get_payment_logo_url() : string + { + $logo = $this->get_bitpay_gateway_setting('bitpay_logo', 'BitPay-Accepted-CardGroup'); + return plugins_url('../../images/', __FILE__) . $logo . '.svg'; + } + private function get_bitpay_gateway_setting(string $setting_name, $default_value = null) : ?string + { + return $this->get_bitpay_gateway_settings()[$setting_name] ?? $default_value; + } + private function get_bitpay_gateway_settings() : array + { + return get_option('woocommerce_bitpay_checkout_gateway_settings', array()); + } } diff --git a/vendorPrefixed/BitPayLib/class-bitpaypluginsetup.php b/vendorPrefixed/BitPayLib/class-bitpaypluginsetup.php index 48194ab0..82693525 100644 --- a/vendorPrefixed/BitPayLib/class-bitpaypluginsetup.php +++ b/vendorPrefixed/BitPayLib/class-bitpaypluginsetup.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/BitPayLib/class-wcgatewaybitpay.php b/vendorPrefixed/BitPayLib/class-wcgatewaybitpay.php index a3d15c0f..09ffdd53 100644 --- a/vendorPrefixed/BitPayLib/class-wcgatewaybitpay.php +++ b/vendorPrefixed/BitPayLib/class-wcgatewaybitpay.php @@ -7,7 +7,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ @@ -35,6 +35,7 @@ public function __construct() $this->instructions = $this->get_option('instructions', $this->description); add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); add_action('woocommerce_email_before_order_table', array($this, 'email_instructions'), 10, 3); + wp_enqueue_script('bitpay_wc_gateway', plugins_url('../../js/wc_gateway_bitpay.js', __FILE__), null, 1, \false); } public function email_instructions($order, $sent_to_admin, $plain_text = \false) { @@ -44,13 +45,14 @@ public function email_instructions($order, $sent_to_admin, $plain_text = \false) } public function init_form_fields() { + $settings = new BitPayPaymentSettings(); $wc_statuses_arr = wc_get_order_statuses(); unset($wc_statuses_arr['wc-cancelled']); unset($wc_statuses_arr['wc-refunded']); unset($wc_statuses_arr['wc-failed']); $wc_statuses_arr[self::IGNORE_STATUS_VALUE] = 'Do not change status'; // add an ignore option. - $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'label' => __('Enable BitPay', 'woocommerce'), 'type' => 'checkbox', 'description' => '', 'default' => 'no'), 'bitpay_checkout_info' => array('description' => __('You should not ship any products until BitPay has finalized your transaction.
The order will stay in a Hold and/or Processing state, and will automatically change to Completed after the payment has been confirmed.', 'woocommerce'), 'type' => 'title'), 'bitpay_checkout_merchant_info' => array('description' => __('If you have not created a BitPay Merchant Token, you can create one on your BitPay Dashboard.
(Test) or (Production)

', 'woocommerce'), 'type' => 'title'), 'bitpay_checkout_tier_info' => array('description' => __('*** If you are having trouble creating BitPay invoices, verify your Tier settings on your BitPay Dashboard.', 'woocommerce'), 'type' => 'title'), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'text', 'description' => __('This is the message box that will appear on the checkout page when they select BitPay.', 'woocommerce'), 'default' => 'Pay with BitPay using one of the supported cryptocurrencies'), 'bitpay_checkout_token_dev' => array('title' => __('Development Token', 'woocommerce'), 'label' => __('Development Token', 'woocommerce'), 'type' => 'text', 'description' => 'Your development merchant token. Create one here and uncheck `Require Authentication`.', 'default' => ''), 'bitpay_checkout_token_prod' => array('title' => __('Production Token', 'woocommerce'), 'label' => __('Production Token', 'woocommerce'), 'type' => 'text', 'description' => 'Your production merchant token. Create one here and uncheck `Require Authentication`.', 'default' => ''), 'bitpay_checkout_endpoint' => array('title' => __('Endpoint', 'woocommerce'), 'type' => 'select', 'description' => __('Select Test for testing the plugin, Production when you are ready to go live.'), 'options' => array('production' => 'Production', 'test' => 'Test'), 'default' => 'test'), 'bitpay_checkout_flow' => array( + $this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'woocommerce'), 'label' => __('Enable BitPay', 'woocommerce'), 'type' => 'checkbox', 'description' => '', 'default' => 'no'), 'bitpay_logo' => array('title' => __('BitPay Logo', 'woocommerce'), 'type' => 'select', 'description' => '', 'options' => array('BitPay-Accepted-CardGroup' => 'BitPay Accepted', 'BitPay-Accepted-CardGroup-DarkMode' => 'BitPay Accepted (Dark mode)', 'Pay-with-BitPay-CardGroup' => 'Pay with BitPay', 'Pay-with-BitPay-CardGroup-DarkMode' => 'Pay with BitPay (Dark mode)', 'BitPay-Accepted-Card-Alt' => 'BitPay Accepted Card - Alt', 'BitPay-Accepted-Card-Alt-DarkMode' => 'BitPay Accepted Card - Alt (Dark mode)', 'BitPay-Accepted-Card' => 'BitPay Accepted Card', 'BitPay-Accepted-Card-DarkMode' => 'BitPay Accepted Card (Dark mode)', 'BitPay-Accepted-Card-GrayScale' => 'BitPay Accepted Card - Grayscale', 'PayWith-BitPay-Card2x' => 'Pay with BitPay Card', 'PayWith-BitPay-Card-Alt' => 'Pay with BitPay Card - Alt', 'PayWith-BitPay-Card-GrayScale' => 'Pay with BitPay Card - Grayscale', 'PayWith-BitPay-Card-DarkMode' => 'Pay with BitPay Card (Dark mode)'), 'default' => 'BitPay-Accepted-CardGroup'), 'bitpay_logo_image_white' => array('id' => 'bitpay_logo', 'description' => '', 'type' => 'title'), 'bitpay_logo_image_dark' => array('id' => 'bitpay_logo', 'description' => '', 'type' => 'title'), 'bitpay_checkout_info' => array('description' => __('You should not ship any products until BitPay has finalized your transaction.
The order will stay in a Hold and/or Processing state, and will automatically change to Completed after the payment has been confirmed.', 'woocommerce'), 'type' => 'title'), 'bitpay_checkout_merchant_info' => array('description' => __('If you have not created a BitPay Merchant Token, you can create one on your BitPay Dashboard.
(Test) or (Production)

', 'woocommerce'), 'type' => 'title'), 'bitpay_checkout_tier_info' => array('description' => __('*** If you are having trouble creating BitPay invoices, verify your Tier settings on your BitPay Dashboard.', 'woocommerce'), 'type' => 'title'), 'description' => array('title' => __('Description', 'woocommerce'), 'type' => 'text', 'description' => __('This is the message box that will appear on the checkout page when they select BitPay.', 'woocommerce'), 'default' => 'Pay with BitPay using one of the supported cryptocurrencies'), 'bitpay_checkout_token_dev' => array('title' => __('Development Token', 'woocommerce'), 'label' => __('Development Token', 'woocommerce'), 'type' => 'text', 'description' => 'Your development merchant token. Create one here and uncheck `Require Authentication`.', 'default' => ''), 'bitpay_checkout_token_prod' => array('title' => __('Production Token', 'woocommerce'), 'label' => __('Production Token', 'woocommerce'), 'type' => 'text', 'description' => 'Your production merchant token. Create one here and uncheck `Require Authentication`.', 'default' => ''), 'bitpay_checkout_endpoint' => array('title' => __('Endpoint', 'woocommerce'), 'type' => 'select', 'description' => __('Select Test for testing the plugin, Production when you are ready to go live.'), 'options' => array('production' => 'Production', 'test' => 'Test'), 'default' => 'test'), 'bitpay_checkout_flow' => array( 'title' => __('Checkout Flow', 'woocommerce'), 'type' => 'select', 'description' => __('If this is set to Redirect, then the customer will be redirected to BitPay to checkout, and return to the checkout page once the payment is made.
If this is set to Modal, the user will stay on ' . get_bloginfo('name', null) . ' and complete the transaction.', 'woocommerce'), @@ -73,8 +75,8 @@ public function process_payment($order_id) } private function get_icon_on_payment_page() : string { - $brand = '//bitpay.com/cdn/merchant-resources/pay-with-bitpay-card-group.svg'; - return $brand . '" class="bitpay_logo"'; + $settings = new BitPayPaymentSettings(); + return $settings->get_payment_logo_url() . '" id="bitpay_logo'; } private function get_processing_link() : string { diff --git a/vendorPrefixed/BitPayLib/trait-wpdbhelper.php b/vendorPrefixed/BitPayLib/trait-wpdbhelper.php index ffa4921c..07a55ceb 100644 --- a/vendorPrefixed/BitPayLib/trait-wpdbhelper.php +++ b/vendorPrefixed/BitPayLib/trait-wpdbhelper.php @@ -8,7 +8,7 @@ * Plugin Name: BitPay Checkout for WooCommerce * Plugin URI: https://www.bitpay.com * Description: BitPay Checkout Plugin - * Version: 5.1.0 + * Version: 5.2.0 * Author: BitPay * Author URI: mailto:integrations@bitpay.com?subject=BitPay Checkout for WooCommerce */ diff --git a/vendorPrefixed/vendor/autoload.php b/vendorPrefixed/vendor/autoload.php index d52f8560..e6e2422d 100644 --- a/vendorPrefixed/vendor/autoload.php +++ b/vendorPrefixed/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16::getLoader(); +return ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3::getLoader(); diff --git a/vendorPrefixed/vendor/bin/yaml-lint b/vendorPrefixed/vendor/bin/yaml-lint index 5f39880d..03af725d 100755 --- a/vendorPrefixed/vendor/bin/yaml-lint +++ b/vendorPrefixed/vendor/bin/yaml-lint @@ -88,8 +88,7 @@ if (\PHP_VERSION_ID < 80000) { } } if (\function_exists('stream_get_wrappers') && \in_array('phpvfscomposer', \stream_get_wrappers(), \true) || \function_exists('stream_wrapper_register') && \stream_wrapper_register('phpvfscomposer', 'BitPayVendor\\Composer\\BinProxyWrapper')) { - include "phpvfscomposer://" . __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint'; - exit(0); + return include "phpvfscomposer://" . __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint'; } } -include __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint'; +return include __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/vendorPrefixed/vendor/composer/ClassLoader.php b/vendorPrefixed/vendor/composer/ClassLoader.php index a72151c7..7824d8f7 100644 --- a/vendorPrefixed/vendor/composer/ClassLoader.php +++ b/vendorPrefixed/vendor/composer/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ public function __construct($vendorDir = null) } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -125,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -481,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { diff --git a/vendorPrefixed/vendor/composer/InstalledVersions.php b/vendorPrefixed/vendor/composer/InstalledVersions.php index f2a4425b..c68c79ac 100644 --- a/vendorPrefixed/vendor/composer/InstalledVersions.php +++ b/vendorPrefixed/vendor/composer/InstalledVersions.php @@ -87,7 +87,7 @@ public static function isInstalled($packageName, $includeDevRequirements = \true { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === \false; } } return \false; @@ -106,7 +106,7 @@ public static function isInstalled($packageName, $includeDevRequirements = \true */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); } @@ -285,7 +285,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (\is_file($vendorDir . '/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = (require $vendorDir . '/composer/installed.php'); + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = (require $vendorDir . '/composer/installed.php'); + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && \strtr($vendorDir . '/composer', '\\', '/') === \strtr(__DIR__, '\\', '/')) { self::$installed = $installed[\count($installed) - 1]; } @@ -296,12 +298,16 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (\substr(__DIR__, -8, 1) !== 'C') { - self::$installed = (require __DIR__ . '/installed.php'); + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = (require __DIR__ . '/installed.php'); + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } } diff --git a/vendorPrefixed/vendor/composer/autoload_real.php b/vendorPrefixed/vendor/composer/autoload_real.php index a56cd8f4..55f3a503 100644 --- a/vendorPrefixed/vendor/composer/autoload_real.php +++ b/vendorPrefixed/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16 +class ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3 { private static $loader; @@ -24,16 +24,16 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitffe20d458e05e78e2995f3c4709720b3::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitffe20d458e05e78e2995f3c4709720b3::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendorPrefixed/vendor/composer/autoload_static.php b/vendorPrefixed/vendor/composer/autoload_static.php index 7522ddaf..e7729a1e 100644 --- a/vendorPrefixed/vendor/composer/autoload_static.php +++ b/vendorPrefixed/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16 +class ComposerStaticInitffe20d458e05e78e2995f3c4709720b3 { public static $files = array ( '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', @@ -92,9 +92,9 @@ class ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitcb1b6c757473ea3fd79a32744f45be16::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitffe20d458e05e78e2995f3c4709720b3::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitffe20d458e05e78e2995f3c4709720b3::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitffe20d458e05e78e2995f3c4709720b3::$classMap; }, null, ClassLoader::class); } diff --git a/vendorPrefixed/vendor/composer/installed.php b/vendorPrefixed/vendor/composer/installed.php index d588b7c6..b4c885de 100644 --- a/vendorPrefixed/vendor/composer/installed.php +++ b/vendorPrefixed/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace BitPayVendor; -return array('root' => array('name' => 'bitpay/bitpay-checkout-for-woocommerce', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '0d1cc0588959e04c8223454ee5368daeb08e204d', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('bitpay/bitpay-checkout-for-woocommerce' => array('pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '0d1cc0588959e04c8223454ee5368daeb08e204d', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/key-utils' => array('pretty_version' => '1.1.2', 'version' => '1.1.2.0', 'reference' => '44283014751d1886b41c7de29f1972737d6dfe4d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/key-utils', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/sdk' => array('pretty_version' => '8.0.2', 'version' => '8.0.2.0', 'reference' => 'd1d9888540790f8ff35c2beff1f87bdc7fd2730d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/sdk', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.8.0', 'version' => '7.8.0.0', 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.1', 'version' => '2.0.1.0', 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.6.1', 'version' => '2.6.1.0', 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'netresearch/jsonmapper' => array('pretty_version' => 'v4.2.0', 'version' => '4.2.0.0', 'reference' => 'f60565f8c0566a31acf06884cdaa591867ecc956', 'type' => 'library', 'install_path' => __DIR__ . '/../netresearch/jsonmapper', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/yaml' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => 'e23292e8c07c85b971b44c1c4b87af52133e2add', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'bitpay/bitpay-checkout-for-woocommerce', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '2a221064951e8a2d9a598af81f7c0804c34402e8', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('bitpay/bitpay-checkout-for-woocommerce' => array('pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => '2a221064951e8a2d9a598af81f7c0804c34402e8', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/key-utils' => array('pretty_version' => '1.1.2', 'version' => '1.1.2.0', 'reference' => '44283014751d1886b41c7de29f1972737d6dfe4d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/key-utils', 'aliases' => array(), 'dev_requirement' => \false), 'bitpay/sdk' => array('pretty_version' => '8.0.2', 'version' => '8.0.2.0', 'reference' => 'd1d9888540790f8ff35c2beff1f87bdc7fd2730d', 'type' => 'library', 'install_path' => __DIR__ . '/../bitpay/sdk', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.8.0', 'version' => '7.8.0.0', 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/promises' => array('pretty_version' => '2.0.1', 'version' => '2.0.1.0', 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => \false), 'guzzlehttp/psr7' => array('pretty_version' => '2.6.1', 'version' => '2.6.1.0', 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => \false), 'netresearch/jsonmapper' => array('pretty_version' => 'v4.2.0', 'version' => '4.2.0.0', 'reference' => 'f60565f8c0566a31acf06884cdaa591867ecc956', 'type' => 'library', 'install_path' => __DIR__ . '/../netresearch/jsonmapper', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-client-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.0.2', 'version' => '1.0.2.0', 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-factory-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => \false), 'psr/http-message-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/yaml' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => 'e23292e8c07c85b971b44c1c4b87af52133e2add', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendorPrefixed/vendor/scoper-autoload.php b/vendorPrefixed/vendor/scoper-autoload.php index eafae437..4bcfd422 100644 --- a/vendorPrefixed/vendor/scoper-autoload.php +++ b/vendorPrefixed/vendor/scoper-autoload.php @@ -30,7 +30,7 @@ function humbug_phpscoper_expose_class(string $exposed, string $prefixed): void } humbug_phpscoper_expose_class('JsonMapper', 'BitPayVendor\JsonMapper'); humbug_phpscoper_expose_class('JsonMapper_Exception', 'BitPayVendor\JsonMapper_Exception'); -humbug_phpscoper_expose_class('ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16', 'BitPayVendor\ComposerAutoloaderInitcb1b6c757473ea3fd79a32744f45be16'); +humbug_phpscoper_expose_class('ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3', 'BitPayVendor\ComposerAutoloaderInitffe20d458e05e78e2995f3c4709720b3'); humbug_phpscoper_expose_class('ErrorTest', 'BitPayVendor\ErrorTest'); humbug_phpscoper_expose_class('SecureRandomTest', 'BitPayVendor\SecureRandomTest'); humbug_phpscoper_expose_class('Base58Test', 'BitPayVendor\Base58Test');