forked from r-martins/PagBank-WooCommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrm-pagbank.php
More file actions
61 lines (52 loc) · 2.31 KB
/
rm-pagbank.php
File metadata and controls
61 lines (52 loc) · 2.31 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
<?php
/**
* PagSeguro Connect - Ricardo Martins (com descontos)
*
* @package PagSeguroConnect
* @author Ricardo Martins
* @copyright 2024 Ricardo Martins
* @license GPL-3.0
*
* @wordpress-plugin
* Plugin Name: PagBank Connect
* Description: Integra seu WooCommerce com as APIs PagSeguro v4 através da aplicação de Ricardo Martins (com descontos nas taxas oficiais), com suporte a PIX transparente e muito mais.
* Version: 4.11.2
* Requires at least: 5.2
* Tested up to: 6.5
* Requires PHP: 7.4
* Author: Ricardo Martins (PagSeguro/PagBank Integrações)
* Author URI: https://magenteiro.com
* License: GPL-3.0
* License URI: https://opensource.org/license/gpl-3/
* Text Domain: pagbank-connect
* Domain Path: /languages
*/
/** @noinspection PhpDefineCanBeReplacedWithConstInspection */
use RM_PagBank\Connect;
use RM_PagBank\Connect\Gateway;
use RM_PagBank\EnvioFacil;
// Prevent direct file access.
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
// Plugin constants.
define( 'WC_PAGSEGURO_CONNECT_VERSION', '4.11.2' );
define( 'WC_PAGSEGURO_CONNECT_PLUGIN_FILE', __FILE__ );
define( 'WC_PAGSEGURO_CONNECT_BASE_DIR', __DIR__ );
define( 'WC_PAGSEGURO_CONNECT_TEMPLATES_DIR', WC_PAGSEGURO_CONNECT_BASE_DIR . '/src/templates/' );
define( 'WC_PAGSEGURO_CONNECT_URL', plugins_url( __FILE__ ) );
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
add_action('init', [Connect::class, 'init']);
add_action('init', [Connect\Recurring::class, 'addManageSubscriptionEndpoints']);
add_action('plugins_loaded', [Connect::class, 'loadTextDomain']);
// Add Gateway
add_filter('woocommerce_payment_gateways', array(Connect::class, 'addGateway'));
//envio facil
add_filter('woocommerce_shipping_methods', [EnvioFacil::class, 'addMethod']);
//recurring and styles
add_filter('woocommerce_enqueue_styles', [Gateway::class, 'addStyles'], 99, 1);
add_filter('woocommerce_enqueue_styles', [Gateway::class, 'addStylesWoo'], 99, 1);
//not needed so far...
register_activation_hook(__FILE__, [Connect::class, 'activate']);
register_deactivation_hook(__FILE__, [Connect::class, 'deactivate']);
register_uninstall_hook(__FILE__, [Connect::class, 'uninstall']);