-
Notifications
You must be signed in to change notification settings - Fork 1
/
fawry-pay.php
executable file
·54 lines (44 loc) · 1.4 KB
/
fawry-pay.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
<?php
/*
* Plugin Name: Fawry Pay
* Plugin URI: https://github.com/fr3on/fawry-pay
* Description: Fawry Pay for your Order with any Credit or Debit Card or through Fawry Machines
* Author: Fr3on
* Author URI: https://github.com/fr3on
* Version: 1.0.0
*/
defined('ABSPATH') or die('No scripting kidding');
/**
* Check if WooCommerce is active
* */
if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
exit;
}
defined('FAWRY_PLUGIN_PATH') or define('FAWRY_PLUGIN_PATH', plugin_dir_path(__FILE__));
defined('FAWRY_PLUGIN_URI') or define('FAWRY_PLUGIN_URI', plugin_dir_url(__FILE__));
/**
* Load plugin textdomain.
*/
function fawry_pay_load_textdomain()
{
load_plugin_textdomain('fawry_textdomain', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
add_action('init', 'fawry_load_textdomain');
/*
* This action hook registers our PHP class as a WooCommerce payment gateway
*/
function fawry_pay_add_class($gateways)
{
$gateways[] = 'WC_Fawry_Pay';
return $gateways;
}
add_filter('woocommerce_payment_gateways', 'fawry_pay_add_class');
require_once plugin_dir_path(__FILE__) . '/inc/redefine-pluggable-functions.php';
/*
* Load `WC_Fawry_Pay` class on 'plugins_loaded' hook.
*/
add_action('plugins_loaded', 'fawry_pay_init_class');
function fawry_pay_init_class()
{
require_once plugin_dir_path(__FILE__) . '/inc/class-wc-fawry-pay.php';
}