-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpagbank-for-woocommerce.php
64 lines (55 loc) · 1.81 KB
/
pagbank-for-woocommerce.php
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
64
<?php
/**
* Plugin Name: PagBank for WooCommerce
* Plugin URI: https://github.com/pagseguro/pagbank-for-woocommerce
* Description: Aceite pagamentos via cartão de crédito, boleto e Pix no checkout do WooCommerce através do PagBank.
* Version: 1.2.1
* Author: PagBank
* Author URI: https://pagseguro.uol.com.br/
* License: GPL-2.0
* Requires PHP: 7.4
* WC requires at least: 3.9
* WC tested up to: 9.3
* Text Domain: pagbank-for-woocommerce
*
* @package PagBank_WooCommerce
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use Automattic\WooCommerce\Utilities\FeaturesUtil;
use PagBank_WooCommerce\Marketplace\WcfmIntegration;
use PagBank_WooCommerce\Presentation\ConnectAjaxApi;
use PagBank_WooCommerce\Presentation\Helpers;
use PagBank_WooCommerce\Presentation\Hooks;
use PagBank_WooCommerce\Presentation\PaymentGateways;
use PagBank_WooCommerce\Presentation\PaymentGatewaysFields;
use PagBank_WooCommerce\Presentation\WebhookHandler;
define( 'PAGBANK_WOOCOMMERCE_FILE_PATH', __FILE__ );
define( 'PAGBANK_WOOCOMMERCE_VERSION', '1.2.1' );
define( 'PAGBANK_WOOCOMMERCE_TEMPLATES_PATH', plugin_dir_path( PAGBANK_WOOCOMMERCE_FILE_PATH ) . 'src/templates/' );
add_action(
'before_woocommerce_init',
function () {
if ( class_exists( FeaturesUtil::class ) ) {
FeaturesUtil::declare_compatibility( 'custom_order_tables', PAGBANK_WOOCOMMERCE_FILE_PATH, true );
}
}
);
( function () {
$autoload_filepath = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $autoload_filepath ) ) {
require_once $autoload_filepath;
}
if ( ! Helpers::is_woocommerce_activated() ) {
return;
}
PaymentGatewaysFields::get_instance();
PaymentGateways::get_instance();
Hooks::get_instance();
ConnectAjaxApi::get_instance();
WebhookHandler::get_instance();
if ( Helpers::is_wcfm_activated() ) {
WcfmIntegration::get_instance();
}
} )();