v1.5.0
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;
|
||||
|
||||
final class WC_Payanyway_Blocks extends AbstractPaymentMethodType {
|
||||
|
||||
protected $name = 'payanyway';
|
||||
protected $settings;
|
||||
|
||||
public function initialize() {
|
||||
$this->settings = get_option('woocommerce_payanyway_settings', []);
|
||||
}
|
||||
|
||||
public function get_payment_method_script_handles() {
|
||||
wp_register_script(
|
||||
'payanyway-blocks-integration',
|
||||
plugin_dir_url(__FILE__) . 'blocks.js',
|
||||
[
|
||||
'wc-blocks-registry',
|
||||
'wc-settings',
|
||||
'wp-element',
|
||||
'wp-html-entities',
|
||||
'wp-i18n',
|
||||
],
|
||||
null,
|
||||
true
|
||||
);
|
||||
|
||||
return ['payanyway-blocks-integration'];
|
||||
}
|
||||
|
||||
public function get_payment_method_data() {
|
||||
$gateway = WC()->payment_gateways()->payment_gateways()['payanyway'];
|
||||
|
||||
return [
|
||||
'title' => $gateway->settings['title'],
|
||||
'description' => $gateway->settings['description'],
|
||||
'icon' => $gateway->icon
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user