Skip to content

Commit

Permalink
Merge pull request #71 from mwarzybok-sumoheavy/feature/SP-761
Browse files Browse the repository at this point in the history
Feature/sp 761
  • Loading branch information
p-maguire authored Jan 19, 2024
2 parents 48986ea + 0e2530a commit e7d4283
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
14 changes: 8 additions & 6 deletions BitPayLib/class-bitpayipnprocess.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ private function process_confirmed( Invoice $bitpay_invoice, WC_Order $order ):
$wordpress_order_status = $this->get_gateway_settings()['bitpay_checkout_order_process_confirmed_status'];
if ( WcGatewayBitpay::IGNORE_STATUS_VALUE === $wordpress_order_status ) {
$order->add_order_note(
'BitPay Invoice ID: <a target = "_blank" href = "'
. $this->get_bitpay_dashboard_link( $invoice_id ) . '">' . $invoice_id
. '</a> has changed to Confirmed. The order status has not been updated due to your settings.'
$this->get_start_order_note( $invoice_id ) . ' has changed to Confirmed. The order status has not been updated due to your settings.'
);
return;
}
Expand All @@ -160,8 +158,7 @@ private function process_confirmed( Invoice $bitpay_invoice, WC_Order $order ):
}

$order->add_order_note(
'BitPay Invoice ID: <a target = "_blank" href = "'
. $this->get_bitpay_dashboard_link( $invoice_id ) . '">' . $invoice_id . '</a> has changed to ' . $new_status . '.'
$this->get_start_order_note( $invoice_id ) . ' has changed to ' . $new_status . '.'
);
if ( 'wc-completed' === $wordpress_order_status ) {
$order->payment_complete();
Expand Down Expand Up @@ -262,10 +259,15 @@ private function process_refunded( Invoice $bitpay_invoice, WC_Order $order ): v

private function process_processing( Invoice $bitpay_invoice, WC_Order $order ): void {
$this->validate_bitpay_status_in_available_statuses( $bitpay_invoice, array( 'paid' ) );
$order->add_order_note( $this->get_start_order_note( $bitpay_invoice->getId() ) . 'is paid and awaiting confirmation.' );
$invoice_id = $bitpay_invoice->getId();
$order->add_order_note( $this->get_start_order_note( $invoice_id ) . 'is paid and awaiting confirmation.' );

$wordpress_order_status = $this->get_gateway_settings()['bitpay_checkout_order_process_paid_status'];
if ( WcGatewayBitpay::IGNORE_STATUS_VALUE === $wordpress_order_status ) {
$order->add_order_note(
$this->get_start_order_note( $invoice_id )
. 'is paid and awaiting confirmation. The order status has not been updated due to your settings.'
);
return;
}

Expand Down
9 changes: 1 addition & 8 deletions BitPayLib/class-bitpaypluginsetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function add_error_page(): void {

private function validate_woo_commerce(): array {
global $woocommerce;
if ( true === empty( $woocommerce ) ) {
if ( null === $woocommerce ) {
return array( 'The WooCommerce plugin for WordPress needs to be installed and activated. Please contact your web server administrator for assistance.' );
}

Expand Down Expand Up @@ -217,12 +217,5 @@ function () {
},
5
);

add_action(
'woocommerce_blocks_payment_method_type_registration',
function ( $registry ) {
$registry->register( new BitPayPaymentsBlocks() );
}
);
}
}
1 change: 0 additions & 1 deletion BitPayLib/class-wcgatewaybitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function __construct() {

$this->has_fields = true;
$this->method_title = __( $this->get_bitpay_version_info(), 'wc-bitpay' ); // phpcs:ignore
$this->method_label = __( 'BitPay', 'wc-bitpay' );
$this->method_description = __( 'Expand your payment options by accepting cryptocurrency payments (BTC, BCH, ETH, and Stable Coins) without risk or price fluctuations.', 'wc-bitpay' );

if ( empty( $_GET['woo-bitpay-return'] ) ) { // phpcs:ignore
Expand Down

0 comments on commit e7d4283

Please sign in to comment.