-
Notifications
You must be signed in to change notification settings - Fork 2
/
wc-webmoney.php
88 lines (78 loc) · 1.67 KB
/
wc-webmoney.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* Plugin Name: Payment gateway - Webmoney for WooCommerce
* Description: Allows you to use Webmoney payment gateway with the WooCommerce plugin.
* Plugin URI: https://mofsy.ru/projects/wc-webmoney
* Version: 2.1.0
* WC requires at least: 3.2
* WC tested up to: 5.1
* Text Domain: wc-webmoney
* Domain Path: /languages
* Author: Mofsy
* Author URI: https://mofsy.ru
* Copyright: Mofsy © 2015-2021
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Mofsy/WC_Webmoney
*/
defined('ABSPATH') || exit;
/**
* Run
*
* @action wc_webmoney_init
*/
add_action('plugins_loaded', 'wc_webmoney_init', 0);
/**
* Init plugin gateway
*
* @action wc_webmoney_gateway_init_before
* @action wc_webmoney_gateway_init_after
*/
function wc_webmoney_init()
{
// hook
do_action('wc_webmoney_gateway_init_before');
/**
* Main check
*/
if (!class_exists('WC_Payment_Gateway') || class_exists('WC_Webmoney'))
{
return;
}
/**
* Define plugin url
*/
if (!defined( 'WC_WEBMONEY_URL' ))
{
define('WC_WEBMONEY_URL', plugin_dir_url(__FILE__));
}
/**
* Plugin Dir
*/
if (!defined( 'WC_WEBMONEY_PLUGIN_DIR' ))
{
define( 'WC_WEBMONEY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
/**
* Plugin Name
*/
if (!defined( 'WC_WEBMONEY_PLUGIN_NAME' ))
{
define( 'WC_WEBMONEY_PLUGIN_NAME', plugin_basename( __FILE__ ) );
}
/**
* GateWork
*/
include_once __DIR__ . '/gatework/init.php';
/**
* Gateway main class
*/
include_once __DIR__ . '/includes/class-wc-webmoney.php';
/**
* Run
*/
WC_Webmoney::instance();
// hook
do_action('wc_webmoney_gateway_init_after');
}