-
Notifications
You must be signed in to change notification settings - Fork 8
/
fawry-payment-gateway.php
55 lines (44 loc) · 1.51 KB
/
fawry-payment-gateway.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
<?php
/*
* Plugin Name: WooCommerce Fawry Payment Gateway
* Plugin URI: https://github.com/taekunger/Woocommerce-Fawry-Payment-Gateway.git
* Description: Pay for your Order with any Credit or Debit Card or through Fawry Machines
* Author: Nady Shalaby
* Author URI: https://github.com/taekunger
* 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_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_add_gateway_class($gateways)
{
$gateways[] = 'WC_Fawry_Gateway'; // your class name is here
return $gateways;
}
add_filter('woocommerce_payment_gateways', 'fawry_add_gateway_class');
require_once plugin_dir_path(__FILE__) . '/inc/redefine-pluggable-functions.php';
/*
* Load `WC_Fawry_Gateway` class on 'plugins_loaded' hook.
*/
add_action('plugins_loaded', 'fawry_init_gateway_class');
function fawry_init_gateway_class()
{
require_once plugin_dir_path(__FILE__) . '/inc/class-wc-fawry-gateway.php';
}