This repository has been archived by the owner on Dec 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.php
executable file
·65 lines (55 loc) · 1.91 KB
/
index.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
/**
* @link http://ash2osh.com
* @since 1.0.0
* @package ash2osh_faw
*
* @wordpress-plugin
* Plugin Name: @Fawry Payment
* Plugin URI: http://ash2osh.com
* Description: made by ash2osh for safkaonline site.
* Version: 1.0.0
* Author: ash2osh
* Author URI: http://ash2osh.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: ash2osh_faw
* Domain Path: /languages
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
/**
* Check if WooCommerce is active
* */
if (!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
exit;
}
////////////////CONSTANTS//////////////////////
define('ASH2OSH_FAW_PAYMENT_METHOD','ash2osh_faw');
//////////////////////////////////////////////
// gets the absolute path to this plugin directory
function ash2osh_faw_plugin_path() {
return untrailingslashit(plugin_dir_path(__FILE__));
}
if (!defined('ASH2OSH_FAW_URL')) {
define('ASH2OSH_FAW_URL', plugin_dir_url(__FILE__));
}
//add class to woo commerce payment methods
function add_ash2osh_faw_gateway_class($methods) {
$methods[] = 'wc_gateway_at_fawry_payment';
return $methods;
}
add_filter('woocommerce_payment_gateways', 'add_ash2osh_faw_gateway_class');
//register class
function init_ash2osh_faw_gateway_class() {
require_once 'inc/wc_gateway_at_fawry_payment.php';
}
add_action('plugins_loaded', 'init_ash2osh_faw_gateway_class');
/////////////////includes////////////////////////
require_once 'inc/thankyoupage_customizer.php';
require_once 'inc/cancel_unpaid_on_hold_schedule.php';
require_once 'inc/activation.php';
require_once 'inc/ajax_payment_sucess.php';
register_activation_hook( __FILE__, 'ash2osh_faw_activate' );
register_deactivation_hook(__FILE__, 'ash2osh_faw_deactivate');