Skip to content

Commit

Permalink
Update class-wc-dummy-payments-blocks.php
Browse files Browse the repository at this point in the history
The existing way of doing things end up initiating the main gateway class twice, this might result on bugs or events triggred twice.
  • Loading branch information
senadir authored Dec 13, 2023
1 parent 186c2b4 commit 892524c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/blocks/class-wc-dummy-payments-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ final class WC_Gateway_Dummy_Blocks_Support extends AbstractPaymentMethodType {
*/
public function initialize() {
$this->settings = get_option( 'woocommerce_dummy_settings', [] );
$this->gateway = new WC_Gateway_Dummy();
$gateways = WC()->payment_gateways->get_available_payment_gateways();
$this->gateway = $gateways['dummy'];
}

/**
Expand Down

0 comments on commit 892524c

Please sign in to comment.