-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
<?php | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
exit; | ||
} | ||
|
||
use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; | ||
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodTypeInterface; | ||
|
||
final class DePay_WC_Payments_Block_Worldchain extends AbstractPaymentMethodType { | ||
|
||
private $gateway; | ||
|
||
public $name = DePay_WC_Payments_Worldchain_Gateway::GATEWAY_ID; | ||
|
||
public function initialize() { | ||
$this->gateway = new DePay_WC_Payments_Worldchain_Gateway(); | ||
$this->settings = array( | ||
'blockchains' => '["worldchain"]' | ||
); | ||
} | ||
|
||
public function is_active() { | ||
return $this->gateway->is_available(); | ||
} | ||
|
||
public function get_payment_method_script_handles() { | ||
|
||
wp_register_script( | ||
'DEPAY_WC_BLOCKS_INTEGRATION', | ||
plugins_url( 'dist/block.js', DEPAY_WC_PLUGIN_FILE ), | ||
array( 'wc-blocks-registry', 'wc-settings', 'wp-element' ), | ||
DEPAY_CURRENT_VERSION, | ||
true | ||
); | ||
|
||
return [ 'DEPAY_WC_BLOCKS_INTEGRATION' ]; | ||
} | ||
|
||
public function get_payment_method_data() { | ||
return array( | ||
'id' => $this->gateway->id, | ||
'title' => $this->gateway->title, | ||
'description' => $this->gateway->description, | ||
'enabled' => $this->gateway->is_available(), | ||
'blockchains' => ['worldchain'], | ||
'pluginUrl' => plugin_dir_url( __FILE__ ), | ||
); | ||
} | ||
private $gateway; | ||
|
||
public $name = DePay_WC_Payments_Worldchain_Gateway::GATEWAY_ID; | ||
|
||
public function initialize() { | ||
$this->gateway = new DePay_WC_Payments_Worldchain_Gateway(); | ||
$this->settings = array( | ||
'blockchains' => '["worldchain"]' | ||
); | ||
} | ||
|
||
public function is_active() { | ||
return $this->gateway->is_available(); | ||
} | ||
|
||
public function get_payment_method_script_handles() { | ||
|
||
wp_register_script( | ||
'DEPAY_WC_BLOCKS_INTEGRATION', | ||
plugins_url( 'dist/block.js', DEPAY_WC_PLUGIN_FILE ), | ||
array( 'wc-blocks-registry', 'wc-settings', 'wp-element' ), | ||
DEPAY_CURRENT_VERSION, | ||
true | ||
); | ||
|
||
return [ 'DEPAY_WC_BLOCKS_INTEGRATION' ]; | ||
} | ||
|
||
public function get_payment_method_data() { | ||
return array( | ||
'id' => $this->gateway->id, | ||
'title' => $this->gateway->title, | ||
'description' => $this->gateway->description, | ||
'enabled' => $this->gateway->is_available(), | ||
'blockchains' => ['worldchain'], | ||
'pluginUrl' => plugin_dir_url( __FILE__ ), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
exit; | ||
} | ||
|
||
class DePay_WC_Payments_Worldchain_Gateway extends DePay_WC_Payments_Gateway { | ||
|
||
const GATEWAY_ID = 'depay_wc_payments_worldchain'; | ||
const GATEWAY_ID = 'depay_wc_payments_worldchain'; | ||
|
||
public function __construct() { | ||
$this->id = static::GATEWAY_ID; | ||
$this->method_title = 'World Chain'; | ||
$this->method_description = 'Payments on World Chain.'; | ||
$this->supports = [ 'products' ]; | ||
$this->init_form_fields(); | ||
$this->init_settings(); | ||
$title = 'World Chain'; | ||
$this->title = $title; | ||
$description = get_option( 'depay_wc_checkout_description_worldchain' ); | ||
$this->description = empty($description) ? null : $description; | ||
$this->blockchain = 'worldchain'; | ||
} | ||
public function __construct() { | ||
$this->id = static::GATEWAY_ID; | ||
$this->method_title = 'World Chain'; | ||
$this->method_description = 'Payments on World Chain.'; | ||
$this->supports = [ 'products' ]; | ||
$this->init_form_fields(); | ||
$this->init_settings(); | ||
$title = 'World Chain'; | ||
$this->title = $title; | ||
$description = get_option( 'depay_wc_checkout_description_worldchain' ); | ||
$this->description = empty($description) ? null : $description; | ||
$this->blockchain = 'worldchain'; | ||
} | ||
} |