-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrypto-payment-gateway-reown-appkit-pay-walletconnect-for-woocommerce.php
More file actions
63 lines (52 loc) · 2.45 KB
/
Copy pathcrypto-payment-gateway-reown-appkit-pay-walletconnect-for-woocommerce.php
File metadata and controls
63 lines (52 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
defined('ABSPATH') || exit;
// @phpcs:disable PSR1.Files.SideEffects
// @phpcs:disable Generic.Files.LineLength
/**
* Plugin Name: Reown Payment Gateway
* Version: 1.0.2
* Plugin URI: https://beycanpress.com/
* Description: Accept cryptocurrency payments in your WooCommerce store using Reown (WalletConnect) payment gateway.
* Author: BeycanPress LLC
* Author URI: https://beycanpress.com
* License: GPLv3
* Text Domain: crypto-payment-gateway-reown-appkit-pay-walletconnect-for-woocommerce
* Domain Path: /languages
* Tags: crypto, cryptocurrency, bitcoin, ethereum, woocommerce, payment gateway, walletconnect, reown, appkit pay
* Requires at least: 5.0
* Tested up to: 6.8
* Requires PHP: 8.1
*/
require __DIR__ . '/vendor/autoload.php';
define('REOWN_PAYMENT_GATEWAY_VERSION', '1.0.0');
define('REOWN_PAYMENT_GATEWAY_URL', plugin_dir_url(__FILE__));
define('REOWN_PAYMENT_GATEWAY_PATH', plugin_dir_path(__FILE__));
new BeycanPress\ReownPaymentGateway\OtherPlugins(__FILE__);
add_action('before_woocommerce_init', function (): void {
if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', __FILE__, true);
}
});
add_filter('plugin_action_links_' . plugin_basename(__FILE__), function (array $links): array {
// @phpcs:disable
$links[] = '<a href="https://1.envato.market/jejdYn" style="color: #389e38;font-weight: bold;" target="_blank">' . esc_html__('Buy Premium', 'cryptopay') . '</a>';
// @phpcs:enable
return $links;
});
add_action('plugins_loaded', function (): void {
if (!defined('REOWN_PAYMENT_GATEWAY_PREMIUM')) {
add_filter('woocommerce_payment_gateways', function ($gateways) {
$gateways[] = \BeycanPress\ReownPaymentGateway\Gateway::class;
return $gateways;
});
add_action('woocommerce_blocks_loaded', function (): void {
if (class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) {
add_action('woocommerce_blocks_payment_method_type_registration', function ($registry): void {
$registry->register(new BeycanPress\ReownPaymentGateway\BlocksGateway());
});
}
});
}
});